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
svn path=/trunk/; revision=57367
ULONG Value;
//ERR("DesktopWindowProc\n");
- *lResult = 0;
+ *lResult = 0;
switch (Msg)
{
case WM_SYSCOLORCHANGE:
co_UserRedrawWindow(Wnd, NULL, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN);
return TRUE;
- }
+ }
return FALSE; // Not processed so go with callback.
}
static VOID
IntFreeDesktopHeap(IN OUT PDESKTOP Desktop)
{
+ if (Desktop->pheapDesktop != NULL)
+ {
+ MmUnmapViewInSessionSpace(Desktop->pheapDesktop);
+ Desktop->pheapDesktop = NULL;
+ }
+
if (Desktop->hsectionDesktop != NULL)
{
ObDereferenceObject(Desktop->hsectionDesktop);