Author: hpoussin
Date: Fri Aug 29 16:19:41 2008
New Revision: 35769
URL:
http://svn.reactos.org/svn/reactos?rev=35769&view=rev
Log:
win32k: Add tags when allocating memory
ntoskrnl: Relax checks when freeing a string
Modified:
trunk/reactos/ntoskrnl/rtl/libsupp.c
trunk/reactos/subsystems/win32/win32k/eng/surface.c
trunk/reactos/subsystems/win32/win32k/eng/xlate.c
trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
Modified: trunk/reactos/ntoskrnl/rtl/libsupp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/rtl/libsupp.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] Fri Aug 29 16:19:41 2008
@@ -74,13 +74,18 @@
}
+#define TAG_USTR TAG('U', 'S', 'T', 'R')
+#define TAG_ASTR TAG('A', 'S', 'T', 'R')
+#define TAG_OSTR TAG('O', 'S', 'T', 'R')
VOID
STDCALL
RtlpFreeMemory(PVOID Mem,
ULONG Tag)
{
- ExFreePoolWithTag(Mem,
- Tag);
+ if (Tag == TAG_ASTR || Tag == TAG_OSTR || Tag == TAG_USTR)
+ ExFreePool(Mem);
+ else
+ ExFreePoolWithTag(Mem, Tag);
}
/*
Modified: trunk/reactos/subsystems/win32/win32k/eng/surface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/surface.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/surface.c [iso-8859-1] Fri Aug 29 16:19:41
2008
@@ -325,7 +325,7 @@
SurfObj->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(BMF_8BPP));
SurfObj->cjBits = SurfObj->lDelta * Size.cy;
UncompressedFormat = BMF_8BPP;
- UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, 0);
+ UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, TAG_DIB);
Decompress8bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits,
SurfObj->lDelta);
}
else
@@ -356,7 +356,7 @@
{
SurfObj->pvBits = EngAllocMem(0 != (Flags & BMF_NOZEROINIT) ?
0 : FL_ZERO_MEMORY,
- SurfObj->cjBits, 0);
+ SurfObj->cjBits, TAG_DIB);
}
if (SurfObj->pvBits == NULL)
{
Modified: trunk/reactos/subsystems/win32/win32k/eng/xlate.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/xlate.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/xlate.c [iso-8859-1] Fri Aug 29 16:19:41
2008
@@ -243,7 +243,7 @@
{
XlateObj->cEntries = SourcePalGDI->NumColors;
XlateObj->pulXlate =
- EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, 0);
+ EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, TAG_XLATEOBJ);
XlateObj->flXlate |= XO_TRIVIAL;
for (i = 0; i < XlateObj->cEntries; i++)
@@ -264,7 +264,7 @@
{
XlateObj->cEntries = SourcePalGDI->NumColors;
XlateObj->pulXlate =
- EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, 0);
+ EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, TAG_XLATEOBJ);
for (i = 0; i < XlateObj->cEntries; i++)
XlateObj->pulXlate[i] =
ShiftAndMask(XlateGDI, *((ULONG *)&SourcePalGDI->IndexedColors[i]));
@@ -379,7 +379,7 @@
XlateObj = GDIToObj(XlateGDI, XLATE);
XlateObj->cEntries = 2;
- XlateObj->pulXlate = EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries, 0);
+ XlateObj->pulXlate = EngAllocMem(0, sizeof(ULONG) * XlateObj->cEntries,
TAG_XLATEOBJ);
if (XlateObj->pulXlate == NULL)
{
PALETTE_UnlockPalette(DestPalGDI);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Fri Aug 29
16:19:41 2008
@@ -317,7 +317,7 @@
NULL,
0,
sizeof(CURICON_PROCESS),
- 0,
+ TAG_DIB,
128);
InitializeListHead(&gCurIconList);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Fri Aug 29
16:19:41 2008
@@ -155,14 +155,14 @@
NULL,
0,
sizeof(USER_MESSAGE),
- 0,
+ TAG_USRMSG,
256);
ExInitializePagedLookasideList(&TimerLookasideList,
NULL,
NULL,
0,
sizeof(TIMER_ENTRY),
- 0,
+ TAG_TIMER,
64);
return(STATUS_SUCCESS);