[WIN32K]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 6 Oct 2012 20:15:36 +0000 (20:15 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 6 Oct 2012 20:15:36 +0000 (20:15 +0000)
Use ExAllocatePoolWithTag instead of ExAllocatePool

svn path=/trunk/; revision=57505

20 files changed:
reactos/win32ss/drivers/videoprt/dispatch.c
reactos/win32ss/drivers/videoprt/videoprt.h
reactos/win32ss/gdi/eng/engevent.c
reactos/win32ss/gdi/eng/mem.c
reactos/win32ss/gdi/eng/surface.c
reactos/win32ss/gdi/ntgdi/dibobj.c
reactos/win32ss/gdi/ntgdi/fillshap.c
reactos/win32ss/gdi/ntgdi/freetype.c
reactos/win32ss/gdi/ntgdi/gdidbg.c
reactos/win32ss/gdi/ntgdi/region.c
reactos/win32ss/user/ntuser/class.c
reactos/win32ss/user/ntuser/defwnd.c
reactos/win32ss/user/ntuser/desktop.c
reactos/win32ss/user/ntuser/focus.c
reactos/win32ss/user/ntuser/menu.c
reactos/win32ss/user/ntuser/painting.c
reactos/win32ss/user/ntuser/scrollbar.c
reactos/win32ss/user/ntuser/window.c
reactos/win32ss/user/ntuser/winpos.c
reactos/win32ss/user/ntuser/winsta.c

index 22470e0..35a1b76 100644 (file)
@@ -205,7 +205,9 @@ IntVideoPortDispatchDeviceControl(
    DriverExtension = DeviceExtension->DriverExtension;
 
    /* Translate the IRP to a VRP */
-   vrp = ExAllocatePool(NonPagedPool, sizeof(VIDEO_REQUEST_PACKET));
+   vrp = ExAllocatePoolWithTag(NonPagedPool,
+                               sizeof(VIDEO_REQUEST_PACKET),
+                               TAG_REQUEST_PACKET);
    if (NULL == vrp)
    {
       return STATUS_NO_MEMORY;
@@ -228,7 +230,7 @@ IntVideoPortDispatchDeviceControl(
       vrp);
 
    /* Free the VRP */
-   ExFreePool(vrp);
+   ExFreePoolWithTag(vrp, TAG_REQUEST_PACKET);
 
    INFO_(VIDEOPRT, "- Returned status: %x\n", Irp->IoStatus.Status);
 
@@ -561,7 +563,7 @@ IntVideoPortDispatchPnp(
     IN PIRP Irp)
 {
     PVIDEO_PORT_COMMON_EXTENSION CommonExtension = DeviceObject->DeviceExtension;
-    
+
     if (CommonExtension->Fdo)
         return IntVideoPortDispatchFdoPnp(DeviceObject, Irp);
     else
index 4a224fa..1754d1f 100644 (file)
@@ -44,6 +44,7 @@
 
 #define TAG_VIDEO_PORT  'PDIV'
 #define TAG_VIDEO_PORT_BUFFER  '\0mpV'
+#define TAG_REQUEST_PACKET 'qRpV'
 
 typedef struct _VIDEO_PORT_ADDRESS_MAPPING
 {
index 4289f45..51f7975 100644 (file)
@@ -67,7 +67,7 @@ EngDeleteEvent(IN PEVENT Event)
     }
 
     /* Free the allocated memory */
-    ExFreePool(Event);
+    ExFreePoolWithTag(Event, GDITAG_ENG_EVENT);
 
     /* Return success */
     return TRUE;
@@ -136,7 +136,7 @@ EngMapEvent(IN HDEV hDev,
     else
     {
         /* Free the allocation */
-        ExFreePool(EngEvent);
+        ExFreePoolWithTag(EngEvent, GDITAG_ENG_EVENT);
         EngEvent = NULL;
     }
 
@@ -156,7 +156,7 @@ EngUnmapEvent(IN PEVENT Event)
     ObDereferenceObject(Event->pKEvent);
 
     /* Free the Eng object */
-    ExFreePool(Event);
+    ExFreePoolWithTag(Event, GDITAG_ENG_EVENT);
     return TRUE;
 }
 
index 150ed33..7d887b1 100644 (file)
@@ -47,7 +47,8 @@ EngFreeMem(PVOID pvBaseAddress)
     /* Windows allows to pass NULL */
     if (pvBaseAddress)
     {
-        ExFreePool(pvBaseAddress);
+        /* Use 0 as tag, which equals a call to ExFreePool */
+        ExFreePoolWithTag(pvBaseAddress, 0);
     }
 }
 
index 9519b94..ce83bf1 100644 (file)
@@ -99,7 +99,7 @@ SURFACE_Cleanup(PVOID ObjectBody)
         else if (psurf->SurfObj.fjBitmap & BMF_POOLALLOC)
         {
             /* Free a pool allocation */
-            ExFreePool(pvBits);
+            EngFreeMem(pvBits);
         }
     }
 
index edd1308..cdb377e 100644 (file)
@@ -557,7 +557,7 @@ Exit:
     if (hSourceBitmap) EngDeleteSurface((HSURF)hSourceBitmap);
     DC_UnlockDc(pDC);
 Exit2:
-    ExFreePool(pbmiSafe);
+    ExFreePoolWithTag(pbmiSafe, 'pmTG');
     return ret;
 }
 
index 4a16d1e..a185073 100644 (file)
@@ -450,14 +450,14 @@ NtGdiPolyPolyDraw( IN HDC hDC,
     if (!dc)
     {
         EngSetLastError(ERROR_INVALID_HANDLE);
-        ExFreePool(pTemp);
+        ExFreePoolWithTag(pTemp, TAG_SHAPE);
         return FALSE;
     }
 
     if (dc->dctype == DC_TYPE_INFO)
     {
         DC_UnlockDc(dc);
-        ExFreePool(pTemp);
+        ExFreePoolWithTag(pTemp, TAG_SHAPE);
         /* Yes, Windows really returns TRUE in this case */
         return TRUE;
     }
@@ -497,7 +497,7 @@ NtGdiPolyPolyDraw( IN HDC hDC,
     /* Cleanup and return */
     DC_vFinishBlit(dc, NULL);
     DC_UnlockDc(dc);
-    ExFreePool(pTemp);
+    ExFreePoolWithTag(pTemp, TAG_SHAPE);
 
     return (ULONG_PTR)Ret;
 }
index 14a0afa..37ee009 100644 (file)
@@ -1402,7 +1402,7 @@ ftGdiGlyphCacheSet(
         NewEntry = (PFONT_CACHE_ENTRY)FontCacheListHead.Blink;
         FT_Done_Glyph((FT_Glyph)NewEntry->BitmapGlyph);
         RemoveTailList(&FontCacheListHead);
-        ExFreePool(NewEntry);
+        ExFreePoolWithTag(NewEntry, TAG_FONT);
         FontCacheNumEntries--;
     }
 
@@ -2584,7 +2584,7 @@ GetFontScore(LOGFONTW *LogFont, PUNICODE_STRING FaceName, PFONTGDI FontGDI)
         Score += 25;
     }
 
-    ExFreePool(Otm);
+    ExFreePoolWithTag(Otm, GDITAG_TEXT);
 
     return Score;
 }
@@ -2850,7 +2850,7 @@ IntGdiGetFontResourceInfo(
     /* Get the full path name */
     if (!IntGetFullFileName(NameInfo1, Size, FileName))
     {
-        ExFreePool(NameInfo1);
+        ExFreePoolWithTag(NameInfo1, TAG_FINF);
         return FALSE;
     }
 
@@ -2858,7 +2858,7 @@ IntGdiGetFontResourceInfo(
     NameInfo2 = ExAllocatePoolWithTag(PagedPool, Size, TAG_FINF);
     if (!NameInfo2)
     {
-        ExFreePool(NameInfo1);
+        ExFreePoolWithTag(NameInfo1, TAG_FINF);
         EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
         return FALSE;
     }
@@ -2888,7 +2888,7 @@ IntGdiGetFontResourceInfo(
     IntUnLockGlobalFonts;
 
     /* Free the buffers */
-    ExFreePool(NameInfo1);
+    ExFreePoolWithTag(NameInfo1, TAG_FINF);
     ExFreePool(NameInfo2);
 
     if (!bFound && dwType != 5)
@@ -3041,7 +3041,7 @@ NtGdiGetFontFamilyInfo(HDC Dc,
     if (! GetFontFamilyInfoForList(&LogFont, Info, &Count, Size, &FontListHead) )
     {
         IntUnLockGlobalFonts;
-        ExFreePool(Info);
+        ExFreePoolWithTag(Info, GDITAG_TEXT);
         return -1;
     }
     IntUnLockGlobalFonts;
@@ -3053,7 +3053,7 @@ NtGdiGetFontFamilyInfo(HDC Dc,
                                    &Win32Process->PrivateFontListHead))
     {
         IntUnLockProcessPrivateFonts(Win32Process);
-        ExFreePool(Info);
+        ExFreePoolWithTag(Info, GDITAG_TEXT);
         return -1;
     }
     IntUnLockProcessPrivateFonts(Win32Process);
@@ -3061,7 +3061,7 @@ NtGdiGetFontFamilyInfo(HDC Dc,
     /* Enumerate font families in the registry */
     if (! GetFontFamilyInfoForSubstitutes(&LogFont, Info, &Count, Size))
     {
-        ExFreePool(Info);
+        ExFreePoolWithTag(Info, GDITAG_TEXT);
         return -1;
     }
 
@@ -3072,13 +3072,13 @@ NtGdiGetFontFamilyInfo(HDC Dc,
                                 (Count < Size ? Count : Size) * sizeof(FONTFAMILYINFO));
         if (! NT_SUCCESS(Status))
         {
-            ExFreePool(Info);
+            ExFreePoolWithTag(Info, GDITAG_TEXT);
             EngSetLastError(ERROR_INVALID_PARAMETER);
             return -1;
         }
     }
 
-    ExFreePool(Info);
+    ExFreePoolWithTag(Info, GDITAG_TEXT);
 
     return Count;
 }
@@ -3778,7 +3778,7 @@ NtGdiGetCharABCWidthsW(
     dc = DC_LockDc(hDC);
     if (dc == NULL)
     {
-        ExFreePool(SafeBuff);
+        ExFreePoolWithTag(SafeBuff, GDITAG_TEXT);
         EngSetLastError(ERROR_INVALID_HANDLE);
         return FALSE;
     }
@@ -3789,7 +3789,7 @@ NtGdiGetCharABCWidthsW(
 
     if (TextObj == NULL)
     {
-        ExFreePool(SafeBuff);
+        ExFreePoolWithTag(SafeBuff, GDITAG_TEXT);
         EngSetLastError(ERROR_INVALID_HANDLE);
         return FALSE;
     }
@@ -3812,7 +3812,7 @@ NtGdiGetCharABCWidthsW(
         if (!found)
         {
             DPRINT1("WARNING: Could not find desired charmap!\n");
-            ExFreePool(SafeBuff);
+            ExFreePoolWithTag(SafeBuff, GDITAG_TEXT);
             EngSetLastError(ERROR_INVALID_HANDLE);
             return FALSE;
         }
@@ -3880,10 +3880,10 @@ NtGdiGetCharABCWidthsW(
     if (! NT_SUCCESS(Status))
     {
         SetLastNtError(Status);
-        ExFreePool(SafeBuff);
+        ExFreePoolWithTag(SafeBuff, GDITAG_TEXT);
         return FALSE;
     }
-    ExFreePool(SafeBuff);
+    ExFreePoolWithTag(SafeBuff, GDITAG_TEXT);
     DPRINT("NtGdiGetCharABCWidths Worked!\n");
     return TRUE;
 }
@@ -3945,7 +3945,7 @@ NtGdiGetCharWidthW(
     dc = DC_LockDc(hDC);
     if (dc == NULL)
     {
-        ExFreePool(SafeBuff);
+        ExFreePoolWithTag(SafeBuff, GDITAG_TEXT);
         EngSetLastError(ERROR_INVALID_HANDLE);
         return FALSE;
     }
@@ -3956,7 +3956,7 @@ NtGdiGetCharWidthW(
 
     if (TextObj == NULL)
     {
-        ExFreePool(SafeBuff);
+        ExFreePoolWithTag(SafeBuff, GDITAG_TEXT);
         EngSetLastError(ERROR_INVALID_HANDLE);
         return FALSE;
     }
@@ -4021,7 +4021,7 @@ NtGdiGetCharWidthW(
     IntUnLockFreeType;
     TEXTOBJ_UnlockText(TextObj);
     MmCopyToCaller(Buffer, SafeBuff, BufferSize);
-    ExFreePool(SafeBuff);
+    ExFreePoolWithTag(SafeBuff, GDITAG_TEXT);
     return TRUE;
 }
 
@@ -4088,7 +4088,7 @@ GreGetGlyphIndicesW(
         }
         IntGetOutlineTextMetrics(FontGDI, Size, potm);
         DefChar = potm->otmTextMetrics.tmDefaultChar; // May need this.
-        ExFreePool(potm);
+        ExFreePoolWithTag(potm, GDITAG_TEXT);
     }
 
     IntLockFreeType;
@@ -4183,7 +4183,7 @@ NtGdiGetGlyphIndicesW(
         }
         IntGetOutlineTextMetrics(FontGDI, Size, potm);
         DefChar = potm->otmTextMetrics.tmDefaultChar; // May need this.
-        ExFreePool(potm);
+        ExFreePoolWithTag(potm, GDITAG_TEXT);
     }
 
     _SEH2_TRY
index 2edd9f3..a90ee69 100644 (file)
@@ -246,7 +246,7 @@ DbgGdiHTIntegrityCheck()
        while (i)
        {
                pEntry = &GdiHandleTable->Entries[i];
-               if (i > GDI_HANDLE_COUNT)
+               if (i >= GDI_HANDLE_COUNT)
                {
                    DPRINT1("nDeleted=%lu\n", nDeleted);
                    ASSERT(FALSE);
index 19851fb..1a04f90 100644 (file)
@@ -2882,7 +2882,7 @@ REGION_FreeStorage(ScanLineListBlock *pSLLBlock)
     while (pSLLBlock)
     {
         tmpSLLBlock = pSLLBlock->next;
-        ExFreePool(pSLLBlock);
+        ExFreePoolWithTag(pSLLBlock, TAG_REGION);
         pSLLBlock = tmpSLLBlock;
     }
 }
index 0ced1fc..a5b7a14 100644 (file)
@@ -1590,7 +1590,7 @@ UserGetClassName(IN PCLS Class,
 
     if (Ansi && szTemp != NULL && szTemp != szStaticTemp)
     {
-        ExFreePool(szTemp);
+        ExFreePoolWithTag(szTemp, USERTAG_CLASS);
     }
 
     return Ret;
index 04c58b0..ff14af4 100644 (file)
@@ -69,7 +69,7 @@ IntClientShutdown(
              lResult = MCSR_SHUTDOWNFINISHED;
           }
       }
-      ExFreePool(List);
+      ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
    }
    if (List && (lResult == MCSR_DONOTSHUTDOWN)) return lResult;
 /*
index 93ffe9d..fdad25e 100644 (file)
@@ -742,7 +742,7 @@ VOID co_IntShellHookNotify(WPARAM Message, WPARAM wParam, LPARAM lParam)
                                  (Message == HSHELL_LANGUAGE ? lParam : (LPARAM)wParam) );
       }
 
-      ExFreePool(HwndList);
+      ExFreePoolWithTag(HwndList, USERTAG_WINDOWLIST);
    }
 
    if (ISITHOOKED(WH_SHELL))
@@ -802,7 +802,7 @@ BOOL IntDeRegisterShellHookWindow(HWND hWnd)
       if (Current->hWnd == hWnd)
       {
          RemoveEntryList(&Current->ListEntry);
-         ExFreePool(Current);
+         ExFreePoolWithTag(Current, TAG_WINSTA);
          return TRUE;
       }
    }
index 444c83a..6a1edfe 100644 (file)
@@ -153,10 +153,10 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO
          List = IntWinListChildren(UserGetDesktopWindow());
          if ( List )
          {
-            if ( OldTID ) 
+            if ( OldTID )
             {
                ptiOld->TIF_flags |= TIF_INACTIVATEAPPMSG;
-               ptiOld->pClientInfo->dwTIFlags = ptiOld->TIF_flags;           
+               ptiOld->pClientInfo->dwTIFlags = ptiOld->TIF_flags;
 
                for (phWnd = List; *phWnd; ++phWnd)
                {
@@ -186,13 +186,13 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO
                   }
                }
             }
-            ExFreePool(List);
+            ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
          }
       }
       if (WindowPrev)
          UserDerefObjectCo(WindowPrev); // Now allow the previous window to die.
 
-      if (Window->state & WNDS_ACTIVEFRAME) 
+      if (Window->state & WNDS_ACTIVEFRAME)
       {  // If already active frame do not allow NCPaint.
          //ERR("SendActivateMessage Is Active Frame!\n");
          Window->state |= WNDS_NONCPAINT;
@@ -345,7 +345,7 @@ CanForceFG(PPROCESSINFO ppi)
 /*
    MSDN:
    The system restricts which processes can set the foreground window. A process
-   can set the foreground window only if one of the following conditions is true: 
+   can set the foreground window only if one of the following conditions is true:
 
     * The process is the foreground process.
     * The process was started by the foreground process.
@@ -353,7 +353,7 @@ CanForceFG(PPROCESSINFO ppi)
     * There is no foreground process.
     * The foreground process is being debugged.
     * The foreground is not locked (see LockSetForegroundWindow).
-    * The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo). 
+    * The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).
     * No menus are active.
 */
 
@@ -404,7 +404,7 @@ co_IntSetForegroundAndFocusWindow(PWND Wnd, BOOL MouseActivate)
          ( CanForceFG(pti->ppi) || pti->TIF_flags & (TIF_SYSTEMTHREAD|TIF_CSRSSTHREAD|TIF_ALLOWFOREGROUNDACTIVATE) )) ||
         pti->ppi == ppiScrnSaver
       )
-   { 
+   {
       IntSetFocusMessageQueue(Wnd->head.pti->MessageQueue);
       gptiForeground = Wnd->head.pti;
       TRACE("Set Foreground pti 0x%p Q 0x%p\n",Wnd->head.pti, Wnd->head.pti->MessageQueue);
@@ -416,7 +416,7 @@ co_IntSetForegroundAndFocusWindow(PWND Wnd, BOOL MouseActivate)
  */
       FindRemoveAsyncMsg(Wnd); // Do this to fix test_SFW todos!
       fgRet = TRUE;
-   } 
+   }
 
    //  Fix FG Bounce with regedit.
    if (hWndPrev != hWnd )
@@ -655,7 +655,7 @@ co_UserSetFocus(PWND Window)
          if (!pwndTop->spwndParent || pwndTop->spwndParent == UserGetDesktopWindow())
          {
             if ((pwndTop->style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return 0;
-            break;         
+            break;
          }
          if (pwndTop->spwndParent == UserGetMessageWindow()) return 0;
          pwndTop = pwndTop->spwndParent;
@@ -781,7 +781,7 @@ co_UserSetCapture(HWND hWnd)
          return NULL;
       }
    }
-   
+
    hWndPrev = MsqSetStateWindow(ThreadQueue, MSQ_STATE_CAPTURE, hWnd);
 
    if (hWndPrev)
index 881340d..aae4f7d 100644 (file)
@@ -152,7 +152,7 @@ IntFreeMenuItem(PMENU_OBJECT Menu, PMENU_ITEM MenuItem, BOOL bRecurse)
    }
 
    /* Free memory */
-   ExFreePool(MenuItem);
+   ExFreePoolWithTag(MenuItem, TAG_MENUITEM);
 
    return TRUE;
 }
index 24ad58e..e7145fd 100644 (file)
@@ -386,7 +386,7 @@ co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
                UserDerefObjectCo(Wnd);
             }
          }
-         ExFreePool(List);
+         ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
       }
    }
 }
@@ -505,7 +505,7 @@ IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags)
 
       if (Flags & RDW_VALIDATE && RgnType != NULLREGION)
       {
-         if (Flags & RDW_NOFRAME) 
+         if (Flags & RDW_NOFRAME)
             Wnd->state &= ~WNDS_SENDNCPAINT;
          if (Flags & RDW_NOERASE)
             Wnd->state &= ~(WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND);
@@ -1681,7 +1681,7 @@ NtUserScrollWindowEx(
       dcxflags = DCX_USESTYLE;
 
       if (!(Window->pcls->style & (CS_OWNDC|CS_CLASSDC)))
-         dcxflags |= DCX_CACHE; // AH??? wine~ If not Powned or with Class go Cheap! 
+         dcxflags |= DCX_CACHE; // AH??? wine~ If not Powned or with Class go Cheap!
 
       if (flags & SW_SCROLLCHILDREN && Window->style & WS_CLIPCHILDREN)
          dcxflags |= DCX_CACHE|DCX_NOCLIPCHILDREN;
@@ -2053,7 +2053,7 @@ UserRealizePalette(HDC hdc)
             ERR("RealizePalette Desktop.");
             hdc = UserGetWindowDC(pWnd);
             IntPaintDesktop(hdc);
-            UserReleaseDC(pWnd,hdc,FALSE);            
+            UserReleaseDC(pWnd,hdc,FALSE);
          }
          UserSendNotifyMessage((HWND)HWND_BROADCAST, WM_PALETTECHANGED, (WPARAM)hWnd, 0);
       }
index 775a543..23c005b 100644 (file)
@@ -90,7 +90,7 @@ IntGetScrollBarRect (PWND Wnd, INT nBar, RECTL *lprect)
          lprect->bottom += UserGetSystemMetrics (SM_CYHSCROLL);
          if (Wnd->style & WS_BORDER)
          {
-            lprect->left--; 
+            lprect->left--;
             lprect->right++;
          }
          else if (Wnd->style & WS_VSCROLL)
@@ -113,7 +113,7 @@ IntGetScrollBarRect (PWND Wnd, INT nBar, RECTL *lprect)
          }
          if (Wnd->style & WS_BORDER)
          {
-            lprect->top--;   
+            lprect->top--;
             lprect->bottom++;
          }
          else if (Wnd->style & WS_HSCROLL)
@@ -618,7 +618,7 @@ IntDestroyScrollBars(PWND Window)
    {
       DesktopHeapFree(Window->head.rpdesk, Window->pSBInfo);
       Window->pSBInfo = NULL;
-      ExFreePool(Window->pSBInfoex);
+      ExFreePoolWithTag(Window->pSBInfoex, TAG_SBARINFO);
       Window->pSBInfoex = NULL;
       return TRUE;
    }
@@ -802,7 +802,7 @@ NtUserSBGetParms(
    {
       RtlCopyMemory(&psi, lpsi, sizeof(SCROLLINFO));
       if (pSBData)
-      { 
+      {
          RtlCopyMemory(&SBDataSafe, pSBData, sizeof(SBDATA));
       }
    }
index 70bbd1e..0aeb744 100644 (file)
@@ -304,7 +304,7 @@ IntValidateOwnerDepth(PWND Wnd, PWND Owner)
       Owner = Owner->spwndOwner;
       Depth++;
    }
-   return FALSE; 
+   return FALSE;
 }
 
 /***********************************************************************
@@ -473,7 +473,7 @@ static LRESULT co_UserFreeWindow(PWND Window,
             UserDereferenceObject(Child);
          }
       }
-      ExFreePool(Children);
+      ExFreePoolWithTag(Children, USERTAG_WINDOWLIST);
    }
 
    if(SendMessages)
@@ -1206,7 +1206,7 @@ co_IntSetParent(PWND Wnd, PWND WndNewParent)
 
    WndOldParent = Wnd->spwndParent;
 
-   if ( WndOldParent && 
+   if ( WndOldParent &&
         WndOldParent->ExStyle & WS_EX_LAYOUTRTL)
       pt.x = Wnd->rcWindow.right;
    else
@@ -1224,7 +1224,7 @@ co_IntSetParent(PWND Wnd, PWND WndNewParent)
       /* Set the new parent */
       Wnd->spwndParent = WndNewParent;
 
-      if ( Wnd->style & WS_CHILD && 
+      if ( Wnd->style & WS_CHILD &&
            Wnd->spwndOwner &&
            Wnd->spwndOwner->ExStyle & WS_EX_TOPMOST )
       {
@@ -1931,7 +1931,7 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
        if (!IntValidateOwnerDepth(pWnd, Owner))
        {
           EngSetLastError(ERROR_INVALID_PARAMETER);
-          goto Error; 
+          goto Error;
        }
        if ( pWnd->spwndOwner &&
             pWnd->spwndOwner->ExStyle & WS_EX_TOPMOST )
@@ -2395,7 +2395,7 @@ ProbeAndCaptureLargeString(
         _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
         {
             /* Cleanup and fail */
-            ExFreePool(pvBuffer);
+            ExFreePoolWithTag(pvBuffer, TAG_STRING);
             _SEH2_YIELD(return _SEH2_GetExceptionCode();)
         }
         _SEH2_END
@@ -2682,7 +2682,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWND Window)
                }
 
             }
-            ExFreePool(Children);
+            ExFreePoolWithTag(Children, USERTAG_WINDOWLIST);
          }
          if (! GotOne)
          {
@@ -2794,7 +2794,7 @@ IntFindWindow(PWND Parent,
          }
       }
       }
-      ExFreePool(List);
+      ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
    }
 
    return Ret;
@@ -2987,7 +2987,7 @@ NtUserFindWindowEx(HWND hwndParent,
                 }
 
              }
-             ExFreePool(List);
+             ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
           }
        }
        else
@@ -4158,7 +4158,7 @@ IntShowOwnedPopups(PWND OwnerWnd, BOOL fShow )
       }
 
    }
-   ExFreePool( win_array );
+   ExFreePoolWithTag(win_array, USERTAG_WINDOWLIST);
    TRACE("Leave ShowOwnedPopups\n");
    return TRUE;
 }
index a4efe19..78f2ed5 100644 (file)
@@ -65,7 +65,7 @@ IntGetClientRect(PWND Wnd, RECTL *Rect)
       Rect->bottom = UserGetSystemMetrics(SM_CYMINIMIZED);
       return;
    }
-   if ( Wnd != UserGetDesktopWindow()) // Wnd->fnid != FNID_DESKTOP ) 
+   if ( Wnd != UserGetDesktopWindow()) // Wnd->fnid != FNID_DESKTOP )
    {
       *Rect = Wnd->rcClient;
       RECTL_vOffsetRect(Rect, -Wnd->rcClient.left, -Wnd->rcClient.top);
@@ -177,7 +177,7 @@ PWND FASTCALL IntGetLastTopMostWindow(VOID)
 BOOL FASTCALL ActivateOtherWindowMin(PWND Wnd)
 {
     BOOL ActivePrev, FindTopWnd;
-    PWND pWndTopMost, pWndChild, pWndSetActive, pWndTemp, pWndDesk; 
+    PWND pWndTopMost, pWndChild, pWndSetActive, pWndTemp, pWndDesk;
     USER_REFERENCE_ENTRY Ref;
     PTHREADINFO pti = gptiCurrent;
 
@@ -398,7 +398,7 @@ co_WinPosArrangeIconicWindows(PWND parent)
          //ERR("X:%d Y:%d\n",x,y);
       }
    }
-   ExFreePool(List);
+   ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
    return yspacing;
 }
 
@@ -431,7 +431,7 @@ WinPosFindIconPos(PWND Window, POINT *Pos)
 
    //ERR("X:%d Y:%d XS:%d YS:%d\n",Pos->x,Pos->y,xspacing,yspacing);
 
-   // Set to default position when minimized. 
+   // Set to default position when minimized.
    Pos->x = x + UserGetSystemMetrics(SM_CXBORDER);
    Pos->y = y - yspacing - UserGetSystemMetrics(SM_CYBORDER);
 
@@ -752,7 +752,7 @@ co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos)
       switch (ShowFlag)
       {
          case SW_SHOWMINNOACTIVE:
-         case SW_SHOWMINIMIZED:  
+         case SW_SHOWMINIMIZED:
          case SW_FORCEMINIMIZE:
          case SW_MINIMIZE:
             {
@@ -1323,7 +1323,7 @@ WinPosDoOwnedPopups(PWND Window, HWND hWndInsertAfter)
             hWndInsertAfter = List[i];
          }
       }
-      ExFreePool(List);
+      ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
    }
 
    return hWndInsertAfter;
@@ -1637,7 +1637,7 @@ co_WinPosSetWindowPos(
             IntLinkWindow(Window, InsertAfterWindow);
          }
 
-         if ( ( WinPos.hwndInsertAfter == HWND_TOPMOST || 
+         if ( ( WinPos.hwndInsertAfter == HWND_TOPMOST ||
                ( Window->ExStyle & WS_EX_TOPMOST && Window->spwndPrev && Window->spwndPrev->ExStyle & WS_EX_TOPMOST ) ||
                ( Window->spwndNext && Window->spwndNext->ExStyle & WS_EX_TOPMOST ) ) &&
                !bNoTopMost )
@@ -1932,7 +1932,7 @@ co_WinPosSetWindowPos(
    }
 
    /* And last, send the WM_WINDOWPOSCHANGED message */
+
    TRACE("\tstatus flags = %04x\n", WinPos.flags & SWP_AGG_STATUSFLAGS);
 
    if ((WinPos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE)
@@ -2174,7 +2174,7 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd)
 
    /* We can't activate a child window */
    if ((Wnd->style & WS_CHILD) &&
-       !(Wnd->ExStyle & WS_EX_MDICHILD) && 
+       !(Wnd->ExStyle & WS_EX_MDICHILD) &&
        Cmd != SW_SHOWNA)
    {
       //ERR("SWP Child No active and ZOrder\n");
@@ -2297,12 +2297,12 @@ co_WinPosSearchChildren(
                 if(pwndChild != NULL)
                 {
                     /* We found a window. Don't send any more WM_NCHITTEST messages */
-                    ExFreePool(List);
+                    ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
                     UserDereferenceObject(ScopeWin);
                     return pwndChild;
                 }
             }
-            ExFreePool(List);
+            ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
         }
     }
 
@@ -2381,14 +2381,14 @@ IntRealChildWindowFromPoint(PWND Parent, LONG x, LONG y)
                if ( Child->pcls->atomClassName != gpsi->atomSysClass[ICLS_BUTTON] ||
                    (Child->style & BS_TYPEMASK) != BS_GROUPBOX )
                {
-                  ExFreePool(List);
+                  ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
                   return Child;
                }
                pwndHit = Child;
             }
          }
       }
-      ExFreePool(List);
+      ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
    }
    return pwndHit ? pwndHit : Parent;
 }
@@ -2439,7 +2439,7 @@ IntChildWindowFromPointEx(PWND Parent, LONG x, LONG y, UINT uiFlags)
             }
          }
       }
-      ExFreePool(List);
+      ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
    }
    return pwndHit ? pwndHit : Parent;
 }
index 7fa70dd..c9a8178 100644 (file)
@@ -1092,7 +1092,7 @@ BuildWindowStationNameList(
    {
       if (Buffer != InitialBuffer)
       {
-         ExFreePool(Buffer);
+         ExFreePoolWithTag(Buffer, TAG_WINSTA);
       }
       return Status;
    }
@@ -1107,7 +1107,7 @@ BuildWindowStationNameList(
       {
          if (Buffer != InitialBuffer)
          {
-            ExFreePool(Buffer);
+            ExFreePoolWithTag(Buffer, TAG_WINSTA);
          }
          return Status;
       }
@@ -1117,7 +1117,7 @@ BuildWindowStationNameList(
       {
          if (Buffer != InitialBuffer)
          {
-            ExFreePool(Buffer);
+            ExFreePoolWithTag(Buffer, TAG_WINSTA);
          }
          return Status;
       }
@@ -1129,7 +1129,7 @@ BuildWindowStationNameList(
     */
    if (NULL != Buffer && Buffer != InitialBuffer)
    {
-      ExFreePool(Buffer);
+      ExFreePoolWithTag(Buffer, TAG_WINSTA);
    }
 
    return STATUS_SUCCESS;