Author: jimtabor
Date: Thu Oct 10 12:40:30 2013
New Revision: 60599
URL:
http://svn.reactos.org/svn/reactos?rev=60599&view=rev
Log:
[Win32k]
- Fix applications exit before the release of class atoms.
Modified:
trunk/reactos/win32ss/user/ntuser/class.c
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] Thu Oct 10 12:40:30 2013
@@ -8,6 +8,9 @@
#include <win32k.h>
DBG_DEFAULT_CHANNEL(UserClass);
+
+BOOL FASTCALL IntClassDestroyIcon(HANDLE hCurIcon);
+static NTSTATUS IntDeregisterClassAtom(IN RTL_ATOM Atom);
REGISTER_SYSCLASS DefaultServerClasses[] =
{
@@ -227,6 +230,13 @@
CallProc = NextCallProc;
}
+ // Fixes running the static test then run class test issue.
+ // Some applications do not use UnregisterClass before exiting.
+ // Keep from reusing the same atom with case insensitive
+ // comparisons, remove registration of the atom if not zeroed.
+ if (Class->atomClassName)
+ IntDeregisterClassAtom(Class->atomClassName);
+
if (Class->pdce)
{
DceFreeClassDCE(((PDCE)Class->pdce)->hDC);
@@ -235,6 +245,9 @@
IntFreeClassMenuName(Class);
}
+
+ if (Class->hIconSmIntern)
+ IntClassDestroyIcon(Class->hIconSmIntern);
pDesk = Class->rpdeskParent;
Class->rpdeskParent = NULL;
@@ -1481,6 +1494,7 @@
{
TRACE("Class 0x%p\n", Class);
TRACE("UserUnregisterClass: Good Exit!\n");
+ Class->atomClassName = 0; // Don't let it linger...
/* Finally free the resources */
IntDestroyClass(Class);
return TRUE;