https://git.reactos.org/?p=reactos.git;a=commitdiff;h=86e8a477b608a9c4b1aa5…
commit 86e8a477b608a9c4b1aa5a6c5589e449c94add14
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Jul 7 23:46:25 2019 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Jul 7 23:47:01 2019 +0200
[SETUPAPI] CMP_RegisterNotification: When a window is registered, pass the window text
to PNP_RegisterNotification().
---
dll/win32/setupapi/cfgmgr.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c
index 0624ed8f5c8..55c3d64dccc 100644
--- a/dll/win32/setupapi/cfgmgr.c
+++ b/dll/win32/setupapi/cfgmgr.c
@@ -602,8 +602,9 @@ CMP_RegisterNotification(
RPC_BINDING_HANDLE BindingHandle = NULL;
PNOTIFY_DATA pNotifyData = NULL;
WCHAR szNameBuffer[256];
- DWORD dwError;
+ INT nLength;
DWORD ulUnknown9 = 0;
+ DWORD dwError;
CONFIGRET ret = CR_SUCCESS;
FIXME("CMP_RegisterNotification(%p %p %lu %p)\n",
@@ -635,8 +636,16 @@ CMP_RegisterNotification(
{
FIXME("Register a window\n");
- /* FIXME */
- szNameBuffer[0] = UNICODE_NULL;
+ nLength = GetWindowTextW((HWND)hRecipient,
+ szNameBuffer,
+ ARRAYSIZE(szNameBuffer));
+ if (nLength == 0)
+ {
+ HeapFree(GetProcessHeap(), 0, pNotifyData);
+ return CR_INVALID_DATA;
+ }
+
+ FIXME("Register window: %S\n", szNameBuffer);
}
else if ((ulFlags & DEVICE_NOTIFY_SERVICE_HANDLE) ==
DEVICE_NOTIFY_SERVICE_HANDLE)
{