[PATCH] user32/tests: Avoid a crash on win9x

Detlef Riekenberg wine.dev at web.de
Sun Oct 26 17:08:50 CDT 2008


---
 dlls/user32/tests/win.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 76ca103..c0398d5 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -61,6 +61,11 @@ static const char* szAWRClass = "Winsize";
 static HMENU hmenu;
 static DWORD our_pid;
 
+static const WCHAR mainwindowclassW[] = {'M','a','i','n','W','i','n','d','o','w','C','l','a','s','s',0};
+static const WCHAR message_windowW[] = {'m','e','s','s','a','g','e',' ','w','i','n','d','o','w',0};
+
+/* ############### */
+
 #define COUNTOF(arr) (sizeof(arr)/sizeof(arr[0]))
 
 static void dump_minmax_info( const MINMAXINFO *minmax )
@@ -4771,11 +4776,14 @@ static void test_hwnd_message(void)
     HWND parent = 0, hwnd, found;
     RECT rect;
 
-    hwnd = CreateWindowExA(0, "MainWindowClass", "message window", WS_CAPTION | WS_VISIBLE,
+    /* HWND_MESSAGE is not supported below w2k, but win9x return != 0
+       on CreateWindowExA and crash later in the test.
+       Use UNICODE here to fail on win9x */
+    hwnd = CreateWindowExW(0, mainwindowclassW, message_windowW, WS_CAPTION | WS_VISIBLE,
                            100, 100, 200, 200, HWND_MESSAGE, 0, 0, NULL);
     if (!hwnd)
     {
-        win_skip("CreateWindowExA with parent HWND_MESSAGE failed\n");
+        win_skip("CreateWindowExW with parent HWND_MESSAGE failed\n");
         return;
     }
 
-- 
1.5.4.3


--=-GrncKUushlK1qixBSMmb--




More information about the wine-patches mailing list