From 9277f5352a48f247a393d02d50b1ecb713738dac Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 20 Dec 2023 15:20:01 +0100 Subject: [PATCH] [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);