Local classes registered with USER instance handle now are now found

in CLASS_FindClassByAtom.
This commit is contained in:
Joshua Thielen 2001-11-16 18:11:43 +00:00 committed by Alexandre Julliard
parent fb0eeab673
commit d9ed57ac99
1 changed files with 19 additions and 4 deletions

View File

@ -279,10 +279,14 @@ void CLASS_FreeModuleClasses( HMODULE16 hModule )
* NOTES
* 980805 a local class will be found now if registred with hInst=0
* and looed up with a hInst!=0. msmoney does it (jsch)
*
* Local class registered with a USER instance handle are found as if
* they were global classes.
*/
static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance )
{
CLASS * class, *tclass=0;
CLASS * class, *tclass = 0, *user_class = 0;
HINSTANCE16 hUser = GetModuleHandle16("USER");
TRACE("0x%08x 0x%08x\n", atom, hinstance);
@ -299,6 +303,10 @@ static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance )
return class;
}
if (class->hInstance == 0) tclass = class;
else if(class->hInstance == hUser)
{
user_class = class;
}
}
}
@ -314,6 +322,13 @@ static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance )
}
}
/* Check if there was a local class registered with USER */
if( user_class )
{
TRACE("--found local USER class %p\n", user_class);
return user_class;
}
/* Then check if there was a local class with hInst=0*/
if ( tclass )
{