[2/3]uxtheme: fix pointer detection in OpenThemeData

André Hentschel nerv at dawncrow.de
Thu Aug 13 13:25:33 CDT 2009


---
 dlls/uxtheme/system.c       |    4 ++++
 dlls/uxtheme/tests/system.c |   14 ++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c
index 80fddc2..d6410f0 100644
--- a/dlls/uxtheme/system.c
+++ b/dlls/uxtheme/system.c
@@ -644,6 +644,10 @@ HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
     HTHEME hTheme = NULL;
     TRACE("(%p,%s)\n", hwnd, debugstr_w(pszClassList));
 
+    if(!pszClassList) {
+        SetLastError(E_POINTER);
+        return hTheme;
+    }
     if(bThemeActive)
     {
         pszAppName = UXTHEME_GetWindowProperty(hwnd, atSubAppName, szAppBuff, sizeof(szAppBuff)/sizeof(szAppBuff[0]));
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 6181a92..115e48b 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -190,10 +190,9 @@ static void test_OpenThemeData(void)
     SetLastError(0xdeadbeef);
     hTheme = pOpenThemeData(NULL, NULL);
     ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
-    todo_wine
-        ok( GetLastError() == E_POINTER,
-            "Expected GLE() to be E_POINTER, got 0x%08x\n",
-            GetLastError());
+    ok( GetLastError() == E_POINTER,
+        "Expected GLE() to be E_POINTER, got 0x%08x\n",
+        GetLastError());
 
     /* A NULL hWnd and an invalid classlist */
     SetLastError(0xdeadbeef);
@@ -230,10 +229,9 @@ static void test_OpenThemeData(void)
     SetLastError(0xdeadbeef);
     hTheme = pOpenThemeData(hWnd, NULL);
     ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
-    todo_wine
-        ok( GetLastError() == E_POINTER,
-            "Expected GLE() to be E_POINTER, got 0x%08x\n",
-            GetLastError());
+    ok( GetLastError() == E_POINTER,
+        "Expected GLE() to be E_POINTER, got 0x%08x\n",
+        GetLastError());
 
     SetLastError(0xdeadbeef);
     hTheme = pOpenThemeData(hWnd, szInvalidClassList);
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list