[WIN32K] Tag more pool allocations
authorGregor Schneider <grschneider@gmail.com>
Thu, 10 Jun 2010 19:20:57 +0000 (19:20 +0000)
committerGregor Schneider <grschneider@gmail.com>
Thu, 10 Jun 2010 19:20:57 +0000 (19:20 +0000)
svn path=/trunk/; revision=47741

reactos/subsystems/win32/win32k/ldr/loader.c
reactos/subsystems/win32/win32k/ntuser/clipboard.c
reactos/subsystems/win32/win32k/ntuser/monitor.c
reactos/subsystems/win32/win32k/ntuser/winsta.c

index 50a8756..bc867c2 100644 (file)
@@ -222,10 +222,10 @@ EngLoadImage (LPWSTR DriverName)
                        DPRINT1("ZwSetSystemInformation failed with Status 0x%lx\n", Status);
                }
                else {
                        DPRINT1("ZwSetSystemInformation failed with Status 0x%lx\n", Status);
                }
                else {
-                       DriverInfo = ExAllocatePool(PagedPool, sizeof(DRIVERS));
+                       DriverInfo = ExAllocatePoolWithTag(PagedPool, sizeof(DRIVERS), TAG_DRIVER);
                        DriverInfo->DriverName.MaximumLength = GdiDriverInfo.DriverName.MaximumLength;
                        DriverInfo->DriverName.Length = GdiDriverInfo.DriverName.Length;
                        DriverInfo->DriverName.MaximumLength = GdiDriverInfo.DriverName.MaximumLength;
                        DriverInfo->DriverName.Length = GdiDriverInfo.DriverName.Length;
-                       DriverInfo->DriverName.Buffer = ExAllocatePool(PagedPool, GdiDriverInfo.DriverName.MaximumLength);
+                       DriverInfo->DriverName.Buffer = ExAllocatePoolWithTag(PagedPool, GdiDriverInfo.DriverName.MaximumLength, TAG_DRIVER);
                        RtlCopyUnicodeString(&DriverInfo->DriverName, &GdiDriverInfo.DriverName);
                        DriverInfo->SectionPointer = GdiDriverInfo.SectionPointer;
             DriverInfo->BaseAddress = GdiDriverInfo.ImageAddress;
                        RtlCopyUnicodeString(&DriverInfo->DriverName, &GdiDriverInfo.DriverName);
                        DriverInfo->SectionPointer = GdiDriverInfo.SectionPointer;
             DriverInfo->BaseAddress = GdiDriverInfo.ImageAddress;
index a44bbab..0448f6c 100644 (file)
@@ -75,7 +75,7 @@ IntAddWindowToChain(PWINDOW_OBJECT window)
     {
         wce = WindowsChain;
 
     {
         wce = WindowsChain;
 
-        wce = ExAllocatePool(PagedPool, sizeof(CLIPBOARDCHAINELEMENT));
+        wce = ExAllocatePoolWithTag(PagedPool, sizeof(CLIPBOARDCHAINELEMENT), USERTAG_CLIPBOARD);
         if (wce == NULL)
         {
             SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
         if (wce == NULL)
         {
             SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
@@ -167,7 +167,7 @@ intAddFormatedData(UINT format, HANDLE hData, DWORD size)
 {
     PCLIPBOARDELEMENT ce = NULL;
 
 {
     PCLIPBOARDELEMENT ce = NULL;
 
-    ce = ExAllocatePool(PagedPool, sizeof(CLIPBOARDELEMENT));
+    ce = ExAllocatePoolWithTag(PagedPool, sizeof(CLIPBOARDELEMENT), USERTAG_CLIPBOARD);
     if (ce == NULL)
     {
         SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
     if (ce == NULL)
     {
         SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
@@ -889,7 +889,7 @@ NtUserSetClipboardData(UINT uFormat, HANDLE hMem, DWORD size)
 
             if (!canSinthesize(uFormat))
             {
 
             if (!canSinthesize(uFormat))
             {
-                hCBData = ExAllocatePool(PagedPool, size);
+                hCBData = ExAllocatePoolWithTag(PagedPool, size, USERTAG_CLIPBOARD);
                 memcpy(hCBData, hMem, size);
                 intAddFormatedData(uFormat, hCBData, size);
                 DPRINT1("Data stored\n");
                 memcpy(hCBData, hMem, size);
                 intAddFormatedData(uFormat, hCBData, size);
                 DPRINT1("Data stored\n");
@@ -979,7 +979,7 @@ NtUserSetClipboardData(UINT uFormat, HANDLE hMem, DWORD size)
 
                     size = bi.bmiHeader.biSizeImage + sizeof(BITMAPINFOHEADER);
 
 
                     size = bi.bmiHeader.biSizeImage + sizeof(BITMAPINFOHEADER);
 
-                    hCBData = ExAllocatePool(PagedPool, size);
+                    hCBData = ExAllocatePoolWithTag(PagedPool, size, USERTAG_CLIPBOARD);
                     memcpy(hCBData, &bi, sizeof(BITMAPINFOHEADER));
 
                     ret = NtGdiGetDIBitsInternal(hdc, hMem, 0, bm.bmHeight, (LPBYTE)hCBData + sizeof(BITMAPINFOHEADER), &bi, DIB_RGB_COLORS, 0, 0);
                     memcpy(hCBData, &bi, sizeof(BITMAPINFOHEADER));
 
                     ret = NtGdiGetDIBitsInternal(hdc, hMem, 0, bm.bmHeight, (LPBYTE)hCBData + sizeof(BITMAPINFOHEADER), &bi, DIB_RGB_COLORS, 0, 0);
index e0e2904..d13c438 100644 (file)
@@ -560,7 +560,7 @@ NtUserEnumDisplayMonitors(
    }
    if (monitorRectList != NULL && listSize != 0)
    {
    }
    if (monitorRectList != NULL && listSize != 0)
    {
-      safeRectList = ExAllocatePool(PagedPool, sizeof (RECT) * listSize);
+      safeRectList = ExAllocatePoolWithTag(PagedPool, sizeof (RECT) * listSize, USERTAG_MONITORRECTS);
       if (safeRectList == NULL)
       {
          ExFreePool(safeHMonitorList);
       if (safeRectList == NULL)
       {
          ExFreePool(safeHMonitorList);
@@ -845,7 +845,7 @@ NtUserMonitorFromRect(
       /* FIXME: SetLastWin32Error? */
       return (HMONITOR)NULL;
    }
       /* FIXME: SetLastWin32Error? */
       return (HMONITOR)NULL;
    }
-   rectList = ExAllocatePool(PagedPool, sizeof (RECT) * numMonitors);
+   rectList = ExAllocatePoolWithTag(PagedPool, sizeof (RECT) * numMonitors, USERTAG_MONITORRECTS);
    if (rectList == NULL)
    {
       ExFreePool(hMonitorList);
    if (rectList == NULL)
    {
       ExFreePool(hMonitorList);
index 2d26c8d..c4714c7 100644 (file)
@@ -96,7 +96,7 @@ CleanupWindowStationImpl(VOID)
 BOOL FASTCALL
 IntSetupClipboard(PWINSTATION_OBJECT WinStaObj)
 {
 BOOL FASTCALL
 IntSetupClipboard(PWINSTATION_OBJECT WinStaObj)
 {
-    WinStaObj->Clipboard = ExAllocatePool(PagedPool, sizeof(CLIPBOARDSYSTEM));
+    WinStaObj->Clipboard = ExAllocatePoolWithTag(PagedPool, sizeof(CLIPBOARDSYSTEM), TAG_WINSTA);
     if (WinStaObj->Clipboard)
     {
         RtlZeroMemory(WinStaObj->Clipboard, sizeof(CLIPBOARDSYSTEM));
     if (WinStaObj->Clipboard)
     {
         RtlZeroMemory(WinStaObj->Clipboard, sizeof(CLIPBOARDSYSTEM));