Zhiyi Zhang : uxtheme: Check window handle for SetWindowTheme().
Alexandre Julliard
julliard at winehq.org
Mon Jun 21 16:14:56 CDT 2021
Module: wine
Branch: master
Commit: 3f292a0e6516b7cfe11ccaaadffb05df64bd8ca8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=3f292a0e6516b7cfe11ccaaadffb05df64bd8ca8
Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date: Mon Jun 21 17:15:09 2021 +0800
uxtheme: Check window handle for SetWindowTheme().
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/uxtheme/system.c | 4 ++++
dlls/uxtheme/tests/system.c | 1 -
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c
index 49742c947a0..33e407fdf82 100644
--- a/dlls/uxtheme/system.c
+++ b/dlls/uxtheme/system.c
@@ -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);
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 7ec72e30259..869dbe2cdc9 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -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 */
More information about the wine-cvs
mailing list