Use ExAllocatePoolWithTag instead of ExAllocatePool

svn path=/trunk/; revision=57505
This commit is contained in:
Timo Kreuzer 2012-10-06 20:15:36 +00:00
parent 83f3d18dee
commit dfbde4a0d6
20 changed files with 89 additions and 85 deletions

View 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);

View 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
{

View 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;
}

View 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);
}
}

View file

@ -99,7 +99,7 @@ SURFACE_Cleanup(PVOID ObjectBody)
else if (psurf->SurfObj.fjBitmap & BMF_POOLALLOC)
{
/* Free a pool allocation */
ExFreePool(pvBits);
EngFreeMem(pvBits);
}
}

View file

@ -557,7 +557,7 @@ Exit:
if (hSourceBitmap) EngDeleteSurface((HSURF)hSourceBitmap);
DC_UnlockDc(pDC);
Exit2:
ExFreePool(pbmiSafe);
ExFreePoolWithTag(pbmiSafe, 'pmTG');
return ret;
}

View 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;
}

View 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

View 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);

View file

@ -2882,7 +2882,7 @@ REGION_FreeStorage(ScanLineListBlock *pSLLBlock)
while (pSLLBlock)
{
tmpSLLBlock = pSLLBlock->next;
ExFreePool(pSLLBlock);
ExFreePoolWithTag(pSLLBlock, TAG_REGION);
pSLLBlock = tmpSLLBlock;
}
}

View file

@ -1590,7 +1590,7 @@ UserGetClassName(IN PCLS Class,
if (Ansi && szTemp != NULL && szTemp != szStaticTemp)
{
ExFreePool(szTemp);
ExFreePoolWithTag(szTemp, USERTAG_CLASS);
}
return Ret;

View file

@ -69,7 +69,7 @@ IntClientShutdown(
lResult = MCSR_SHUTDOWNFINISHED;
}
}
ExFreePool(List);
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
}
if (List && (lResult == MCSR_DONOTSHUTDOWN)) return lResult;
/*

View 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;
}
}

View file

@ -186,7 +186,7 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO
}
}
}
ExFreePool(List);
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
}
}
if (WindowPrev)

View file

@ -152,7 +152,7 @@ IntFreeMenuItem(PMENU_OBJECT Menu, PMENU_ITEM MenuItem, BOOL bRecurse)
}
/* Free memory */
ExFreePool(MenuItem);
ExFreePoolWithTag(MenuItem, TAG_MENUITEM);
return TRUE;
}

View file

@ -386,7 +386,7 @@ co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
UserDerefObjectCo(Wnd);
}
}
ExFreePool(List);
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
}
}
}

View file

@ -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;
}

View file

@ -473,7 +473,7 @@ static LRESULT co_UserFreeWindow(PWND Window,
UserDereferenceObject(Child);
}
}
ExFreePool(Children);
ExFreePoolWithTag(Children, USERTAG_WINDOWLIST);
}
if(SendMessages)
@ -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;
}

View file

@ -398,7 +398,7 @@ co_WinPosArrangeIconicWindows(PWND parent)
//ERR("X:%d Y:%d\n",x,y);
}
}
ExFreePool(List);
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
return yspacing;
}
@ -1323,7 +1323,7 @@ WinPosDoOwnedPopups(PWND Window, HWND hWndInsertAfter)
hWndInsertAfter = List[i];
}
}
ExFreePool(List);
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
}
return hWndInsertAfter;
@ -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;
}

View 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;