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

[PATCH 1/3] Dont disable warning 4100



From: Matthew Sykes <matthew.sykes@xxxxxxxxxx>

Adds UNREFERENCED_PARAMETER macros instead of suppressing the warning.

Suggested-by: Matthew Sykes <matthew.sykes@xxxxxxxxxx>
Signed-off-by: Owen Smith <owen.smith@xxxxxxxxx>
---
 src/xeniface/driver.h        |  2 +-
 src/xeniface/ioctl_gnttab.c  |  2 ++
 src/xeniface/ioctl_suspend.c |  2 ++
 src/xeniface/ioctls.c        |  2 ++
 src/xeniface/wmi.c           | 49 ++++++++++++++++++++++++++++++++++++
 5 files changed, 56 insertions(+), 1 deletion(-)

diff --git a/src/xeniface/driver.h b/src/xeniface/driver.h
index 4fb6308..27cd453 100644
--- a/src/xeniface/driver.h
+++ b/src/xeniface/driver.h
@@ -42,7 +42,7 @@
 #define NTSTRSAFE_LIB
 #include <ntstrsafe.h>
 
-#pragma warning(disable:4100 4057)
+#pragma warning(disable: 4057)
 
 #include <wmilib.h>
 #include <ntifs.h>
diff --git a/src/xeniface/ioctl_gnttab.c b/src/xeniface/ioctl_gnttab.c
index c3cf129..b6b7327 100644
--- a/src/xeniface/ioctl_gnttab.c
+++ b/src/xeniface/ioctl_gnttab.c
@@ -424,6 +424,8 @@ IoctlGnttabRevokeForeignAccess(
     PIRP PendingIrp;
     PXENIFACE_CONTEXT_ID ContextId;
 
+    UNREFERENCED_PARAMETER(OutLen);
+
     status = STATUS_INVALID_BUFFER_SIZE;
     if (InLen != sizeof(XENIFACE_GNTTAB_REVOKE_FOREIGN_ACCESS_IN))
         goto fail1;
diff --git a/src/xeniface/ioctl_suspend.c b/src/xeniface/ioctl_suspend.c
index daa6dfb..1607e5a 100644
--- a/src/xeniface/ioctl_suspend.c
+++ b/src/xeniface/ioctl_suspend.c
@@ -141,6 +141,8 @@ SuspendFreeEvent(
     Trace("Context %p, FO %p\n",
                        Context, Context->FileObject);
 
+    UNREFERENCED_PARAMETER(Fdo);
+
     ObDereferenceObject(Context->Event);
     RtlZeroMemory(Context, sizeof(XENIFACE_SUSPEND_CONTEXT));
     __FreePoolWithTag(Context, XENIFACE_POOL_TAG);
diff --git a/src/xeniface/ioctls.c b/src/xeniface/ioctls.c
index e8199ea..9808adc 100644
--- a/src/xeniface/ioctls.c
+++ b/src/xeniface/ioctls.c
@@ -117,6 +117,8 @@ IoctlLog(
     NTSTATUS    status;
        PCHAR           ptr;
 
+    UNREFERENCED_PARAMETER(Fdo);
+
     status = STATUS_INVALID_BUFFER_SIZE;
     if (InLen == 0 || InLen > XENIFACE_LOG_MAX_LENGTH || OutLen != 0)
         goto fail1;
diff --git a/src/xeniface/wmi.c b/src/xeniface/wmi.c
index 5bbf123..97ef2c3 100644
--- a/src/xeniface/wmi.c
+++ b/src/xeniface/wmi.c
@@ -1398,6 +1398,9 @@ SessionExecuteRemoveValue(
     PXENSTORE_SESSION   session;
     char*               tmpbuffer;
 
+    UNREFERENCED_PARAMETER(OutBuffer);
+    UNREFERENCED_PARAMETER(OutBufferSize);
+
     *BytesWritten = 0;
     status = STATUS_INVALID_DEVICE_REQUEST;
     if (!AccessWmiBuffer(InBuffer, TRUE, &RequiredSize, InBufferSize,
@@ -1465,6 +1468,10 @@ SessionExecuteRemoveWatch(
     UNICODE_STRING      unicpath_notbacked;
     PXENSTORE_SESSION   session;
 
+    UNREFERENCED_PARAMETER(OutBuffer);
+    UNREFERENCED_PARAMETER(OutBufferSize);
+
+
     *BytesWritten = 0;
     status = STATUS_INVALID_DEVICE_REQUEST;
     if (!AccessWmiBuffer(InBuffer, TRUE, &RequiredSize, InBufferSize,
@@ -1515,6 +1522,10 @@ SessionExecuteSetWatch(
     UNICODE_STRING      unicpath_notbacked;
     UNICODE_STRING      unicpath_backed;
 
+    UNREFERENCED_PARAMETER(OutBuffer);
+    UNREFERENCED_PARAMETER(OutBufferSize);
+
+
     *BytesWritten = 0;
     status = STATUS_INVALID_DEVICE_REQUEST;
     if (!AccessWmiBuffer(InBuffer, TRUE, &RequiredSize, InBufferSize,
@@ -1567,6 +1578,12 @@ SessionExecuteEndSession(
     PXENSTORE_SESSION   Session;
     NTSTATUS            status;
 
+    UNREFERENCED_PARAMETER(OutBuffer);
+    UNREFERENCED_PARAMETER(OutBufferSize);
+    UNREFERENCED_PARAMETER(InBuffer);
+    UNREFERENCED_PARAMETER(InBufferSize);
+
+
     *BytesWritten = 0;
     status = STATUS_WMI_INSTANCE_NOT_FOUND;
     Session = FindSessionByInstanceAndLock(Fdo, instance);
@@ -1603,6 +1620,9 @@ SessionExecuteSetValue(
     char*                   tmppath;
     char*                   tmpvalue;
 
+    UNREFERENCED_PARAMETER(OutBuffer);
+    UNREFERENCED_PARAMETER(OutBufferSize);
+
     *BytesWritten = 0;
     status = STATUS_INVALID_DEVICE_REQUEST;
     if (!AccessWmiBuffer(InBuffer, TRUE, &RequiredSize, InBufferSize,
@@ -1691,6 +1711,8 @@ SessionExecuteGetFirstChild(
     PXENSTORE_SESSION       session;
     char*                   tmppath;
 
+    UNREFERENCED_PARAMETER(OutBuffer);
+
     *BytesWritten = 0;
     status = STATUS_INVALID_DEVICE_REQUEST;
     if (!AccessWmiBuffer(InBuffer, TRUE, &RequiredSize, InBufferSize,
@@ -1810,6 +1832,8 @@ SessionExecuteGetNextSibling(
     int                     leafoffset;
     char*                   attemptstring;
 
+    UNREFERENCED_PARAMETER(OutBuffer);
+
     *BytesWritten = 0;
     status = STATUS_INVALID_DEVICE_REQUEST;
     if (!AccessWmiBuffer(InBuffer, TRUE, &RequiredSize, InBufferSize,
@@ -1973,6 +1997,8 @@ SessionExecuteGetChildren(
     PXENSTORE_SESSION       session;
     char*                   tmppath;
 
+    UNREFERENCED_PARAMETER(OutBuffer);
+
     status = STATUS_INVALID_DEVICE_REQUEST;
     if (!AccessWmiBuffer(InBuffer, TRUE, &RequiredSize, InBufferSize,
                          WMI_STRING, &uloc,
@@ -2091,6 +2117,12 @@ SessionExecuteLog(
     NTSTATUS            status;
     ANSI_STRING         message;
 
+
+    UNREFERENCED_PARAMETER(Fdo);
+    UNREFERENCED_PARAMETER(instance);
+    UNREFERENCED_PARAMETER(OutBuffer);
+    UNREFERENCED_PARAMETER(OutBufferSize);
+
     *BytesWritten = 0;
     status = STATUS_INVALID_DEVICE_REQUEST;
     if (!AccessWmiBuffer(InBuffer, TRUE, &RequiredSize, InBufferSize,
@@ -2127,6 +2159,11 @@ SessionExecuteStartTransaction(
     NTSTATUS            status;
     PXENSTORE_SESSION   session;
 
+    UNREFERENCED_PARAMETER(InBuffer);
+    UNREFERENCED_PARAMETER(InBufferSize);
+    UNREFERENCED_PARAMETER(OutBuffer);
+    UNREFERENCED_PARAMETER(OutBufferSize);
+
     *BytesWritten = 0;
     status = STATUS_INSUFFICIENT_RESOURCES;
     if (!Fdo->InterfacesAcquired)
@@ -2168,6 +2205,12 @@ SessionExecuteCommitTransaction(
     NTSTATUS            status;
     PXENSTORE_SESSION   session;
 
+    UNREFERENCED_PARAMETER(InBuffer);
+    UNREFERENCED_PARAMETER(InBufferSize);
+    UNREFERENCED_PARAMETER(OutBuffer);
+    UNREFERENCED_PARAMETER(OutBufferSize);
+
+
     *BytesWritten = 0;
     status = STATUS_INSUFFICIENT_RESOURCES;
     if (!Fdo->InterfacesAcquired)
@@ -2214,6 +2257,12 @@ SessionExecuteAbortTransaction(
     NTSTATUS            status;
     PXENSTORE_SESSION   session;
 
+
+    UNREFERENCED_PARAMETER(InBuffer);
+    UNREFERENCED_PARAMETER(InBufferSize);
+    UNREFERENCED_PARAMETER(OutBuffer);
+    UNREFERENCED_PARAMETER(OutBufferSize);
+
     *BytesWritten = 0;
     status = STATUS_INSUFFICIENT_RESOURCES;
     if (!Fdo->InterfacesAcquired)
-- 
2.39.0.windows.1




 


Rackspace

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