https://git.reactos.org/?p=reactos.git;a=commitdiff;h=77af26531558a8f4e00a73cea1c0cb744b6c89d5

commit 77af26531558a8f4e00a73cea1c0cb744b6c89d5
Author:     Adam Słaboń <asail...@protonmail.com>
AuthorDate: Sun Mar 3 00:10:30 2024 +0100
Commit:     Hermès BÉLUSCA - MAÏTO <hermes.belusca-ma...@reactos.org>
CommitDate: Mon Oct 7 11:16:03 2024 +0200

    [NTOS:PNP] IoReportTargetDeviceChange: Correct the check for system PnP 
notifications
    
    Now IoReportTargetDeviceChange will process the custom notifications 
(rather than processing only those that it shouldn't).
---
 ntoskrnl/io/pnpmgr/pnpreport.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ntoskrnl/io/pnpmgr/pnpreport.c b/ntoskrnl/io/pnpmgr/pnpreport.c
index 735760f8c4f..ea23aa13304 100644
--- a/ntoskrnl/io/pnpmgr/pnpreport.c
+++ b/ntoskrnl/io/pnpmgr/pnpreport.c
@@ -464,9 +464,9 @@ IoReportTargetDeviceChange(IN PDEVICE_OBJECT 
PhysicalDeviceObject,
     ASSERT(notifyStruct->FileObject == NULL);
 
     /* Do not handle system PnP events */
-    if ((RtlCompareMemory(&(notifyStruct->Event), 
&(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
-        (RtlCompareMemory(&(notifyStruct->Event), 
&(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
-        (RtlCompareMemory(&(notifyStruct->Event), 
&(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
+    if (IsEqualGUID(&(notifyStruct->Event), &GUID_TARGET_DEVICE_QUERY_REMOVE) 
||
+        IsEqualGUID(&(notifyStruct->Event), 
&GUID_TARGET_DEVICE_REMOVE_CANCELLED) ||
+        IsEqualGUID(&(notifyStruct->Event), 
&GUID_TARGET_DEVICE_REMOVE_COMPLETE))
     {
         return STATUS_INVALID_DEVICE_REQUEST;
     }
@@ -515,9 +515,9 @@ IoReportTargetDeviceChangeAsynchronous(IN PDEVICE_OBJECT 
PhysicalDeviceObject,
     ASSERT(notifyStruct->FileObject == NULL);
 
     /* Do not handle system PnP events */
-    if ((RtlCompareMemory(&(notifyStruct->Event), 
&(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) != sizeof(GUID)) ||
-        (RtlCompareMemory(&(notifyStruct->Event), 
&(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) != sizeof(GUID)) ||
-        (RtlCompareMemory(&(notifyStruct->Event), 
&(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)) != sizeof(GUID)))
+    if (IsEqualGUID(&(notifyStruct->Event), &GUID_TARGET_DEVICE_QUERY_REMOVE) 
||
+        IsEqualGUID(&(notifyStruct->Event), 
&GUID_TARGET_DEVICE_REMOVE_CANCELLED) ||
+        IsEqualGUID(&(notifyStruct->Event), 
&GUID_TARGET_DEVICE_REMOVE_COMPLETE))
     {
         return STATUS_INVALID_DEVICE_REQUEST;
     }

Reply via email to