patch from w3seek fixing windows handles

svn path=/trunk/; revision=21462
This commit is contained in:
Magnus Olsen
2006-04-05 10:33:55 +00:00
parent 57c64e6317
commit 2c38ab132d
3 changed files with 26 additions and 8 deletions
@@ -32,7 +32,8 @@ void FASTCALL
DestroyProcessClasses(PW32PROCESS Process );
PWINDOWCLASS
IntReferenceClass(IN PWINDOWCLASS BaseClass,
IntReferenceClass(IN OUT PWINDOWCLASS BaseClass,
IN OUT PWINDOWCLASS *ClassLink,
IN PDESKTOP Desktop);
VOID
+21 -5
View File
@@ -361,7 +361,8 @@ IntSetClassWndProc(IN OUT PWINDOWCLASS Class,
}
static PWINDOWCLASS
IntGetClassForDesktop(IN PWINDOWCLASS BaseClass,
IntGetClassForDesktop(IN OUT PWINDOWCLASS BaseClass,
IN OUT PWINDOWCLASS *ClassLink,
IN PDESKTOP Desktop)
{
SIZE_T ClassSize;
@@ -380,6 +381,8 @@ IntGetClassForDesktop(IN PWINDOWCLASS BaseClass,
if (BaseClass->Desktop == NULL)
{
ASSERT(BaseClass->Windows == 0);
/* Classes are also located in the shared heap when the class
was created before the thread attached to a desktop. As soon
as a window is created for such a class located on the shared
@@ -424,11 +427,22 @@ IntGetClassForDesktop(IN PWINDOWCLASS BaseClass,
/* update some pointers and link the class */
Class->Next = BaseClass->Clone;
Class->Clone = NULL;
Class->Base = BaseClass;
Class->Desktop = Desktop;
Class->Windows = 0;
(void)InterlockedExchangePointer(&BaseClass->Clone,
Class);
if (BaseClass->Desktop == NULL)
{
/* replace the base class */
Class->Base = BaseClass;
/* FIXME */
}
else
{
/* link in the clone */
Class->Base = BaseClass;
(void)InterlockedExchangePointer(&BaseClass->Clone,
Class);
}
}
else
{
@@ -440,12 +454,14 @@ IntGetClassForDesktop(IN PWINDOWCLASS BaseClass,
}
PWINDOWCLASS
IntReferenceClass(IN PWINDOWCLASS BaseClass,
IntReferenceClass(IN OUT PWINDOWCLASS BaseClass,
IN OUT PWINDOWCLASS *ClassLink,
IN PDESKTOP Desktop)
{
PWINDOWCLASS Class;
Class = IntGetClassForDesktop(BaseClass,
ClassLink,
Desktop);
if (Class != NULL)
{
@@ -1394,7 +1394,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
BOOL bUnicodeWindow)
{
PWINSTATION_OBJECT WinSta;
PWINDOWCLASS Class = NULL;
PWINDOWCLASS *ClassLink, Class = NULL;
RTL_ATOM ClassAtom;
PWINDOW_OBJECT Window = NULL;
PWINDOW_OBJECT ParentWindow = NULL, OwnerWindow;
@@ -1475,7 +1475,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
hInstance,
ti->kpi,
&Class,
NULL);
&ClassLink);
if (ClassAtom == (RTL_ATOM)0)
{
@@ -1493,6 +1493,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
}
Class = IntReferenceClass(Class,
ClassLink,
ti->Desktop);
if (Class == NULL)
{