(*Spans)[i].Width = Boundary->right - Boundary->left;
}
}
-
return TRUE;
}
{
if (NULL != *Spans)
{
- ExFreePool(*Spans);
+ ExFreePoolWithTag(*Spans, TAG_CLIP);
*Spans = NULL;
}
*Count = 0;
{
*dest++ = *src++;
}
- ExFreePool(*Spans);
+ ExFreePoolWithTag(*Spans, TAG_CLIP);
}
*Spans = NewSpans;
}
} GRAPHICS_DRIVER, *PGRAPHICS_DRIVER;
static PGRAPHICS_DRIVER DriverList;
-static PGRAPHICS_DRIVER GenericDriver = 0;
+static PGRAPHICS_DRIVER GenericDriver = NULL;
BOOL DRIVER_RegisterDriver(LPCWSTR Name, PGD_ENABLEDRIVER EnableDriver)
{
- PGRAPHICS_DRIVER Driver = ExAllocatePoolWithTag(PagedPool, sizeof(*Driver), TAG_DRIVER);
+ PGRAPHICS_DRIVER Driver;
+
DPRINT( "DRIVER_RegisterDriver( Name: %S )\n", Name );
+
+ if (GenericDriver != NULL)
+ {
+ return FALSE;
+ }
+ Driver = ExAllocatePoolWithTag(PagedPool, sizeof(*Driver), TAG_DRIVER);
if (!Driver) return FALSE;
Driver->ReferenceCount = 0;
Driver->EnableDriver = EnableDriver;
if (Driver->Name == NULL)
{
DPRINT1("Out of memory\n");
- ExFreePool(Driver);
+ ExFreePoolWithTag(Driver, TAG_DRIVER);
return FALSE;
}
return TRUE;
}
- if (GenericDriver != NULL)
- {
- ExFreePool(Driver);
- return FALSE;
- }
-
GenericDriver = Driver;
return TRUE;
}
ExistingDriver = DRIVER_FindExistingDDIDriver(FullName);
if (ExistingDriver)
{
- ExFreePool(FullName);
+ ExFreePoolWithTag(FullName, TAG_DRIVER);
return ExistingDriver;
}
DRIVER_RegisterDriver( L"DISPLAY", GdiDriverInfo.EntryPoint);
DRIVER_RegisterDriver( FullName, GdiDriverInfo.EntryPoint);
- ExFreePool(FullName);
+ ExFreePoolWithTag(FullName, TAG_DRIVER);
return (PGD_ENABLEDRIVER)GdiDriverInfo.EntryPoint;
}
if ( !GlobalEvents )
{
GlobalEvents = ExAllocatePoolWithTag(PagedPool, sizeof(EVENTTABLE), TAG_HOOK);
+ if (GlobalEvents == NULL)
+ {
+ SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ goto SetEventExit;
+ }
GlobalEvents->Counts = 0;
InitializeListHead(&GlobalEvents->Events);
}
if (! NT_SUCCESS(Status))
{
- ExFreePool(pEH->ModuleName.Buffer);
+ ExFreePoolWithTag(pEH->ModuleName.Buffer, TAG_HOOK);
UserDereferenceObject(pEH);
IntRemoveEvent(pEH);
SetLastNtError(Status);
if (HooklParam) Debug.lParam = (LPARAM)HooklParam;
lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)&Debug);
- if (HooklParam) ExFreePool(HooklParam);
+ if (HooklParam) ExFreePoolWithTag(HooklParam, TAG_HOOK);
return lResult;
}
ModuleName.MaximumLength);
if (! NT_SUCCESS(Status))
{
- ExFreePool(Hook->ModuleName.Buffer);
+ ExFreePoolWithTag(Hook->ModuleName.Buffer, TAG_HOOK);
UserDereferenceObject(Hook);
IntRemoveHook(Hook, WinStaObj, FALSE);
if (NULL != Thread)
if (Status != STATUS_BUFFER_TOO_SMALL)
break;
- ExFreePool(Ret);
+ ExFreePoolWithTag(Ret, TAG_KEYBOARD);
Size += sizeof(KEYBOARD_INDICATOR_TRANSLATION);
if (Status != STATUS_SUCCESS)
{
- ExFreePool(Ret);
+ ExFreePoolWithTag(Ret, TAG_KEYBOARD);
return Status;
}
pti ? pti->KeyboardLayout->KBTables : 0 );
MmCopyToCaller(pwszBuff,OutPwszBuff,sizeof(WCHAR)*cchBuff);
- ExFreePool(OutPwszBuff);
+ ExFreePoolWithTag(OutPwszBuff, TAG_STRING);
}
else
ret = 0;
NewMenuItem->Text.Buffer = (PWSTR)ExAllocatePoolWithTag(PagedPool, MenuItem->Text.MaximumLength, TAG_STRING);
if(!NewMenuItem->Text.Buffer)
{
- ExFreePool(NewMenuItem);
+ ExFreePoolWithTag(NewMenuItem, TAG_MENUITEM);
break;
}
RtlCopyUnicodeString(&NewMenuItem->Text, &MenuItem->Text);
if(!IntSetMenuItemInfo(SubMenu, MenuItem, ItemInfo))
{
- ExFreePool(MenuItem);
+ ExFreePoolWithTag(MenuItem, TAG_MENUITEM);
return FALSE;
}
if (! NT_SUCCESS(Status))
{
DPRINT1("Failed to copy message to kernel: invalid usermode buffer\n");
- ExFreePool(KernelMem);
+ ExFreePoolWithTag(KernelMem, TAG_MSG);
return Status;
}
}
Status = MmCopyFromCaller(Dest->Buffer, Src, Dest->Length);
if(!NT_SUCCESS(Status))
{
- ExFreePool(Dest->Buffer);
+ ExFreePoolWithTag(Dest->Buffer, TAG_STRING);
Dest->Buffer = NULL;
return Status;
}
Status = MmCopyFromCaller(Dest->Buffer, Src, Dest->Length);
if(!NT_SUCCESS(Status))
{
- ExFreePool(Dest->Buffer);
+ ExFreePoolWithTag(Dest->Buffer, TAG_STRING);
Dest->Buffer = NULL;
return Status;
}
if(!NT_SUCCESS(Status) || (KeyValuePartialInfo->Type != REG_SZ))
{
ZwClose(KeyHandle);
- ExFreePool(KeyValuePartialInfo);
+ ExFreePoolWithTag(KeyValuePartialInfo, TAG_STRING);
return FALSE;
}
{
TileNum = 0;
}
- ExFreePool(KeyValuePartialInfo);
+ ExFreePoolWithTag(KeyValuePartialInfo, TAG_STRING);
/* start over again and look for the style*/
ResLength = 0;
if(!NT_SUCCESS(Status) || (KeyValuePartialInfo->Type != REG_SZ))
{
ZwClose(KeyHandle);
- ExFreePool(KeyValuePartialInfo);
+ ExFreePoolWithTag(KeyValuePartialInfo, TAG_STRING);
return FALSE;
}
{
StyleNum = 0;
}
- ExFreePool(KeyValuePartialInfo);
+ ExFreePoolWithTag(KeyValuePartialInfo, TAG_STRING);
/* Check the values we found in the registry */
if(TileNum && !StyleNum)
}
IntGetBitmapBits (Bitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf);
IntSetBitmapBits (resBitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf);
- ExFreePool (buf);
+ ExFreePoolWithTag (buf,TAG_BITMAP);
resBitmap->flFlags = Bitmap->flFlags;
GDIOBJ_UnlockObjByPtr((POBJ)resBitmap);
}
* if it negitve we getting to many scanline for scanline is UINT not
* a INT, so we need make the negtive value to positve and that make the
* count correct for negtive bitmap, TODO : we need testcase for this api */
-
IntSetDIBits(pDC, hBitmap, 0, abs(BitsInfo->bmiHeader.biHeight), Bits,
BitsInfo, Usage);
{
if (lpRGB != bmi->bmiColors)
{
- ExFreePool(lpRGB);
+ ExFreePoolWithTag(lpRGB, TAG_COLORMAP);
}
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);
return NULL;
{
if (lpRGB != bmi->bmiColors)
{
- ExFreePool(lpRGB);
+ ExFreePoolWithTag(lpRGB, TAG_COLORMAP);
}
SetLastWin32Error(ERROR_INVALID_HANDLE);
NtGdiDeleteObject(bmp);
VirtualFree(bm.bmBits, 0L, MEM_RELEASE), bm.bmBits = NULL;
} */
- if (dib) { ExFreePool(dib); dib = NULL; }
+ if (dib) { ExFreePoolWithTag(dib, TAG_DIB); dib = NULL; }
if (bmp) { bmp = NULL; }
if (res) { BITMAPOBJ_FreeBitmapByHandle(res); res = 0; }
}
if (lpRGB != bmi->bmiColors)
{
- ExFreePool(lpRGB);
+ ExFreePoolWithTag(lpRGB, TAG_COLORMAP);
}
if (bmp)
if (!NT_SUCCESS(Status))
{
- ExFreePool(pTemp);
+ ExFreePoolWithTag(pTemp, TAG_SHAPE);
return FALSE;
}
{
HRGN hRgn;
hRgn = IntCreatePolyPolygonRgn(SafePoints, SafeCounts, Count, (INT_PTR)hDC);
- ExFreePool(pTemp);
+ ExFreePoolWithTag(pTemp, TAG_SHAPE);
return (ULONG_PTR)hRgn;
}
if (!NT_SUCCESS(Status))
{
DC_UnlockDc(dc);
- ExFreePool(SafeVertex);
+ ExFreePoolWithTag(SafeVertex, TAG_SHAPE);
SetLastNtError(Status);
return FALSE;
}
{
FT_Done_Face(Face);
ObDereferenceObject(SectionObject);
- ExFreePool(Entry);
+ ExFreePoolWithTag(Entry, TAG_FONT);
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return 0;
}
EngFreeMem(FontGDI);
FT_Done_Face(Face);
ObDereferenceObject(SectionObject);
- ExFreePool(Entry);
+ ExFreePoolWithTag(Entry, TAG_FONT);
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return 0;
}
if (0 == (TM->tmPitchAndFamily & TMPF_VECTOR))
Info->FontType |= RASTER_FONTTYPE;
- ExFreePool(Otm);
+ ExFreePoolWithTag(Otm, TAG_GDITEXT);
wcsncpy(Info->EnumLogFontEx.elfLogFont.lfFaceName, FaceName, LF_FACESIZE);
wcsncpy(Info->EnumLogFontEx.elfFullName, FaceName, LF_FULLFACESIZE);
if ( Pts )
{
ret = IntGdiPolyline(dc, Pts, nOut);
- ExFreePool(Pts);
+ ExFreePoolWithTag(Pts, TAG_BEZIER);
}
}
npt[0].y = Dc_Attr->ptlCurrent.y;
memcpy(npt + 1, pt, sizeof(POINT) * Count);
ret = IntGdiPolyBezier(dc, npt, Count+1);
- ExFreePool(npt);
+ ExFreePoolWithTag(npt, TAG_BEZIER);
}
}
if ( ret )
pts[0].y = Dc_Attr->ptlCurrent.y;
memcpy( pts + 1, pt, sizeof(POINT) * Count);
ret = IntGdiPolyline(dc, pts, Count + 1);
- ExFreePool(pts);
+ ExFreePoolWithTag(pts, TAG_SHAPE);
}
}
if ( ret )
}
hpalette = NtGdiCreatePaletteInternal(palPtr,NB_RESERVED_COLORS);
- ExFreePool(palPtr);
+ ExFreePoolWithTag(palPtr, TAG_PALETTE);
#ifndef NO_MAPPING
palObj = (PALOBJ*)PALETTE_LockPalette(hpalette);
{
ASSERT(pPath!=NULL);
- if (pPath->pPoints) ExFreePool(pPath->pPoints);
- if (pPath->pFlags) ExFreePool(pPath->pFlags);
+ if (pPath->pPoints) ExFreePoolWithTag(pPath->pPoints, TAG_PATH);
+ if (pPath->pFlags) ExFreePoolWithTag(pPath->pFlags, TAG_PATH);
}
/* PATH_AssignGdiPath
for(i = 1; i < no; i++)
PATH_AddEntry(pPath, &pts[i], (i == no-1 && closed) ? PT_LINETO | PT_CLOSEFIGURE : PT_LINETO);
- ExFreePool(pts);
+ ExFreePoolWithTag(pts, TAG_BEZIER);
return TRUE;
}
}
/* Free memory for number-of-points-in-stroke array */
- ExFreePool(pNumPointsInStroke);
+ ExFreePoolWithTag(pNumPointsInStroke, TAG_PATH);
/* Success! */
*pHrgn=hrgn;
pFlagsNew=(BYTE *)ExAllocatePoolWithTag(PagedPool, numEntriesToAllocate * sizeof(BYTE), TAG_PATH);
if(!pFlagsNew)
{
- ExFreePool(pPointsNew);
+ ExFreePoolWithTag(pPointsNew, TAG_PATH);
return FALSE;
}
memcpy(pPointsNew, pPath->pPoints, sizeof(POINT)*pPath->numEntriesUsed);
memcpy(pFlagsNew, pPath->pFlags, sizeof(BYTE)*pPath->numEntriesUsed);
- ExFreePool(pPath->pPoints);
- ExFreePool(pPath->pFlags);
+ ExFreePoolWithTag(pPath->pPoints, TAG_PATH);
+ ExFreePoolWithTag(pPath->pFlags, TAG_PATH);
}
pPath->pPoints=pPointsNew;
pPath->pFlags=pFlagsNew;
}
memcpy(Realloc, pLinePts, nLinePts*sizeof(POINT));
- ExFreePool(pLinePts);
+ ExFreePoolWithTag(pLinePts, TAG_PATH);
pLinePts = Realloc;
}
memcpy(&pLinePts[nLinePts], &pBzrPts[1], (nBzrPts - 1) * sizeof(POINT));
nLinePts += nBzrPts - 1;
- ExFreePool(pBzrPts);
+ ExFreePoolWithTag(pBzrPts, TAG_BEZIER);
i += 2;
}
break;
ret = TRUE;
end:
- if(pLinePts)ExFreePool(pLinePts);
+ if(pLinePts) ExFreePoolWithTag(pLinePts, TAG_PATH);
/* Restore the old mapping mode */
Dc_Attr->iMapMode = mapMode;
else
{
SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
- ExFreePool(elp);
+ ExFreePoolWithTag(elp, TAG_PATH);
PATH_UnlockPath( pPath );
return FALSE;
}
penWidth = elp->elpWidth;
- ExFreePool(elp);
+ ExFreePoolWithTag(elp, TAG_PATH);
endcap = (PS_ENDCAP_MASK & penStyle);
joint = (PS_JOIN_MASK & penStyle);
}
numStrokes++;
j = 0;
- ExFreePool(pStrokes);
+ ExFreePoolWithTag(pStrokes, TAG_PATH);
pStrokes = ExAllocatePoolWithTag(PagedPool, numStrokes * sizeof(PPATH), TAG_PATH);
pStrokes[numStrokes - 1] = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
}
PATH_DestroyGdiPath(pStrokes[i]);
- ExFreePool(pStrokes[i]);
+ ExFreePoolWithTag(pStrokes[i], TAG_PATH);
PATH_DestroyGdiPath(pUpPath);
- ExFreePool(pUpPath);
+ ExFreePoolWithTag(pUpPath, TAG_PATH);
PATH_DestroyGdiPath(pDownPath);
- ExFreePool(pDownPath);
+ ExFreePoolWithTag(pDownPath, TAG_PATH);
}
- ExFreePool(pStrokes);
+ ExFreePoolWithTag(pStrokes, TAG_PATH);
pNewPath->state = PATH_Closed;
if (!(ret = PATH_AssignGdiPath(pPath, pNewPath)))
DPRINT1("Assign path failed\n");
PATH_DestroyGdiPath(pNewPath);
- ExFreePool(pNewPath);
+ ExFreePoolWithTag(pNewPath, TAG_PATH);
return ret;
}
if ( !NT_SUCCESS(Status) )
{
- ExFreePool ( SafeInData );
+ ExFreePoolWithTag ( SafeInData, TAG_PRINT );
DC_UnlockDc(pDC);
SetLastNtError(Status);
return -1;
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
freeout:
if ( SafeInData )
- ExFreePool ( SafeInData );
+ ExFreePoolWithTag ( SafeInData, TAG_PRINT );
DC_UnlockDc(pDC);
return -1;
}
DC_UnlockDc(pDC);
if ( SafeInData )
- ExFreePool ( SafeInData );
+ ExFreePoolWithTag ( SafeInData ,TAG_PRINT );
if ( SafeOutData )
{
}
_SEH_END;
- ExFreePool ( SafeOutData );
+ ExFreePoolWithTag ( SafeOutData, TAG_PRINT );
if ( !NT_SUCCESS(Status) )
{
SetLastNtError(Status);
}
temp = ExAllocatePoolWithTag(PagedPool, NewSize, TAG_REGION);
- if (temp == 0)
+ if (temp == NULL)
{
return 0;
}
reg->rdh.nRgnSize = NewSize;
if (*firstrect != ®->rdh.rcBound)
{
- ExFreePool(*firstrect);
+ ExFreePoolWithTag(*firstrect, TAG_REGION);
}
*firstrect = temp;
*rect = (*firstrect)+reg->rdh.nCount;
return FALSE;
if (dst->Buffer && dst->Buffer != &dst->rdh.rcBound)
- ExFreePool(dst->Buffer); //free the old buffer
+ ExFreePoolWithTag(dst->Buffer, TAG_REGION); //free the old buffer
dst->Buffer = temp;
dst->rdh.nRgnSize = src->rdh.nCount * sizeof(RECT); //size of region buffer
}
{
xrect = ExAllocatePoolWithTag(PagedPool, rgnSrc->rdh.nCount * sizeof(RECT), TAG_REGION);
if (rgnDst->Buffer && rgnDst->Buffer != &rgnDst->rdh.rcBound)
- ExFreePool(rgnDst->Buffer); //free the old buffer. will be assigned to xrect below.
+ ExFreePoolWithTag(rgnDst->Buffer, TAG_REGION); //free the old buffer. will be assigned to xrect below.
}
if (xrect)
return FALSE;
if (rgnDst->Buffer && rgnDst->Buffer != &rgnDst->rdh.rcBound)
- ExFreePool(rgnDst->Buffer); //free the old buffer
+ ExFreePoolWithTag(rgnDst->Buffer, TAG_REGION); //free the old buffer
rgnDst->Buffer = temp;
rgnDst->rdh.nCount = i;
rgnDst->rdh.nRgnSize = i * sizeof(RECT);
newReg->rdh.nRgnSize = newReg->rdh.nCount*sizeof(RECT);
COPY_RECTS(newReg->Buffer, prev_rects, newReg->rdh.nCount);
if (prev_rects != &newReg->rdh.rcBound)
- ExFreePool(prev_rects);
+ ExFreePoolWithTag(prev_rects, TAG_REGION);
}
}
else
*/
newReg->rdh.nRgnSize = sizeof(RECT);
if (newReg->Buffer != &newReg->rdh.rcBound)
- ExFreePool(newReg->Buffer);
+ ExFreePoolWithTag(newReg->Buffer, TAG_REGION);
newReg->Buffer = ExAllocatePoolWithTag(PagedPool, sizeof(RECT), TAG_REGION);
ASSERT(newReg->Buffer);
}
newReg->rdh.iType = RDH_RECTANGLES;
if (oldRects != &newReg->rdh.rcBound)
- ExFreePool(oldRects);
+ ExFreePoolWithTag(oldRects, TAG_REGION);
return;
}
{
COPY_RECTS(temp, reg->Buffer, reg->rdh.nCount);
if (reg->Buffer != ®->rdh.rcBound)
- ExFreePool(reg->Buffer);
+ ExFreePoolWithTag(reg->Buffer, TAG_REGION);
}
reg->Buffer = temp;
if (!tmpPtBlock)
{
DPRINT1("Can't alloc tPB\n");
- ExFreePool(pETEs);
+ ExFreePoolWithTag(pETEs, TAG_REGION);
return 0;
}
curPtBlock->next = tmpPtBlock;
if (!tmpPtBlock)
{
DPRINT1("Can't alloc tPB\n");
- ExFreePool(pETEs);
+ ExFreePoolWithTag(pETEs, TAG_REGION);
NtGdiDeleteObject(hrgn);
return 0;
}
for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;)
{
tmpPtBlock = curPtBlock->next;
- ExFreePool(curPtBlock);
+ ExFreePoolWithTag(curPtBlock, TAG_REGION);
curPtBlock = tmpPtBlock;
}
- ExFreePool(pETEs);
+ ExFreePoolWithTag(pETEs, TAG_REGION);
REGION_UnlockRgn(region);
return hrgn;
}
Dx = ExAllocatePoolWithTag(PagedPool, Count * sizeof(INT), TAG_GDITEXT);
if (NULL == Dx)
{
- ExFreePool(String);
+ ExFreePoolWithTag(String, TAG_GDITEXT);
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
{
if (NULL != Dx)
{
- ExFreePool(Dx);
+ ExFreePoolWithTag(Dx, TAG_GDITEXT);
}
- ExFreePool(String);
+ ExFreePoolWithTag(String, TAG_GDITEXT);
SetLastNtError(Status);
return FALSE;
}
{
if (NULL != Dx)
{
- ExFreePool(Dx);
+ ExFreePoolWithTag(Dx, TAG_GDITEXT);
}
- ExFreePool(String);
+ ExFreePoolWithTag(String, TAG_GDITEXT);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
Result = FALSE;
DC_UnlockDc(dc);
- ExFreePool(String);
+ ExFreePoolWithTag(String, TAG_GDITEXT);
if (! Result)
{
if (NULL != Dx)
{
- ExFreePool(Dx);
+ ExFreePoolWithTag(Dx, TAG_GDITEXT);
}
return FALSE;
}
{
if (NULL != Dx)
{
- ExFreePool(Dx);
+ ExFreePoolWithTag(Dx, TAG_GDITEXT);
}
SetLastNtError(Status);
return FALSE;
{
if (NULL != Dx)
{
- ExFreePool(Dx);
+ ExFreePoolWithTag(Dx, TAG_GDITEXT);
}
SetLastNtError(Status);
return FALSE;
}
if (NULL != Dx)
{
- ExFreePool(Dx);
+ ExFreePoolWithTag(Dx,TAG_GDITEXT);
}
Status = MmCopyToCaller(UnsafeSize, &Size, sizeof(SIZE));