- Troubleshooting bug 5630, moved DestroyProcessClasses from process to thread since process is called first. This way, it is assured the class destruction is on queue, but not before thread death.
- Added a global pointer to be used in a later commit.
- Warning: this does not fix bug 5630.

svn path=/trunk/; revision=56386
This commit is contained in:
James Tabor 2012-04-21 18:18:59 +00:00
parent 68ce44de26
commit 814e1a9ae5
4 changed files with 23 additions and 4 deletions

View file

@ -128,6 +128,7 @@ static VOID
IntDestroyClass(IN OUT PCLS Class)
{
PDESKTOP pDesk;
/* There shouldn't be any clones anymore */
ASSERT(Class->cWndReferenceCount == 0);
ASSERT(Class->pclsClone == NULL);
@ -620,9 +621,11 @@ IntDereferenceClass(IN OUT PCLS Class,
{
PCLS *PrevLink, BaseClass, CurrentClass;
ASSERT(Class->cWndReferenceCount >= 1);
BaseClass = Class->pclsBase;
if (--Class->cWndReferenceCount <= 0)
if (--Class->cWndReferenceCount == 0)
{
if (BaseClass == Class)
{

View file

@ -175,9 +175,6 @@ Win32kProcessCallback(struct _EPROCESS *Process,
IntCleanupMenus(Process, ppiCurrent);
IntCleanupCurIcons(Process, ppiCurrent);
/* no process windows should exist at this point, or the function will assert! */
DestroyProcessClasses(ppiCurrent);
ppiCurrent->W32PF_flags &= ~W32PF_CLASSESREGISTERED;
GDI_CleanupForProcess(Process);
@ -205,6 +202,8 @@ Win32kProcessCallback(struct _EPROCESS *Process,
GdiPoolDestroy(ppiCurrent->pPoolBrushAttr);
GdiPoolDestroy(ppiCurrent->pPoolRgnAttr);
if (gppiInputProvider == ppiCurrent) gppiInputProvider = NULL;
TRACE_CH(UserProcess,"Freeing ppi 0x%x\n", ppiCurrent);
/* Ftee the PROCESSINFO */
@ -432,7 +431,22 @@ UserDestroyThreadInfo(struct _ETHREAD *Thread)
DestroyTimersForThread(ptiCurrent);
KeSetEvent(ptiCurrent->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
UnregisterThreadHotKeys(Thread);
/*
if (IsListEmpty(&ptiCurrent->WindowListHead))
{
ERR_CH(UserThread,"Thread Window List is Empty!\n");
}
*/
co_DestroyThreadWindows(Thread);
if (ppiCurrent && ppiCurrent->ptiList == ptiCurrent && !ptiCurrent->ptiSibling)
{
//ERR_CH(UserThread,"DestroyProcessClasses\n");
/* no process windows should exist at this point, or the function will assert! */
DestroyProcessClasses(ppiCurrent);
ppiCurrent->W32PF_flags &= ~W32PF_CLASSESREGISTERED;
}
IntBlockInput(ptiCurrent, FALSE);
IntCleanupThreadCallbacks(ptiCurrent);

View file

@ -11,6 +11,7 @@ DBG_DEFAULT_CHANNEL(UserMisc);
/* GLOBALS *******************************************************************/
PTHREADINFO gptiCurrent = NULL;
PPROCESSINFO gppiInputProvider = NULL;
ERESOURCE UserLock;
ATOM AtomMessage; // Window Message atom.
ATOM AtomWndObj; // Window Object atom.

View file

@ -13,6 +13,7 @@ extern BOOL gbInitialized;
extern PSERVERINFO gpsi;
extern PTHREADINFO gptiCurrent;
extern PPROCESSINFO ppiScrnSaver;
extern PPROCESSINFO gppiInputProvider;
INIT_FUNCTION NTSTATUS NTAPI InitUserImpl(VOID);
VOID FASTCALL CleanupUserImpl(VOID);