<html>
<body>
<font size=3><br>
this patch add test cases for Bug#14350<br><br>
---<br>
&nbsp;dlls/user32/tests/class.c |&nbsp;&nbsp; 67
+++++++++++++++++++++++++++++++++++++++++++++<br>
&nbsp;1 files changed, 67 insertions(+), 0 deletions(-)<br><br>
diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c<br>
index 8412e8b..9e9dccf 100644<br>
--- a/dlls/user32/tests/class.c<br>
+++ b/dlls/user32/tests/class.c<br>
@@ -590,6 +590,7 @@ static void test_builtinproc(void)<br>
&nbsp;&nbsp;&nbsp;&nbsp; WCHAR buf[128];<br>
&nbsp;&nbsp;&nbsp;&nbsp; ATOM atom;<br>
&nbsp;&nbsp;&nbsp;&nbsp; HWND hwnd;<br>
+&nbsp;&nbsp;&nbsp; HWND hwnd2;<br>
&nbsp;&nbsp;&nbsp;&nbsp; int i;<br><br>
&nbsp;&nbsp;&nbsp;&nbsp; pDefWindowProcA = (void
*)GetProcAddress(GetModuleHandle(&quot;user32.dll&quot;),
&quot;DefWindowProcA&quot;);<br>
@@ -775,6 +776,72 @@ static void test_builtinproc(void)<br>
&nbsp;&nbsp;&nbsp;&nbsp; CallWindowProcA((WNDPROC)GetWindowLongPtrA(hwnd,
GWLP_WNDPROC), hwnd, WM_GETTEXT, 120, (LPARAM)buf);<br>
&nbsp;&nbsp;&nbsp;&nbsp; ok(memcmp(buf, classA, sizeof(classA)) == 0,
&quot;WM_GETTEXT invalid return\n&quot;);<br><br>
+&nbsp;&nbsp;&nbsp; /** subclass Edit class using SetClassLongPtrA with
ClassTest_WndProc2 **/<br>
+&nbsp;&nbsp;&nbsp; oldproc = (WNDPROC)SetClassLongPtrA( hwnd,
GCLP_WNDPROC, (ULONG_PTR)ClassTest_WndProc2);<br>
+&nbsp;&nbsp;&nbsp; ok(!IS_WNDPROC_HANDLE(GetClassLongPtrA(hwnd,
GCLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetClassLongPtrA expect to
return a Ansi wndproc, got %p\n&quot;,(void *)GetClassLongPtrA(hwnd,
GCLP_WNDPROC));<br>
+&nbsp;&nbsp;&nbsp; ok(IS_WNDPROC_HANDLE(GetClassLongPtrW(hwnd,
GCLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetClassLongPtrW expect to
return a wndproc handle, got %p\n&quot;, (void *)GetClassLongPtrW(hwnd,
GCLP_WNDPROC));<br>
+<br>
+&nbsp;&nbsp;&nbsp; /* create a unicode edit window */<br>
+&nbsp;&nbsp;&nbsp; hwnd2 = CreateWindowExW(0, WC_EDITW, NULL,
WS_POPUP,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0, 0, 100, 100, GetDesktopWindow(), 0, 0, NULL);<br>
+&nbsp;&nbsp;&nbsp; ok(!IsWindowUnicode(hwnd2), &quot;CreateWindowExW
should create a Ansi Edit window (subclassed by
SetClassLongPtrA)\n&quot;);<br>
+&nbsp;&nbsp;&nbsp; ok(!IS_WNDPROC_HANDLE(GetWindowLongPtrA(hwnd2,
GWLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetWindowLongPtrA expect to
return a Ansi wndproc, got %p\n&quot;,(void *)GetWindowLongPtrA(hwnd2,
GWLP_WNDPROC));<br>
+&nbsp;&nbsp;&nbsp; ok(IS_WNDPROC_HANDLE(GetWindowLongPtrW(hwnd2,
GWLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetWindowLongPtrW expect to
return a wndproc handle, got %p\n&quot;,(void *)GetWindowLongPtrW(hwnd2,
GWLP_WNDPROC));<br>
+&nbsp;&nbsp;&nbsp; DestroyWindow(hwnd2);<br>
+<br>
+&nbsp;&nbsp;&nbsp; /* create a ansi edit window */<br>
+&nbsp;&nbsp;&nbsp; hwnd2 = CreateWindowExA(0, WC_EDITA, NULL,
WS_POPUP,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0, 0, 100, 100, GetDesktopWindow(), 0, 0, NULL);<br>
+&nbsp;&nbsp;&nbsp; ok(!IsWindowUnicode(hwnd2), &quot;CreateWindowExA
should create a Ansi Edit window (subclassed by
SetClassLongPtrA)\n&quot;);<br>
+&nbsp;&nbsp;&nbsp; ok(!IS_WNDPROC_HANDLE(GetWindowLongPtrA(hwnd2,
GWLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetWindowLongPtrA expect to
return a Ansi wndproc, got %p\n&quot;,(void *)GetWindowLongPtrA(hwnd2,
GWLP_WNDPROC));<br>
+&nbsp;&nbsp;&nbsp; ok(IS_WNDPROC_HANDLE(GetWindowLongPtrW(hwnd2,
GWLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetWindowLongPtrW expect to
return a wndproc handle, got %p\n&quot;,(void *)GetWindowLongPtrW(hwnd2,
GWLP_WNDPROC));<br>
+&nbsp;&nbsp;&nbsp; DestroyWindow(hwnd2);<br>
+<br>
+&nbsp;&nbsp;&nbsp; SetWindowLongPtrA( hwnd, GCLP_WNDPROC,
(ULONG_PTR)oldproc); /* restore procA */<br>
+<br>
+&nbsp;&nbsp;&nbsp; /** subclass Edit class using SetClassLongPtrW with
ClassTest_WndProc **/<br>
+&nbsp;&nbsp;&nbsp; oldproc = (WNDPROC)SetClassLongPtrW( hwnd,
GCLP_WNDPROC, (ULONG_PTR)ClassTest_WndProc);<br>
+&nbsp;&nbsp;&nbsp; ok(IS_WNDPROC_HANDLE(GetClassLongPtrA(hwnd,
GCLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetClassLongPtrA expect to
return a wndproc handle, got %p\n&quot;,(void *)GetClassLongPtrA(hwnd,
GCLP_WNDPROC));<br>
+&nbsp;&nbsp;&nbsp; ok(!IS_WNDPROC_HANDLE(GetClassLongPtrW(hwnd,
GCLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetClassLongPtrW expect to
return a Unicode wndproc, got %p\n&quot;,(void *)GetClassLongPtrW(hwnd,
GCLP_WNDPROC));<br>
+<br>
+&nbsp;&nbsp;&nbsp; /* create a unicode edit window */<br>
+&nbsp;&nbsp;&nbsp; hwnd2 = CreateWindowExW(0, WC_EDITW, NULL,
WS_POPUP,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0, 0, 100, 100, GetDesktopWindow(), 0, 0, NULL);<br>
+&nbsp;&nbsp;&nbsp; ok(IsWindowUnicode(hwnd2), &quot;CreateWindowExW
should create a Unicode Edit window (subclassed by
SetClassLongPtrW)\n&quot;);<br>
+&nbsp;&nbsp;&nbsp; ok(IS_WNDPROC_HANDLE(GetWindowLongPtrA(hwnd2,
GWLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetWindowLongPtrA expect to
return a wndproc handle, got %p\n&quot;,(void *)GetWindowLongPtrA(hwnd2,
GWLP_WNDPROC));<br>
+&nbsp;&nbsp;&nbsp; ok(!IS_WNDPROC_HANDLE(GetWindowLongPtrW(hwnd2,
GWLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetWindowLongPtrW expect to
return a Unicode wndproc, got %p\n&quot;,(void *)GetWindowLongPtrW(hwnd2,
GWLP_WNDPROC));<br>
+&nbsp;&nbsp;&nbsp; /* ClassTest_WndProc handles Unciode message -
expected */<br>
+&nbsp;&nbsp;&nbsp; ok(((WNDPROC)GetWindowLongPtrW(hwnd2,
GWLP_WNDPROC)==ClassTest_WndProc),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetWindowLongPtrW expect to
be ClassTest_WndProc, %p vs %p\n&quot;,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (void *)GetWindowLongPtrW(hwnd2,
GWLP_WNDPROC),ClassTest_WndProc);<br>
+&nbsp;&nbsp;&nbsp; DestroyWindow(hwnd2);<br>
+<br>
+&nbsp;&nbsp;&nbsp; /* create a ansi edit window */<br>
+&nbsp;&nbsp;&nbsp; hwnd2 = CreateWindowExA(0, WC_EDITA, NULL,
WS_POPUP,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0, 0, 100, 100, GetDesktopWindow(), 0, 0, NULL);<br>
+&nbsp;&nbsp;&nbsp; ok(!IsWindowUnicode(hwnd2), &quot;CreateWindowExA
should create a Ansi Edit window (subclassed by
SetClassLongPtrW)\n&quot;);<br>
+&nbsp;&nbsp;&nbsp; ok(!IS_WNDPROC_HANDLE(GetWindowLongPtrA(hwnd2,
GWLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetWindowLongPtrA expect to
return a Ansi wndproc, got %p\n&quot;,(void *)GetWindowLongPtrA(hwnd2,
GWLP_WNDPROC));<br>
+&nbsp;&nbsp;&nbsp; ok(IS_WNDPROC_HANDLE(GetWindowLongPtrW(hwnd2,
GWLP_WNDPROC)),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetWindowLongPtrW expect to
return a wndproc handle, got %p\n&quot;,(void *)GetWindowLongPtrW(hwnd2,
GWLP_WNDPROC));<br>
+&nbsp;&nbsp;&nbsp; /* ClassTest_WndProc should also handle Ansi message
- a window Hack */<br>
+&nbsp;&nbsp;&nbsp; ok(((WNDPROC)GetWindowLongPtrA(hwnd2,
GWLP_WNDPROC)==ClassTest_WndProc),<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;GetWindowLongPtrA expect to
be ClassTest_WndProc, %p vs %p\n&quot;,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (void *)GetWindowLongPtrA(hwnd2,
GWLP_WNDPROC),ClassTest_WndProc);<br>
+&nbsp;&nbsp;&nbsp; DestroyWindow(hwnd2);<br>
+<br>
+&nbsp;&nbsp;&nbsp; SetWindowLongPtrW( hwnd, GCLP_WNDPROC,
(ULONG_PTR)oldproc); /* restore procW */<br>
+<br>
&nbsp;&nbsp;&nbsp;&nbsp; DestroyWindow(hwnd);<br>
&nbsp;}<br><br>
--<br>
1.5.2.1<br><br>
</font></body>
</html>