[PATCH] Set LastError on NULL pointer
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Tue Aug 30 08:15:25 CDT 2011
---
dlls/uxtheme/system.c | 6 ++++++
dlls/uxtheme/tests/system.c | 12 ++++--------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c
index 2d5b41e..6ee1dac 100644
--- a/dlls/uxtheme/system.c
+++ b/dlls/uxtheme/system.c
@@ -641,6 +641,12 @@ HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
HTHEME hTheme = NULL;
TRACE("(%p,%s, %x)\n", hwnd, debugstr_w(pszClassList), flags);
+ if(!pszClassList)
+ {
+ SetLastError(E_POINTER);
+ return NULL;
+ }
+
if(flags)
FIXME("unhandled flags: %x\n", flags);
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 0aaadbd..8dd413b 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -192,8 +192,7 @@ 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,
+ ok( GetLastError() == E_POINTER,
"Expected GLE() to be E_POINTER, got 0x%08x\n",
GetLastError());
@@ -232,8 +231,7 @@ 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,
+ ok( GetLastError() == E_POINTER,
"Expected GLE() to be E_POINTER, got 0x%08x\n",
GetLastError());
@@ -359,8 +357,7 @@ static void test_OpenThemeDataEx(void)
SetLastError(0xdeadbeef);
hTheme = pOpenThemeDataEx(NULL, NULL, 0);
ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
- todo_wine
- ok( GetLastError() == E_POINTER,
+ ok( GetLastError() == E_POINTER,
"Expected GLE() to be E_POINTER, got 0x%08x\n",
GetLastError());
@@ -399,8 +396,7 @@ static void test_OpenThemeDataEx(void)
SetLastError(0xdeadbeef);
hTheme = pOpenThemeDataEx(hWnd, NULL, 0);
ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
- todo_wine
- ok( GetLastError() == E_POINTER,
+ ok( GetLastError() == E_POINTER,
"Expected GLE() to be E_POINTER, got 0x%08x\n",
GetLastError());
--
1.7.4.1
--------------080309060802050409040805--
More information about the wine-patches
mailing list