Alistair Leslie-Hughes : uxtheme: Set last error on NULL pointer.
Alexandre Julliard
julliard at winehq.org
Wed Aug 31 13:19:22 CDT 2011
Module: wine
Branch: master
Commit: 81079ef35b0da17de0b3d75022be26f712740d67
URL: http://source.winehq.org/git/wine.git/?a=commit;h=81079ef35b0da17de0b3d75022be26f712740d67
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Tue Aug 30 23:15:25 2011 +1000
uxtheme: Set last error on NULL pointer.
---
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());
More information about the wine-cvs
mailing list