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

[PATCH 13/18] Fix inconsistent annotations


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
  • Date: Fri, 16 Oct 2026 15:26:50 +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: Fri, 16 Oct 2026 13:27:11 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Warnings are raised on some functions that have inconsistent annotations with
types defined in wdm.h.
We trust wdm.h annotations and annotate them with _Use_decl_annotations_ to
sync the annotations.

Signed-off-by: Césaire Mounah <cesaire.mounah@xxxxxxxxxx>
---
 src/xencrsh/driver.c | 13 +++++++------
 src/xenvbd/adapter.c | 13 +++++++------
 src/xenvbd/driver.c  | 10 ++++++----
 src/xenvbd/ring.c    |  5 +++--
 4 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/src/xencrsh/driver.c b/src/xencrsh/driver.c
index 5874dea..743d942 100644
--- a/src/xencrsh/driver.c
+++ b/src/xencrsh/driver.c
@@ -191,14 +191,15 @@ HwAdapterControl(
 
 HW_FIND_ADAPTER     HwFindAdapter;
 
+_Use_decl_annotations_
 ULONG
 HwFindAdapter(
-    _In_ PVOID                              HwDeviceExtension,
-    _In_ PVOID                              Context,
-    _In_ PVOID                              BusInformation,
-    _In_ PSTR                               ArgumentString,
-    _Inout_ PPORT_CONFIGURATION_INFORMATION ConfigInfo,
-    _In_ PBOOLEAN                           Again
+    PVOID                           HwDeviceExtension,
+    PVOID                           Context,
+    PVOID                           BusInformation,
+    PSTR                            ArgumentString,
+    PPORT_CONFIGURATION_INFORMATION ConfigInfo,
+    PBOOLEAN                        Again
     )
 {
     UNREFERENCED_PARAMETER(Context);
diff --git a/src/xenvbd/adapter.c b/src/xenvbd/adapter.c
index 5809af7..7158db0 100644
--- a/src/xenvbd/adapter.c
+++ b/src/xenvbd/adapter.c
@@ -2096,14 +2096,15 @@ AdapterHwAdapterControl(
 
 HW_FIND_ADAPTER     AdapterHwFindAdapter;
 
+_Use_decl_annotations_
 ULONG
 AdapterHwFindAdapter(
-    _In_ PVOID                              DevExt,
-    _In_ PVOID                              Context,
-    _In_ PVOID                              BusInformation,
-    _In_ PSTR                               ArgumentString,
-    _Inout_ PPORT_CONFIGURATION_INFORMATION ConfigInfo,
-    _In_ PBOOLEAN                           Again
+    PVOID                           DevExt,
+    PVOID                           Context,
+    PVOID                           BusInformation,
+    PSTR                            ArgumentString,
+    PPORT_CONFIGURATION_INFORMATION ConfigInfo,
+    PBOOLEAN                        Again
     )
 {
     UNREFERENCED_PARAMETER(DevExt);
diff --git a/src/xenvbd/driver.c b/src/xenvbd/driver.c
index 1b6b191..44c660d 100644
--- a/src/xenvbd/driver.c
+++ b/src/xenvbd/driver.c
@@ -114,10 +114,11 @@ DriverDispatchPower(
 _Dispatch_type_(IRP_MJ_PNP)
 DRIVER_DISPATCH             DispatchPnp;
 
+_Use_decl_annotations_
 NTSTATUS 
 DispatchPnp(
-    _In_ PDEVICE_OBJECT DeviceObject,
-    _In_ PIRP           Irp
+    PDEVICE_OBJECT  DeviceObject,
+    PIRP            Irp
     )
 {
     if (Driver.Adapter == NULL)
@@ -129,10 +130,11 @@ DispatchPnp(
 _Dispatch_type_(IRP_MJ_POWER)
 DRIVER_DISPATCH             DispatchPower;
 
+_Use_decl_annotations_
 NTSTATUS 
 DispatchPower(
-    _In_ PDEVICE_OBJECT DeviceObject,
-    _In_ PIRP           Irp
+    PDEVICE_OBJECT  DeviceObject,
+    PIRP            Irp
     )
 {
     if (Driver.Adapter == NULL)
diff --git a/src/xenvbd/ring.c b/src/xenvbd/ring.c
index 1d8df78..31c8b65 100644
--- a/src/xenvbd/ring.c
+++ b/src/xenvbd/ring.c
@@ -1611,10 +1611,11 @@ BlkifRingReleaseLock(
 
 KSERVICE_ROUTINE    BlkifRingInterrupt;
 
+_Use_decl_annotations_
 BOOLEAN
 BlkifRingInterrupt(
-    _In_ PKINTERRUPT    InterruptObject,
-    _In_ PVOID          Argument
+    PKINTERRUPT         InterruptObject,
+    PVOID               Argument
     )
 {
     PXENVBD_BLKIF_RING  BlkifRing = Argument;
-- 
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®.