Author: tkreuzer
Date: Sat Sep 22 23:14:16 2012
New Revision: 57367
URL: http://svn.reactos.org/svn/reactos?rev=57367&view=rev
Log:
[WIN32K]
Unmap the desktop heap in IntFreeDesktopHeap. Fixes leaking session space memory, when creating and deleting desktops.
I would revert the "hackfix" from r57348, but for me changing MiPteToAddress to MiAddressToPte looks more like a legit bug fix, rather than "increasing system view space to 36MB instead of 20MB". But I'm probably missing something. In that case, Alex, please revert your hack, it shouldn't be needed anymore.
CORE-6688 #resolve
Modified:
trunk/reactos/win32ss/user/ntuser/desktop.c
Modified: trunk/reactos/win32ss/user/ntuser/desktop.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/deskto…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] Sat Sep 22 23:14:16 2012
@@ -554,7 +554,7 @@
ULONG Value;
//ERR("DesktopWindowProc\n");
- *lResult = 0;
+ *lResult = 0;
switch (Msg)
{
@@ -596,7 +596,7 @@
case WM_SYSCOLORCHANGE:
co_UserRedrawWindow(Wnd, NULL, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN);
return TRUE;
- }
+ }
return FALSE; // Not processed so go with callback.
}
@@ -813,6 +813,12 @@
static VOID
IntFreeDesktopHeap(IN OUT PDESKTOP Desktop)
{
+ if (Desktop->pheapDesktop != NULL)
+ {
+ MmUnmapViewInSessionSpace(Desktop->pheapDesktop);
+ Desktop->pheapDesktop = NULL;
+ }
+
if (Desktop->hsectionDesktop != NULL)
{
ObDereferenceObject(Desktop->hsectionDesktop);