user32: GetTitleBarInfo tests for NULL values

András Kovács andras at csevego.net
Mon Jun 29 00:11:50 CDT 2009


---
 dlls/user32/tests/win.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index d45eba3..5ac5e7d 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -5552,6 +5552,28 @@ static void test_handles( HWND full_hwnd )
 #endif
 }
 
+static void test_gettitlebarinfo(HWND hwnd)
+{
+    BOOL ret;
+    TITLEBARINFO tbi;
+
+    SetLastError(0xdeadbeef);
+    ret = GetTitleBarInfo(NULL, NULL);
+    ok(!ret, "GetTitleBarInfo succeeded with NULL hwnd and NULL tbi.\n");
+    ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE /* Windows 7 */, "wrong error %u\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ret = GetTitleBarInfo(NULL, &tbi);
+    ok(!ret, "GetTitleBarInfo succeeded with NULL hwnd.\n");
+    ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE /* Windows 7 */, "wrong error %u\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    ret = GetTitleBarInfo(hwnd, NULL);
+    ok(!ret, "GetTitleBarInfo succeeded with NULL tbi.\n");
+    ok(GetLastError() == ERROR_NOACCESS /* Windows 7 */, "wrong error %u\n", GetLastError());
+}
+
+
 static void test_winregion(void)
 {
     HWND hwnd;
@@ -5675,6 +5697,7 @@ START_TEST(win)
     test_shell_window();
     test_handles( hwndMain );
     test_winregion();
+    test_gettitlebarinfo(hwndMain);
 
     /* add the tests above this line */
     if (hhook) UnhookWindowsHookEx(hhook);
-- 
1.6.0.4


--=-YztBuk3AYYaqNyuN7nR2--




More information about the wine-patches mailing list