uxtheme: Check window handle for SetWindowTheme().

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-06-21 17:15:09 +08:00 committed by Alexandre Julliard
parent 16e2a9aecc
commit 3f292a0e65
2 changed files with 4 additions and 1 deletions

View File

@ -690,6 +690,10 @@ HRESULT WINAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName,
HRESULT hr;
TRACE("(%p,%s,%s)\n", hwnd, debugstr_w(pszSubAppName),
debugstr_w(pszSubIdList));
if (!hwnd)
return E_HANDLE;
hr = UXTHEME_SetWindowProperty(hwnd, atSubAppName, pszSubAppName);
if(SUCCEEDED(hr))
hr = UXTHEME_SetWindowProperty(hwnd, atSubIdList, pszSubIdList);

View File

@ -104,7 +104,6 @@ static void test_SetWindowTheme(void)
HWND hWnd;
hRes = SetWindowTheme(NULL, NULL, NULL);
todo_wine
ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
/* Only do the bare minimum to get a valid hwnd */