[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 04/17] wmi: fix some anntotations


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
  • Date: Mon, 5 Oct 2026 14:07:45 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Cc: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
  • Delivery-date: Mon, 05 Oct 2026 12:08:04 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

WriteCountedUnicodeString() only writes in location, and the RtlCopyMemory
is annotated as (_Out_, _In_, _In_), so location should be annotated as
_Out_.[1]

Functions that calls it are updated accordingly.

[1]: 
https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlcopymemory

Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
---
 src/xeniface/wmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/xeniface/wmi.c b/src/xeniface/wmi.c
index fac86ee..c2488f8 100644
--- a/src/xeniface/wmi.c
+++ b/src/xeniface/wmi.c
@@ -446,7 +446,7 @@ GetCountedUnicodeStringSize(
 static VOID
 WriteCountedUnicodeString(
     _In_ PCUNICODE_STRING   ustr,
-    _In_ PUCHAR             location
+    _Out_ PUCHAR            location
     )
 {
     *((USHORT*)location) = ustr->Length;
@@ -458,7 +458,7 @@ WriteCountedUnicodeString(
 static NTSTATUS
 WriteCountedUTF8String(
     _In_ const CHAR     *string,
-    _In_ PUCHAR         location
+    _Out_ PUCHAR        location
     )
 {
     UNICODE_STRING      unicode;
@@ -583,7 +583,7 @@ static NTSTATUS
 WriteInstanceName(
     _In_ PXENIFACE_FDO  Fdo,
     _In_ const CHAR     *string,
-    _In_ PUCHAR         location
+    _Out_ PUCHAR        location
     )
 {
     UNICODE_STRING      destination;
-- 
2.55.0.windows.5



--
Césaire Mounah | Vates Windows Guest Tools Engineer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.