https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ca0406131ccf0dcf2ca40…
commit ca0406131ccf0dcf2ca401c54ac33f600ce46af0
Author:     Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Jun 23 19:26:44 2019 +0200
Commit:     Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Jun 23 19:31:34 2019 +0200
    [SETUPAPI][UMPNPMGR] Improve CMP_RegisterNotification/PNP_RegisterNotification
    Pass the notification filter to PNP_RegisterNotification as a byte-pointer to the
filter and the size of the filter.
---
 base/services/umpnpmgr/rpcserver.c | 6 ++++--
 dll/win32/setupapi/cfgmgr.c        | 2 ++
 sdk/include/reactos/idl/pnp.idl    | 2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c
index fc20f0d3355..422415fd1af 100644
--- a/base/services/umpnpmgr/rpcserver.c
+++ b/base/services/umpnpmgr/rpcserver.c
@@ -3530,6 +3530,8 @@ DWORD
 WINAPI
 PNP_RegisterNotification(
     handle_t hBinding,
+    BYTE *pNotificationFilter,
+    DWORD ulNotificationFilterSize,
     DWORD ulFlags,
     DWORD *pulNotify)
 {
@@ -3537,8 +3539,8 @@ PNP_RegisterNotification(
     PNOTIFY_DATA pNotifyData;
 #endif
-    DPRINT1("PNP_RegisterNotification(%p 0x%lx %p)\n",
-           hBinding, ulFlags, pulNotify);
+    DPRINT1("PNP_RegisterNotification(%p %p %lu 0x%lx %p)\n",
+           hBinding, pNotificationFilter, ulNotificationFilterSize, ulFlags, pulNotify);
 #if 0
     pNotifyData = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(NOTIFY_DATA));
diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c
index 8215d47ac63..0037c1dbef3 100644
--- a/dll/win32/setupapi/cfgmgr.c
+++ b/dll/win32/setupapi/cfgmgr.c
@@ -634,6 +634,8 @@ CMP_RegisterNotification(
     RpcTryExcept
     {
         ret = PNP_RegisterNotification(BindingHandle,
+                                       (BYTE*)lpvNotificationFilter,
+
((DEV_BROADCAST_HDR*)lpvNotificationFilter)->dbch_size,
                                        ulFlags,
                                        &pNotifyData->ulNotifyData);
     }
diff --git a/sdk/include/reactos/idl/pnp.idl b/sdk/include/reactos/idl/pnp.idl
index 844c694c1a3..a4d7b1cac80 100644
--- a/sdk/include/reactos/idl/pnp.idl
+++ b/sdk/include/reactos/idl/pnp.idl
@@ -875,6 +875,8 @@ interface pnp
     __stdcall
     PNP_RegisterNotification(
         [in] handle_t hBinding,
+        [in, size_is(ulNotificationFilterSize)] BYTE *pNotificationFilter,
+        [in] DWORD ulNotificationFilterSize,
         [in] DWORD ulFlags,
         [out] DWORD *pulNotifyData);