Author: jimtabor
Date: Sat Apr 21 18:18:59 2012
New Revision: 56386
URL:
http://svn.reactos.org/svn/reactos?rev=56386&view=rev
Log:
[Win32k]
- 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.
Modified:
trunk/reactos/win32ss/user/ntuser/class.c
trunk/reactos/win32ss/user/ntuser/main.c
trunk/reactos/win32ss/user/ntuser/ntuser.c
trunk/reactos/win32ss/user/ntuser/ntuser.h
Modified: trunk/reactos/win32ss/user/ntuser/class.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/class.…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/class.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/class.c [iso-8859-1] Sat Apr 21 18:18:59 2012
@@ -128,6 +128,7 @@
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 @@
{
PCLS *PrevLink, BaseClass, CurrentClass;
+ ASSERT(Class->cWndReferenceCount >= 1);
+
BaseClass = Class->pclsBase;
- if (--Class->cWndReferenceCount <= 0)
+ if (--Class->cWndReferenceCount == 0)
{
if (BaseClass == Class)
{
Modified: trunk/reactos/win32ss/user/ntuser/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/main.c…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/main.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/main.c [iso-8859-1] Sat Apr 21 18:18:59 2012
@@ -175,9 +175,6 @@
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);
@@ -204,6 +201,8 @@
GdiPoolDestroy(ppiCurrent->pPoolDcAttr);
GdiPoolDestroy(ppiCurrent->pPoolBrushAttr);
GdiPoolDestroy(ppiCurrent->pPoolRgnAttr);
+
+ if (gppiInputProvider == ppiCurrent) gppiInputProvider = NULL;
TRACE_CH(UserProcess,"Freeing ppi 0x%x\n", ppiCurrent);
@@ -432,7 +431,22 @@
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);
Modified: trunk/reactos/win32ss/user/ntuser/ntuser.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/ntuser…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/ntuser.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/ntuser.c [iso-8859-1] Sat Apr 21 18:18:59 2012
@@ -11,6 +11,7 @@
/* GLOBALS *******************************************************************/
PTHREADINFO gptiCurrent = NULL;
+PPROCESSINFO gppiInputProvider = NULL;
ERESOURCE UserLock;
ATOM AtomMessage; // Window Message atom.
ATOM AtomWndObj; // Window Object atom.
Modified: trunk/reactos/win32ss/user/ntuser/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/ntuser…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/ntuser.h [iso-8859-1] Sat Apr 21 18:18:59 2012
@@ -13,6 +13,7 @@
extern PSERVERINFO gpsi;
extern PTHREADINFO gptiCurrent;
extern PPROCESSINFO ppiScrnSaver;
+extern PPROCESSINFO gppiInputProvider;
INIT_FUNCTION NTSTATUS NTAPI InitUserImpl(VOID);
VOID FASTCALL CleanupUserImpl(VOID);