* dont succeed if found Class is local and hInstance is NULL

* set hInstance to input value given when nonzero, zero for global classes and to the actual value of class when its local
* reduces the user32_winetest.exe failures by 20 error to 44

svn path=/trunk/; revision=23075
This commit is contained in:
Johannes Anderwald 2006-07-16 12:24:09 +00:00
parent 8135ef1f04
commit a4b70302ef

View file

@ -1772,7 +1772,8 @@ UserSetClassLongPtr(IN PWINDOWCLASS Class,
static BOOL
UserGetClassInfo(IN PWINDOWCLASS Class,
OUT PWNDCLASSEXW lpwcx,
IN BOOL Ansi)
IN BOOL Ansi,
HINSTANCE hInstance)
{
lpwcx->style = Class->Style;
@ -1783,7 +1784,6 @@ UserGetClassInfo(IN PWINDOWCLASS Class,
lpwcx->cbClsExtra = Class->ClsExtra;
lpwcx->cbWndExtra = Class->WndExtra;
lpwcx->hInstance = Class->hInstance;
lpwcx->hIcon = Class->hIcon; /* FIXME - get handle from pointer */
lpwcx->hCursor = Class->hCursor; /* FIXME - get handle from pointer */
lpwcx->hbrBackground = Class->hbrBackground;
@ -1793,6 +1793,13 @@ UserGetClassInfo(IN PWINDOWCLASS Class,
else
lpwcx->lpszMenuName = Class->MenuName;
if (hInstance)
lpwcx->hInstance = hInstance;
else if (Class->Global)
lpwcx->hInstance = NULL;
else
lpwcx->hInstance = Class->hInstance;
lpwcx->lpszClassName = (LPCWSTR)((ULONG_PTR)Class->Atom); /* FIXME - return the string? */
lpwcx->hIconSm = Class->hIconSm; /* FIXME - get handle from pointer */
@ -2154,7 +2161,8 @@ InvalidParameter:
{
Ret = UserGetClassInfo(Class,
lpWndClassEx,
Ansi);
Ansi,
hInstance);
if (Ret)
{
@ -2173,6 +2181,11 @@ InvalidParameter:
/* Undocumented behavior! Return the class atom as a BOOL! */
Ret = (BOOL)ClassAtom;
if (!(Class->Global || Class->System) && hInstance == NULL)
{
Ret = FALSE;
}
}
}
}