Zhiyi Zhang : uxtheme: Check window handle for GetWindowTheme().
Alexandre Julliard
julliard at winehq.org
Mon Jun 21 16:14:56 CDT 2021
Module: wine
Branch: master
Commit: 16e2a9aecc86c4d01d327506f3b45eee0cae6359
URL: https://source.winehq.org/git/wine.git/?a=commit;h=16e2a9aecc86c4d01d327506f3b45eee0cae6359
Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date: Mon Jun 21 17:15:02 2021 +0800
uxtheme: Check window handle for GetWindowTheme().
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/uxtheme/system.c | 7 +++++++
dlls/uxtheme/tests/system.c | 5 +----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c
index 1c25f38d5d9..49742c947a0 100644
--- a/dlls/uxtheme/system.c
+++ b/dlls/uxtheme/system.c
@@ -669,6 +669,13 @@ HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
HTHEME WINAPI GetWindowTheme(HWND hwnd)
{
TRACE("(%p)\n", hwnd);
+
+ if (!hwnd)
+ {
+ SetLastError(E_HANDLE);
+ return NULL;
+ }
+
return GetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme));
}
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index a5d962d17a3..7ec72e30259 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -81,10 +81,7 @@ static void test_GetWindowTheme(void)
SetLastError(0xdeadbeef);
hTheme = GetWindowTheme(NULL);
ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
- todo_wine
- ok( GetLastError() == E_HANDLE,
- "Expected E_HANDLE, got 0x%08x\n",
- GetLastError());
+ ok( GetLastError() == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", GetLastError() );
/* Only do the bare minimum to get a valid hwnd */
hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL);
More information about the wine-cvs
mailing list