Commit 9b9d8182 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Ignore low instance word in find_class.

Like we do in wineserver. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7acd2f1c
...@@ -299,7 +299,7 @@ static void CLASS_FreeClass( CLASS *classPtr ) ...@@ -299,7 +299,7 @@ static void CLASS_FreeClass( CLASS *classPtr )
static CLASS *find_class( HINSTANCE module, const WCHAR *name ) static CLASS *find_class( HINSTANCE module, const WCHAR *name )
{ {
ATOM atom = get_int_atom_value( name ); ATOM atom = get_int_atom_value( name );
UINT_PTR instance = (UINT_PTR)module; UINT_PTR instance = (UINT_PTR)module & ~0xffff;
CLASS *class; CLASS *class;
USER_Lock(); USER_Lock();
...@@ -313,7 +313,7 @@ static CLASS *find_class( HINSTANCE module, const WCHAR *name ) ...@@ -313,7 +313,7 @@ static CLASS *find_class( HINSTANCE module, const WCHAR *name )
{ {
if (wcsicmp( class->name, name )) continue; if (wcsicmp( class->name, name )) continue;
} }
if (!class->local || class->instance == instance) if (!class->local || (class->instance & ~0xffff) == instance)
{ {
TRACE("%s %Ix -> %p\n", debugstr_w(name), instance, class); TRACE("%s %Ix -> %p\n", debugstr_w(name), instance, class);
return class; return class;
......
...@@ -90,12 +90,14 @@ static void ClassTest(HINSTANCE hInstance, BOOL global) ...@@ -90,12 +90,14 @@ static void ClassTest(HINSTANCE hInstance, BOOL global)
WNDCLASSW cls, wc; WNDCLASSW cls, wc;
static const WCHAR className[] = {'T','e','s','t','C','l','a','s','s',0}; static const WCHAR className[] = {'T','e','s','t','C','l','a','s','s',0};
static const WCHAR winName[] = {'W','i','n','C','l','a','s','s','T','e','s','t',0}; static const WCHAR winName[] = {'W','i','n','C','l','a','s','s','T','e','s','t',0};
WNDCLASSW info;
ATOM test_atom; ATOM test_atom;
HWND hTestWnd; HWND hTestWnd;
LONG i; LONG i;
WCHAR str[20]; WCHAR str[20];
ATOM classatom; ATOM classatom;
HINSTANCE hInstance2; HINSTANCE hInstance2;
BOOL ret;
cls.style = CS_HREDRAW | CS_VREDRAW | (global?CS_GLOBALCLASS:0); cls.style = CS_HREDRAW | CS_VREDRAW | (global?CS_GLOBALCLASS:0);
cls.lpfnWndProc = ClassTest_WndProc; cls.lpfnWndProc = ClassTest_WndProc;
...@@ -136,6 +138,9 @@ static void ClassTest(HINSTANCE hInstance, BOOL global) ...@@ -136,6 +138,9 @@ static void ClassTest(HINSTANCE hInstance, BOOL global)
DestroyWindow(hTestWnd); DestroyWindow(hTestWnd);
ret = GetClassInfoW(hInstance2, className, &info);
ok(ret, "GetClassInfoW failed: %u\n", GetLastError());
hTestWnd = CreateWindowW (className, winName, hTestWnd = CreateWindowW (className, winName,
WS_OVERLAPPEDWINDOW + WS_HSCROLL + WS_VSCROLL, WS_OVERLAPPEDWINDOW + WS_HSCROLL + WS_VSCROLL,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment