https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9277f5352a48f247a393d02d50b1ecb713738dac
commit 9277f5352a48f247a393d02d50b1ecb713738dac Author: Eric Kohl <eric.k...@reactos.org> AuthorDate: Wed Dec 20 15:20:01 2023 +0100 Commit: Eric Kohl <eric.k...@reactos.org> CommitDate: Wed Dec 20 15:20:01 2023 +0100 [SETUPAPI] CMP_RegisterNotification: Do not fail if we cannot retrieve a window title --- dll/win32/setupapi/cfgmgr.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c index b292a3c391d..ef29d045f8c 100644 --- a/dll/win32/setupapi/cfgmgr.c +++ b/dll/win32/setupapi/cfgmgr.c @@ -636,6 +636,8 @@ CMP_RegisterNotification( pNotifyData->ulMagic = NOTIFY_MAGIC; pNotifyData->hNotifyHandle = NULL; + ZeroMemory(szNameBuffer, sizeof(szNameBuffer)); + if ((ulFlags & DEVICE_NOTIFY_SERVICE_HANDLE) == DEVICE_NOTIFY_WINDOW_HANDLE) { FIXME("Register a window\n"); @@ -645,8 +647,12 @@ CMP_RegisterNotification( ARRAYSIZE(szNameBuffer)); if (nLength == 0) { - HeapFree(GetProcessHeap(), 0, pNotifyData); - return CR_INVALID_DATA; + + } + + if (nLength == 0) + { + szNameBuffer[0] = UNICODE_NULL; } FIXME("Register window: %S\n", szNameBuffer);