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

[PATCH 10/17] driver: fix annotation errors


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

* DRIVER_DISPATCH in wdm.h is annotated as (_In_, _Inout_), so
we annotate Dispatch the same.
* __DriverSetDriverObject and __DriverSetParametersKey are called with
DriverObject parameter set as Null on DriverEntry failure cleanup path and
DriverUnload cleanup respectively. DriverObject should be annotated as _opt_
in both cases.

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

diff --git a/src/xeniface/driver.c b/src/xeniface/driver.c
index 74192cf..7c7d7e9 100644
--- a/src/xeniface/driver.c
+++ b/src/xeniface/driver.c
@@ -51,7 +51,7 @@ static XENIFACE_DRIVER  Driver;
 
 static FORCEINLINE VOID
 __DriverSetDriverObject(
-    _In_ PDRIVER_OBJECT DriverObject
+    _In_opt_ PDRIVER_OBJECT DriverObject
     )
 {
     Driver.DriverObject = DriverObject;
@@ -75,7 +75,7 @@ DriverGetDriverObject(
 
 static FORCEINLINE VOID
 __DriverSetParametersKey(
-    _In_ HANDLE Key
+    _In_opt_ HANDLE Key
     )
 {
     Driver.ParametersKey = Key;
@@ -165,12 +165,12 @@ DRIVER_DISPATCH Dispatch;
 
 NTSTATUS 
 Dispatch(
-    _In_ PDEVICE_OBJECT DeviceObject,
-    _In_ PIRP           Irp
+    _In_ PDEVICE_OBJECT     DeviceObject,
+    _Inout_ PIRP            Irp
     )
 {
-    PXENIFACE_DX        Dx;
-    NTSTATUS            status;
+    PXENIFACE_DX            Dx;
+    NTSTATUS                status;
 
     Dx = (PXENIFACE_DX)DeviceObject->DeviceExtension;
     ASSERT3P(Dx->DeviceObject, ==, DeviceObject);
-- 
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®.