Author: rharabien Date: Wed Jun 1 13:39:36 2011 New Revision: 52043
URL: http://svn.reactos.org/svn/reactos?rev=52043&view=rev Log: [NTOSKRNL] - Use tags when allocation and freeing memory and define them in tag.h - Fix some wrongly used tags when freeing - Our new memory manager doesn't check tags when ExFreePoolWithTag is used. It will be fixed after testing
Modified: trunk/reactos/ntoskrnl/cache/section/data.c trunk/reactos/ntoskrnl/ex/atom.c trunk/reactos/ntoskrnl/ex/callback.c trunk/reactos/ntoskrnl/ex/handle.c trunk/reactos/ntoskrnl/ex/harderr.c trunk/reactos/ntoskrnl/ex/init.c trunk/reactos/ntoskrnl/ex/profile.c trunk/reactos/ntoskrnl/ex/resource.c trunk/reactos/ntoskrnl/fstub/disksup.c trunk/reactos/ntoskrnl/fstub/fstubex.c trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h trunk/reactos/ntoskrnl/include/internal/ob_x.h trunk/reactos/ntoskrnl/include/internal/tag.h trunk/reactos/ntoskrnl/io/iomgr/file.c trunk/reactos/ntoskrnl/mm/ARM3/contmem.c trunk/reactos/ntoskrnl/mm/ARM3/mminit.c trunk/reactos/ntoskrnl/mm/ARM3/section.c trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c trunk/reactos/ntoskrnl/mm/marea.c trunk/reactos/ntoskrnl/ob/obname.c trunk/reactos/ntoskrnl/ob/obsdcach.c trunk/reactos/ntoskrnl/se/acl.c trunk/reactos/ntoskrnl/se/sd.c trunk/reactos/ntoskrnl/se/sid.c trunk/reactos/ntoskrnl/se/token.c
Modified: trunk/reactos/ntoskrnl/cache/section/data.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/data... ============================================================================== --- trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -307,7 +307,7 @@ MmUnlockCacheSectionSegment(Segment); } DPRINTC("Segment %x destroy\n", Segment); - ExFreePool(Segment); + ExFreePoolWithTag(Segment, TAG_MM_SECTION_SEGMENT); }
NTSTATUS
Modified: trunk/reactos/ntoskrnl/ex/atom.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/atom.c?rev=5204... ============================================================================== --- trunk/reactos/ntoskrnl/ex/atom.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/atom.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -172,7 +172,8 @@ }
/* If we captured anything, free it */ - if ((CapturedName) && (CapturedName != AtomName)) ExFreePool(CapturedName); + if ((CapturedName) && (CapturedName != AtomName)) + ExFreePoolWithTag(CapturedName, TAG_ATOM);
/* Return to caller */ return Status; @@ -321,7 +322,8 @@ }
/* If we captured anything, free it */ - if ((CapturedName) && (CapturedName != AtomName)) ExFreePool(CapturedName); + if ((CapturedName) && (CapturedName != AtomName)) + ExFreePoolWithTag(CapturedName, TAG_ATOM);
/* Return to caller */ return Status;
Modified: trunk/reactos/ntoskrnl/ex/callback.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/callback.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/ex/callback.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/callback.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -77,7 +77,7 @@ ExFreeCallBack(IN PEX_CALLBACK_ROUTINE_BLOCK CallbackBlock) { /* Just free it from memory */ - ExFreePool(CallbackBlock); + ExFreePoolWithTag(CallbackBlock, CALLBACK_TAG); }
VOID @@ -602,7 +602,7 @@ KeReleaseSpinLock(&CallbackObject->Lock, OldIrql);
/* Free the registration */ - ExFreePool(CallbackRegistration); + ExFreePoolWithTag(CallbackRegistration, CALLBACK_TAG); CallbackRegistration = NULL;
/* Dereference the object */ @@ -676,7 +676,7 @@ KeReleaseSpinLock(&CallbackObject->Lock, OldIrql);
/* Delete this registration */ - ExFreePool(CallbackRegistration); + ExFreePoolWithTag(CallbackRegistration, CALLBACK_TAG);
/* Remove the reference */ ObDereferenceObject(CallbackObject);
Modified: trunk/reactos/ntoskrnl/ex/handle.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/handle.c?rev=52... ============================================================================== --- trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -132,7 +132,7 @@ PVOID Buffer;
/* Do the allocation */ - Buffer = ExAllocatePoolWithTag(PagedPool, Size, 'btbO'); + Buffer = ExAllocatePoolWithTag(PagedPool, Size, TAG_OBJECT_TABLE); if (Buffer) { /* Clear the memory */ @@ -157,7 +157,7 @@ PVOID Buffer;
/* Do the allocation */ - Buffer = ExAllocatePoolWithTag(PagedPool, Size, 'btbO'); + Buffer = ExAllocatePoolWithTag(PagedPool, Size, TAG_OBJECT_TABLE); if (Buffer) { /* Check if we have a process to charge quota */ @@ -178,7 +178,7 @@ IN SIZE_T Size) { /* Free the buffer */ - ExFreePool(Buffer); + ExFreePoolWithTag(Buffer, TAG_OBJECT_TABLE); if (Process) { /* FIXME: Release quota */ @@ -273,7 +273,7 @@ }
/* Free the actual table and check if we need to release quota */ - ExFreePool(HandleTable); + ExFreePoolWithTag(HandleTable, TAG_OBJECT_TABLE); if (Process) { /* FIXME: TODO */ @@ -345,7 +345,7 @@ /* Allocate the table */ HandleTable = ExAllocatePoolWithTag(PagedPool, sizeof(HANDLE_TABLE), - 'btbO'); + TAG_OBJECT_TABLE); if (!HandleTable) return NULL;
/* Check if we have a process */ @@ -362,7 +362,7 @@ if (!HandleTableTable) { /* Failed, free the table */ - ExFreePool(HandleTable); + ExFreePoolWithTag(HandleTable, TAG_OBJECT_TABLE); return NULL; }
Modified: trunk/reactos/ntoskrnl/ex/harderr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/harderr.c?rev=5... ============================================================================== --- trunk/reactos/ntoskrnl/ex/harderr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/harderr.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -640,7 +640,7 @@ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { /* Free captured buffer */ - if (SafeParams) ExFreePool(SafeParams); + if (SafeParams) ExFreePoolWithTag(SafeParams, TAG_ERR);
/* Return the exception code */ _SEH2_YIELD(return _SEH2_GetExceptionCode()); @@ -676,7 +676,7 @@ if (PreviousMode != KernelMode) { /* That means we have a buffer to free */ - if (SafeParams) ExFreePool(SafeParams); + if (SafeParams) ExFreePoolWithTag(SafeParams, TAG_ERR);
/* Enter SEH Block for return */ _SEH2_TRY
Modified: trunk/reactos/ntoskrnl/ex/init.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=5204... ============================================================================== --- trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -244,7 +244,7 @@ /* Allocate the a new buffer since loader memory will be freed */ ExpNlsTableBase = ExAllocatePoolWithTag(NonPagedPool, ExpNlsTableSize, - 'iltR'); + TAG_RTLI); if (!ExpNlsTableBase) KeBugCheck(PHASE0_INITIALIZATION_FAILED);
/* Copy the codepage data in its new location. */ @@ -334,7 +334,7 @@ RtlCopyMemory(SectionBase, ExpNlsTableBase, ExpNlsTableSize);
/* Free the previously allocated buffer and set the new location */ - ExFreePoolWithTag(ExpNlsTableBase, 'iltR'); + ExFreePoolWithTag(ExpNlsTableBase, TAG_RTLI); ExpNlsTableBase = SectionBase;
/* Initialize the NLS Tables */ @@ -1321,7 +1321,7 @@ /* Allocate the initialization buffer */ InitBuffer = ExAllocatePoolWithTag(NonPagedPool, sizeof(INIT_BUFFER), - 'tinI'); + TAG_INIT); if (!InitBuffer) { /* Bugcheck */ @@ -1961,7 +1961,7 @@ ExpInitializationPhase++;
/* Free the boot buffer */ - ExFreePool(InitBuffer); + ExFreePoolWithTag(InitBuffer, TAG_INIT); DPRINT1("Free non-cache pages: %lx\n", MmAvailablePages + MiMemoryConsumers[MC_CACHE].PagesUsed); }
Modified: trunk/reactos/ntoskrnl/ex/profile.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/profile.c?rev=5... ============================================================================== --- trunk/reactos/ntoskrnl/ex/profile.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/profile.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -54,7 +54,7 @@ /* Unmap the Locked Buffer */ MmUnmapLockedPages(Profile->LockedBufferAddress, Profile->Mdl); MmUnlockPages(Profile->Mdl); - ExFreePool(Profile->Mdl); + IoFreeMdl(Profile->Mdl); }
/* Check if a Process is associated and reference it */ @@ -368,7 +368,7 @@ }
/* Allocate the Mdl Structure */ - Profile->Mdl = MmCreateMdl(NULL, Profile->Buffer, Profile->BufferSize); + Profile->Mdl = IoAllocateMdl(Profile->Buffer, Profile->BufferSize, FALSE, FALSE, NULL);
/* Protect this in SEH as we might raise an exception */ _SEH2_TRY @@ -381,7 +381,7 @@ /* Release our lock, free the buffer, dereference and return */ KeReleaseMutex(&ExpProfileMutex, FALSE); ObDereferenceObject(Profile); - ExFreePool(ProfileObject); + ExFreePoolWithTag(ProfileObject, TAG_PROFILE); _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; @@ -449,7 +449,7 @@ /* Unlock the Buffer */ MmUnmapLockedPages(Profile->LockedBufferAddress, Profile->Mdl); MmUnlockPages(Profile->Mdl); - ExFreePool(Profile->ProfileObject); + ExFreePoolWithTag(Profile->ProfileObject, TAG_PROFILE);
/* Clear the Locked Buffer pointer, meaning the Object is Stopped */ Profile->LockedBufferAddress = NULL;
Modified: trunk/reactos/ntoskrnl/ex/resource.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/resource.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/ex/resource.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/resource.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -220,7 +220,7 @@ { /* Someone already set it, free our event */ DPRINT1("WARNING: Handling race condition\n"); - ExFreePool(Event); + ExFreePoolWithTag(Event, TAG_RESOURCE_EVENT); }
break; @@ -280,7 +280,7 @@ { /* Someone already set it, free our semaphore */ DPRINT1("WARNING: Handling race condition\n"); - ExFreePool(Semaphore); + ExFreePoolWithTag(Semaphore, TAG_RESOURCE_SEMAPHORE); }
break; @@ -356,7 +356,7 @@ { /* Resource changed while we weren't holding the lock; bail out */ ExReleaseResourceLock(Resource, LockHandle); - ExFreePool(Table); + ExFreePoolWithTag(Table, TAG_RESOURCE_TABLE); } else { @@ -380,7 +380,7 @@ ExReleaseResourceLock(Resource, LockHandle);
/* Free the old table */ - if (Owner) ExFreePool(Owner); + if (Owner) ExFreePoolWithTag(Owner, TAG_RESOURCE_TABLE);
/* Set the resource index */ if (!OldSize) OldSize = 1; @@ -1473,9 +1473,9 @@ KeReleaseInStackQueuedSpinLock(&LockHandle);
/* Free every structure */ - if (Resource->OwnerTable) ExFreePool(Resource->OwnerTable); - if (Resource->SharedWaiters) ExFreePool(Resource->SharedWaiters); - if (Resource->ExclusiveWaiters) ExFreePool(Resource->ExclusiveWaiters); + if (Resource->OwnerTable) ExFreePoolWithTag(Resource->OwnerTable, TAG_RESOURCE_TABLE); + if (Resource->SharedWaiters) ExFreePoolWithTag(Resource->SharedWaiters, TAG_RESOURCE_SEMAPHORE); + if (Resource->ExclusiveWaiters) ExFreePoolWithTag(Resource->ExclusiveWaiters, TAG_RESOURCE_EVENT);
/* Return success */ return STATUS_SUCCESS;
Modified: trunk/reactos/ntoskrnl/fstub/disksup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fstub/disksup.c?re... ============================================================================== --- trunk/reactos/ntoskrnl/fstub/disksup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fstub/disksup.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -159,7 +159,7 @@ BOOLEAN First = TRUE; ULONG Count;
- DirectoryInfo = ExAllocatePool(PagedPool, 2 * PAGE_SIZE); + DirectoryInfo = ExAllocatePoolWithTag(PagedPool, 2 * PAGE_SIZE, TAG_FILE_SYSTEM); if (DirectoryInfo == NULL) { return 0; @@ -178,7 +178,7 @@ if (!NT_SUCCESS(Status)) { DPRINT1("ZwOpenDirectoryObject for %wZ failed, status=%lx\n", &ArcName, Status); - ExFreePool(DirectoryInfo); + ExFreePoolWithTag(DirectoryInfo, TAG_FILE_SYSTEM); return 0; }
@@ -223,7 +223,7 @@ } } } - ExFreePool(DirectoryInfo); + ExFreePoolWithTag(DirectoryInfo, TAG_FILE_SYSTEM); return RDiskCount; }
@@ -377,8 +377,8 @@ PDRIVE_LAYOUT_INFORMATION Buffer;
/* Allocate a partition list for a single entry. */ - Buffer = ExAllocatePool(NonPagedPool, - sizeof(DRIVE_LAYOUT_INFORMATION)); + Buffer = ExAllocatePoolWithTag(NonPagedPool, + sizeof(DRIVE_LAYOUT_INFORMATION), TAG_FILE_SYSTEM); if (Buffer != NULL) { RtlZeroMemory(Buffer, @@ -446,13 +446,13 @@
DPRINT("RDiskCount %d\n", RDiskCount);
- Buffer1 = (PWSTR)ExAllocatePool(PagedPool, - 64 * sizeof(WCHAR)); - Buffer2 = (PWSTR)ExAllocatePool(PagedPool, - 32 * sizeof(WCHAR)); - - PartialInformation = (PKEY_VALUE_PARTIAL_INFORMATION)ExAllocatePool(PagedPool, - sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(REG_DISK_MOUNT_INFO)); + Buffer1 = (PWSTR)ExAllocatePoolWithTag(PagedPool, + 64 * sizeof(WCHAR), TAG_FILE_SYSTEM); + Buffer2 = (PWSTR)ExAllocatePoolWithTag(PagedPool, + 32 * sizeof(WCHAR), TAG_FILE_SYSTEM); + + PartialInformation = (PKEY_VALUE_PARTIAL_INFORMATION)ExAllocatePoolWithTag(PagedPool, + sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(REG_DISK_MOUNT_INFO), TAG_FILE_SYSTEM);
if (!Buffer1 || !Buffer2 || !PartialInformation) return;
@@ -528,13 +528,13 @@ /* Initialize layout array */ if (ConfigInfo->DiskCount == 0) goto end_assign_disks; - LayoutArray = ExAllocatePool(NonPagedPool, - ConfigInfo->DiskCount * sizeof(PDRIVE_LAYOUT_INFORMATION)); + LayoutArray = ExAllocatePoolWithTag(NonPagedPool, + ConfigInfo->DiskCount * sizeof(PDRIVE_LAYOUT_INFORMATION), TAG_FILE_SYSTEM); if (!LayoutArray) { - ExFreePool(PartialInformation); - ExFreePool(Buffer2); - ExFreePool(Buffer1); + ExFreePoolWithTag(PartialInformation, TAG_FILE_SYSTEM); + ExFreePoolWithTag(Buffer2, TAG_FILE_SYSTEM); + ExFreePoolWithTag(Buffer1, TAG_FILE_SYSTEM); if (hKey) ZwClose(hKey); }
@@ -896,9 +896,9 @@ for (i = 0; i < ConfigInfo->DiskCount; i++) { if (LayoutArray[i] != NULL) - ExFreePool(LayoutArray[i]); - } - ExFreePool(LayoutArray); + ExFreePoolWithTag(LayoutArray[i], TAG_FILE_SYSTEM); + } + ExFreePoolWithTag(LayoutArray, TAG_FILE_SYSTEM); end_assign_disks:
/* Assign floppy drives */ @@ -948,9 +948,9 @@
/* Anything else to do? */
- ExFreePool(PartialInformation); - ExFreePool(Buffer2); - ExFreePool(Buffer1); + ExFreePoolWithTag(PartialInformation, TAG_FILE_SYSTEM); + ExFreePoolWithTag(Buffer2, TAG_FILE_SYSTEM); + ExFreePoolWithTag(Buffer1, TAG_FILE_SYSTEM); if (hKey) { ZwClose(hKey); @@ -1249,8 +1249,8 @@ Cleanup: /* Free all the pointers */ if (Event) ExFreePoolWithTag(Event, TAG_FILE_SYSTEM); - if (IoStatusBlock) ExFreePool(IoStatusBlock); - if (DiskGeometry) ExFreePool(DiskGeometry); + if (IoStatusBlock) ExFreePoolWithTag(IoStatusBlock, TAG_FILE_SYSTEM); + if (DiskGeometry) ExFreePoolWithTag(DiskGeometry, TAG_FILE_SYSTEM); return; }
@@ -1425,7 +1425,7 @@ { /* EZ Drive found, bias the offset */ IsEzDrive = TRUE; - ExFreePool(MbrBuffer); + ExFreePoolWithTag(MbrBuffer, TAG_FILE_SYSTEM); Offset.QuadPart = 512; }
@@ -1843,7 +1843,7 @@ { /* EZ Drive found, bias the offset */ IsEzDrive = TRUE; - ExFreePool(MbrBuffer); + ExFreePoolWithTag(MbrBuffer, TAG_FILE_SYSTEM); Offset.QuadPart = 512; }
@@ -1995,7 +1995,7 @@ } while (i < PartitionNumber);
/* Everything done, cleanup */ - if (Buffer) ExFreePool(Buffer); + if (Buffer) ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM); return Status; }
@@ -2043,7 +2043,7 @@ { /* EZ Drive found, bias the offset */ IsEzDrive = TRUE; - ExFreePool(MbrBuffer); + ExFreePoolWithTag(MbrBuffer, TAG_FILE_SYSTEM); Offset.QuadPart = 512; }
Modified: trunk/reactos/ntoskrnl/fstub/fstubex.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fstub/fstubex.c?re... ============================================================================== --- trunk/reactos/ntoskrnl/fstub/fstubex.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fstub/fstubex.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -893,7 +893,7 @@ /* Allocate a buffer to read a sector on the disk */ Sector = ExAllocatePoolWithTag(NonPagedPool, Disk->SectorSize, - 'BtsF'); + TAG_FSTUB); if (!Sector) { DPRINT("EFI::Lacking resources!\n"); @@ -911,7 +911,7 @@ (PUSHORT)Sector); if (!NT_SUCCESS(Status)) { - ExFreePoolWithTag(Sector, 'BtsF'); + ExFreePoolWithTag(Sector, TAG_FSTUB); DPRINT("EFI::Failed reading sector for partition entry!\n"); return Status; } @@ -931,7 +931,7 @@ (PUSHORT)Sector); if (!NT_SUCCESS(Status)) { - ExFreePoolWithTag(Sector, 'BtsF'); + ExFreePoolWithTag(Sector, TAG_FSTUB); DPRINT("EFI::Failed reading sector for partition entry!\n"); return Status; } @@ -944,7 +944,7 @@ }
/* Finally, release memory */ - ExFreePoolWithTag(Sector, 'BtsF'); + ExFreePoolWithTag(Sector, TAG_FSTUB);
/* Compare checksums */ if (PreviousCRC32 == EFIHeader->PartitionEntryCRC32)
Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/n... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -59,6 +59,7 @@ #define KeReleaseGuardedMutexUnsafe _KeReleaseGuardedMutexUnsafe #define KeTryToAcquireGuardedMutex _KeTryToAcquireGuardedMutex
+#include "tag.h" #include "ke.h" #include "ob.h" #include "mm.h" @@ -83,7 +84,6 @@ #endif #include "dbgk.h" #include "spinlock.h" -#include "tag.h" #include "test.h" #include "inbv.h" #include "vdm.h"
Modified: trunk/reactos/ntoskrnl/include/internal/ob_x.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/o... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ob_x.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ob_x.h [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -136,7 +136,7 @@ if (HeaderNameInfo->Name.Buffer) { /* We can get rid of the object name now */ - ExFreePool(HeaderNameInfo->Name.Buffer); + ExFreePoolWithTag(HeaderNameInfo->Name.Buffer, OB_NAME_TAG); RtlInitEmptyUnicodeString(&HeaderNameInfo->Name, NULL, 0); }
Modified: trunk/reactos/ntoskrnl/include/internal/tag.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/t... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/tag.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/tag.h [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -8,10 +8,20 @@ /* formely located in include/callback.h */ #define CALLBACK_TAG 'KBLC'
+/* formely located in dbg/dbgkobj.c */ +#define TAG_DEBUG_EVENT 'EgbD' + /* formerly located in ex/resource.c */ #define TAG_RESOURCE_TABLE 'aTeR' #define TAG_RESOURCE_EVENT 'aTeR' #define TAG_RESOURCE_SEMAPHORE 'aTeR' + +/* formerly located in ex/handle.c */ +#define TAG_OBJECT_TABLE 'btbO' + +/* formerly located in ex/init.c */ +#define TAG_INIT 'tinI' +#define TAG_RTLI 'iltR'
/* formerly located in fs/notify.c */ #define FSRTL_NOTIFY_TAG 'ITON' @@ -92,6 +102,7 @@ #define TAG_DRIVER_MEM 'MVRD' /* drvm */ #define TAG_MODULE_OBJECT 'omlk' /* klmo - kernel ldr module object */ #define TAG_LDR_WSTR 'swlk' /* klws - kernel ldr wide string */ +#define TAG_LDR_IMPORTS 'klim' /* klim - kernel ldr imports */
/* formerly located in lpc/connect */ #define TAG_LPC_CONNECT_MESSAGE 'CCPL' @@ -101,6 +112,7 @@
/* formerly located in mm/marea.c */ #define TAG_MAREA 'ERAM' +#define TAG_MVAD 'VADM'
/* formerly located in mm/pageop.c */ #define TAG_MM_PAGEOP 'POPM' @@ -114,6 +126,9 @@ /* formerly located in mm/rmap.c */ #define TAG_RMAP 'PAMR'
+/* formerly located in mm/ARM3/section.c */ +#define TAG_MM ' mM' + /* formerly located in mm/section.c */ #define TAG_MM_SECTION_SEGMENT 'SSMM' #define TAG_SECTION_PAGE_TABLE 'TPSM' @@ -122,6 +137,9 @@ #define TAG_OBJECT_TYPE 'TjbO' #define TAG_SYMLINK_TTARGET 'TTYS' #define TAG_SYMLINK_TARGET 'TMYS' + +/* formerly located in ob/obsdcach.c */ +#define TAG_OB_SD_CACHE 'cSbO'
/* Object Manager Tags */ #define OB_NAME_TAG 'mNbO' @@ -153,6 +171,11 @@ /* formerly located in se/sd.c */ #define TAG_SD 'dSeS'
+/* formerly located in se/token.c */ +#define TAG_TOKEN_USERS 'uKOT' +#define TAG_TOKEN_PRIVILAGES 'pKOT' +#define TAG_TOKEN_ACL 'kDOT' + /* LPC Tags */ #define TAG_LPC_MESSAGE 'McpL' #define TAG_LPC_ZONE 'ZcpL'
Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?re... ============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -762,7 +762,7 @@ if (FileObject->FileName.Length) { /* Free it */ - ExFreePool(FileObject->FileName.Buffer); + ExFreePoolWithTag(FileObject->FileName.Buffer, TAG_IO_NAME); FileObject->FileName.Length = 0; }
@@ -868,7 +868,7 @@ }
/* Free our buffer */ - ExFreePool(FileBasicInfo); + ExFreePoolWithTag(FileBasicInfo, TAG_IO); } else { @@ -1331,7 +1331,7 @@ if (!NT_SUCCESS(Status) && (Status != STATUS_INFO_LENGTH_MISMATCH)) { /* Free the buffer and fail */ - ExFreePool(LocalInfo); + ExFreePoolWithTag(LocalInfo, TAG_IO); return Status; }
@@ -1375,7 +1375,7 @@ if (NT_ERROR(Status)) { /* Fail on errors only, allow warnings */ - ExFreePool(LocalInfo); + ExFreePoolWithTag(LocalInfo, TAG_IO); return Status; }
@@ -1386,7 +1386,7 @@ *ReturnLength += LocalFileInfo->FileNameLength;
/* Free the allocated buffer and return failure */ - ExFreePool(LocalInfo); + ExFreePoolWithTag(LocalInfo, TAG_IO); return STATUS_BUFFER_OVERFLOW; }
@@ -1414,7 +1414,7 @@ sizeof(UNICODE_NULL);
/* Free buffer and return */ - ExFreePool(LocalInfo); + ExFreePoolWithTag(LocalInfo, TAG_IO); return Status; }
@@ -1908,7 +1908,7 @@ if (OpenPacket.FileObject->FileName.Length) { /* It had a name, free it */ - ExFreePool(OpenPacket.FileObject->FileName.Buffer); + ExFreePoolWithTag(OpenPacket.FileObject->FileName.Buffer, TAG_IO_NAME); }
/* Clear the device object to invalidate the FO, and dereference */
Modified: trunk/reactos/ntoskrnl/mm/ARM3/contmem.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/contmem.c?... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/contmem.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/contmem.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -430,7 +430,7 @@ // // No such luck // - ExFreePool(BaseAddress); + ExFreePoolWithTag(BaseAddress, 'mCmM'); } }
@@ -472,7 +472,7 @@ // // It did, so just use the pool to free this // - ExFreePool(BaseAddress); + ExFreePoolWithTag(BaseAddress, 'mCmM'); return; }
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -1087,7 +1087,7 @@ FALSE); CleanUp: /* Free the DACL */ - ExFreePool(Dacl); + ExFreePoolWithTag(Dacl, 'lcaD');
/* Check if this is the success path */ if (NT_SUCCESS(Status)) @@ -1533,7 +1533,7 @@ RtlCopyMemory(NewBuffer->Run, Buffer->Run, sizeof(PHYSICAL_MEMORY_RUN) * Run); - ExFreePool(Buffer); + ExFreePoolWithTag(Buffer, 'lMmM');
// // Now use the new buffer
Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c?... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -177,7 +177,7 @@ BitmapSize = sizeof(RTL_BITMAP) + ((((MmSystemViewSize / MI_SYSTEM_VIEW_BUCKET_SIZE) + 31) / 32) * sizeof(ULONG)); Session->SystemSpaceBitMap = ExAllocatePoolWithTag(NonPagedPool, BitmapSize, - ' mM'); + TAG_MM); ASSERT(Session->SystemSpaceBitMap); RtlInitializeBitMap(Session->SystemSpaceBitMap, (PULONG)(Session->SystemSpaceBitMap + 1), @@ -198,7 +198,7 @@ /* Allocate and zero the view table */ Session->SystemSpaceViewTable = ExAllocatePoolWithTag(NonPagedPool, AllocSize, - ' mM'); + TAG_MM); ASSERT(Session->SystemSpaceViewTable != NULL); RtlZeroMemory(Session->SystemSpaceViewTable, AllocSize);
@@ -948,7 +948,7 @@ ULONG ReturnLength;
/* Allocate memory for our structure */ - ObjectNameInfo = ExAllocatePoolWithTag(PagedPool, 1024, ' mM'); + ObjectNameInfo = ExAllocatePoolWithTag(PagedPool, 1024, TAG_MM); if (!ObjectNameInfo) return STATUS_NO_MEMORY;
/* Query the name */ @@ -960,7 +960,7 @@ { /* Failed, free memory */ DPRINT1("Name query failed\n"); - ExFreePoolWithTag(ObjectNameInfo, ' mM'); + ExFreePoolWithTag(ObjectNameInfo, TAG_MM); *ModuleName = NULL; return Status; } @@ -1088,7 +1088,7 @@ ModuleNameInformation->Name.Buffer);
/* Free temp taged buffer from MmGetFileNameForFileObject() */ - ExFreePoolWithTag(ModuleNameInformation, ' mM'); + ExFreePoolWithTag(ModuleNameInformation, TAG_MM); DPRINT("Found ModuleName %S by address %p\n", ModuleName->Buffer, Address); }
Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -336,7 +336,7 @@ Status = DllInit(&RegPath);
/* Clean up */ - ExFreePool(RegPath.Buffer); + ExFreePoolWithTag(RegPath.Buffer, TAG_LDR_WSTR);
/* Return status value which DllInitialize returned */ return Status; @@ -427,7 +427,7 @@ !((ULONG_PTR)LdrEntry->LoadedImports & MM_SYSLDR_SINGLE_ENTRY)) { /* Free them */ - ExFreePool(CurrentImports); + ExFreePoolWithTag(CurrentImports, TAG_LDR_IMPORTS); } } else @@ -458,7 +458,7 @@ }
/* Otherwise, free the import list */ - ExFreePool(LdrEntry->LoadedImports); + ExFreePoolWithTag(LdrEntry->LoadedImports, TAG_LDR_IMPORTS); LdrEntry->LoadedImports = MM_SYSLDR_BOOT_LOADED; }
@@ -948,7 +948,7 @@ if (LdrEntry->FullDllName.Buffer) { /* Free it */ - ExFreePool(LdrEntry->FullDllName.Buffer); + ExFreePoolWithTag(LdrEntry->FullDllName.Buffer, TAG_LDR_WSTR); }
/* Check if we had a section */ @@ -959,7 +959,7 @@ }
/* Free the entry */ - ExFreePool(LdrEntry); + ExFreePoolWithTag(LdrEntry, TAG_MODULE_OBJECT); }
/* Release the system lock and return */ @@ -1022,7 +1022,7 @@ LoadedImportsSize = ImportCount * sizeof(PVOID) + sizeof(SIZE_T); LoadedImports = ExAllocatePoolWithTag(PagedPool, LoadedImportsSize, - 'TDmM'); + TAG_LDR_IMPORTS); if (LoadedImports) { /* Zero it */ @@ -1059,7 +1059,7 @@ { /* It's not, it's importing stuff it shouldn't be! */ MiDereferenceImports(LoadedImports); - if (LoadedImports) ExFreePoolWithTag(LoadedImports, 'TDmM'); + if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_IMPORTS); return STATUS_PROCEDURE_NOT_FOUND; }
@@ -1073,7 +1073,7 @@ { /* This is not kernel code */ MiDereferenceImports(LoadedImports); - if (LoadedImports) ExFreePoolWithTag(LoadedImports, 'TDmM'); + if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_IMPORTS); return STATUS_PROCEDURE_NOT_FOUND; }
@@ -1098,7 +1098,7 @@ { /* Failed */ MiDereferenceImports(LoadedImports); - if (LoadedImports) ExFreePoolWithTag(LoadedImports, 'TDmM'); + if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_IMPORTS); return Status; }
@@ -1153,7 +1153,7 @@ sizeof(UNICODE_NULL); DllName.Buffer = ExAllocatePoolWithTag(NonPagedPool, DllName.MaximumLength, - 'TDmM'); + TAG_LDR_WSTR); if (DllName.Buffer) { /* Setup the base length and copy it */ @@ -1177,7 +1177,7 @@ if (NT_SUCCESS(Status)) { /* We can free the DLL Name */ - ExFreePool(DllName.Buffer); + ExFreePoolWithTag(DllName.Buffer, TAG_LDR_WSTR); } else { @@ -1219,7 +1219,7 @@ /* Cleanup and return */ RtlFreeUnicodeString(&NameString); MiDereferenceImports(LoadedImports); - if (LoadedImports) ExFreePoolWithTag(LoadedImports, 'TDmM'); + if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_IMPORTS); return Status; }
@@ -1252,7 +1252,7 @@ { /* Cleanup and return */ MiDereferenceImports(LoadedImports); - if (LoadedImports) ExFreePoolWithTag(LoadedImports, 'TDmM'); + if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_IMPORTS); DPRINT1("Warning: Driver failed to load, %S not found\n", *MissingDriver); return STATUS_DRIVER_ENTRYPOINT_NOT_FOUND; } @@ -1282,7 +1282,7 @@ { /* Cleanup and return */ MiDereferenceImports(LoadedImports); - if (LoadedImports) ExFreePoolWithTag(LoadedImports, 'TDmM'); + if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_IMPORTS); return Status; }
@@ -1315,13 +1315,13 @@ if (!ImportCount) { /* Free the list and set it to no imports */ - ExFreePoolWithTag(LoadedImports, 'TDmM'); + ExFreePoolWithTag(LoadedImports, TAG_LDR_IMPORTS); LoadedImports = MM_SYSLDR_NO_IMPORTS; } else if (ImportCount == 1) { /* Just one entry, we can free the table and only use our entry */ - ExFreePoolWithTag(LoadedImports, 'TDmM'); + ExFreePoolWithTag(LoadedImports, TAG_LDR_IMPORTS); LoadedImports = (PLOAD_IMPORTS)ImportEntry; } else if (ImportCount != LoadedImports->Count) @@ -1330,7 +1330,7 @@ LoadedImportsSize = ImportCount * sizeof(PVOID) + sizeof(SIZE_T); NewImports = ExAllocatePoolWithTag(PagedPool, LoadedImportsSize, - 'TDmM'); + TAG_LDR_IMPORTS); if (NewImports) { /* Set count */ @@ -1349,7 +1349,7 @@ }
/* Free the old copy */ - ExFreePoolWithTag(LoadedImports, 'TDmM'); + ExFreePoolWithTag(LoadedImports, TAG_LDR_IMPORTS); LoadedImports = NewImports; } } @@ -1625,7 +1625,7 @@ if (!(HalEntry) || (!KernelEntry)) return STATUS_NOT_FOUND;
/* Allocate the list */ - EntryArray = ExAllocatePoolWithTag(PagedPool, Modules * sizeof(PVOID), 'TDmM'); + EntryArray = ExAllocatePoolWithTag(PagedPool, Modules * sizeof(PVOID), TAG_LDR_IMPORTS); if (!EntryArray) return STATUS_INSUFFICIENT_RESOURCES;
/* Loop the loaded module list again */ @@ -1773,7 +1773,7 @@ LoadedImportsSize = ImportSize * sizeof(PVOID) + sizeof(SIZE_T); LoadedImports = ExAllocatePoolWithTag(PagedPool, LoadedImportsSize, - 'TDmM'); + TAG_LDR_IMPORTS); ASSERT(LoadedImports);
/* Save the count */ @@ -1805,7 +1805,7 @@ }
/* Free the initial array */ - ExFreePool(EntryArray); + ExFreePoolWithTag(EntryArray, TAG_LDR_IMPORTS);
/* FIXME: Might not need to keep the HAL/Kernel imports around */
@@ -1923,7 +1923,7 @@ EntrySize = sizeof(LDR_DATA_TABLE_ENTRY) + LdrEntry->BaseDllName.MaximumLength + sizeof(UNICODE_NULL); - NewEntry = ExAllocatePoolWithTag(NonPagedPool, EntrySize, TAG_LDR_WSTR); + NewEntry = ExAllocatePoolWithTag(NonPagedPool, EntrySize, TAG_MODULE_OBJECT); if (!NewEntry) return FALSE;
/* Copy the entry over */ @@ -2561,7 +2561,7 @@ }
/* Allocate a buffer we'll use for names */ - Buffer = ExAllocatePoolWithTag(NonPagedPool, MAX_PATH, 'nLmM'); + Buffer = ExAllocatePoolWithTag(NonPagedPool, MAX_PATH, TAG_LDR_WSTR); if (!Buffer) return STATUS_INSUFFICIENT_RESOURCES;
/* Check for a separator */ @@ -2906,7 +2906,7 @@ if (LdrEntry->FullDllName.Buffer) { /* Free it */ - ExFreePool(LdrEntry->FullDllName.Buffer); + ExFreePoolWithTag(LdrEntry->FullDllName.Buffer, TAG_LDR_WSTR); }
/* Free the entry itself */ @@ -3004,7 +3004,7 @@ /* if (NamePrefix) ExFreePool(PrefixName.Buffer); */
/* Free the name buffer and return status */ - ExFreePoolWithTag(Buffer, 'nLmM'); + ExFreePoolWithTag(Buffer, TAG_LDR_WSTR); return Status; }
Modified: trunk/reactos/ntoskrnl/mm/marea.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=520... ============================================================================== --- trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -377,7 +377,7 @@ PMMVAD Vad;
ASSERT(marea->Type == MEMORY_AREA_VIRTUAL_MEMORY || marea->Type == MEMORY_AREA_SECTION_VIEW); - Vad = ExAllocatePoolWithTag(NonPagedPool, sizeof(MMVAD), 'Fake'); + Vad = ExAllocatePoolWithTag(NonPagedPool, sizeof(MMVAD), TAG_MVAD); ASSERT(Vad); RtlZeroMemory(Vad, sizeof(MMVAD)); Vad->StartingVpn = PAGE_ROUND_DOWN(marea->StartingAddress) >> PAGE_SHIFT; @@ -776,7 +776,7 @@ MiRemoveNode(MemoryArea->Vad, &Process->VadRoot); }
- ExFreePool(MemoryArea->Vad); + ExFreePoolWithTag(MemoryArea->Vad, TAG_MVAD); MemoryArea->Vad = NULL; } }
Modified: trunk/reactos/ntoskrnl/ob/obname.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obname.c?rev=52... ============================================================================== --- trunk/reactos/ntoskrnl/ob/obname.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ob/obname.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -694,7 +694,7 @@ ObjectHeader))) { /* Either couldn't allocate the name, or insert failed */ - if (NewName) ExFreePool(NewName); + if (NewName) ExFreePoolWithTag(NewName, OB_NAME_TAG);
/* Fail due to memory reasons */ Status = STATUS_INSUFFICIENT_RESOURCES;
Modified: trunk/reactos/ntoskrnl/ob/obsdcach.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obsdcach.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/ob/obsdcach.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ob/obsdcach.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -132,7 +132,7 @@
/* Calculate the memory we'll need to allocate and allocate it */ CacheSize = Length + (sizeof(SECURITY_DESCRIPTOR_HEADER) - sizeof(QUAD)); - SdHeader = ExAllocatePoolWithTag(PagedPool, CacheSize, 'cSbO'); + SdHeader = ExAllocatePoolWithTag(PagedPool, CacheSize, TAG_OB_SD_CACHE); if (!SdHeader) return NULL;
/* Setup the header */
Modified: trunk/reactos/ntoskrnl/se/acl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/acl.c?rev=52043... ============================================================================== --- trunk/reactos/ntoskrnl/se/acl.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/acl.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -311,7 +311,7 @@ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { /* Free the ACL and return the exception code */ - ExFreePool(NewAcl); + ExFreePoolWithTag(NewAcl, TAG_ACL); _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; @@ -361,7 +361,7 @@ (AccessMode != KernelMode || (AccessMode == KernelMode && CaptureIfKernel))) { - ExFreePool(CapturedAcl); + ExFreePoolWithTag(CapturedAcl, TAG_ACL); } }
Modified: trunk/reactos/ntoskrnl/se/sd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/sd.c?rev=52043&... ============================================================================== --- trunk/reactos/ntoskrnl/se/sd.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/sd.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -686,7 +686,7 @@ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { /* We failed to copy the data to the new descriptor */ - ExFreePool(NewDescriptor); + ExFreePoolWithTag(NewDescriptor, TAG_SD); _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; @@ -1248,7 +1248,7 @@
if (*SecurityDescriptor != NULL) { - ExFreePool(*SecurityDescriptor); + ExFreePoolWithTag(*SecurityDescriptor, TAG_SD); *SecurityDescriptor = NULL; }
Modified: trunk/reactos/ntoskrnl/se/sid.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/sid.c?rev=52043... ============================================================================== --- trunk/reactos/ntoskrnl/se/sid.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/sid.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -60,34 +60,34 @@ NTAPI FreeInitializedSids(VOID) { - if (SeNullSid) ExFreePool(SeNullSid); - if (SeWorldSid) ExFreePool(SeWorldSid); - if (SeLocalSid) ExFreePool(SeLocalSid); - if (SeCreatorOwnerSid) ExFreePool(SeCreatorOwnerSid); - if (SeCreatorGroupSid) ExFreePool(SeCreatorGroupSid); - if (SeCreatorOwnerServerSid) ExFreePool(SeCreatorOwnerServerSid); - if (SeCreatorGroupServerSid) ExFreePool(SeCreatorGroupServerSid); - if (SeNtAuthoritySid) ExFreePool(SeNtAuthoritySid); - if (SeDialupSid) ExFreePool(SeDialupSid); - if (SeNetworkSid) ExFreePool(SeNetworkSid); - if (SeBatchSid) ExFreePool(SeBatchSid); - if (SeInteractiveSid) ExFreePool(SeInteractiveSid); - if (SeServiceSid) ExFreePool(SeServiceSid); - if (SePrincipalSelfSid) ExFreePool(SePrincipalSelfSid); - if (SeLocalSystemSid) ExFreePool(SeLocalSystemSid); - if (SeAuthenticatedUserSid) ExFreePool(SeAuthenticatedUserSid); - if (SeRestrictedCodeSid) ExFreePool(SeRestrictedCodeSid); - if (SeAliasAdminsSid) ExFreePool(SeAliasAdminsSid); - if (SeAliasUsersSid) ExFreePool(SeAliasUsersSid); - if (SeAliasGuestsSid) ExFreePool(SeAliasGuestsSid); - if (SeAliasPowerUsersSid) ExFreePool(SeAliasPowerUsersSid); - if (SeAliasAccountOpsSid) ExFreePool(SeAliasAccountOpsSid); - if (SeAliasSystemOpsSid) ExFreePool(SeAliasSystemOpsSid); - if (SeAliasPrintOpsSid) ExFreePool(SeAliasPrintOpsSid); - if (SeAliasBackupOpsSid) ExFreePool(SeAliasBackupOpsSid); - if (SeAuthenticatedUsersSid) ExFreePool(SeAuthenticatedUsersSid); - if (SeRestrictedSid) ExFreePool(SeRestrictedSid); - if (SeAnonymousLogonSid) ExFreePool(SeAnonymousLogonSid); + if (SeNullSid) ExFreePoolWithTag(SeNullSid, TAG_SID); + if (SeWorldSid) ExFreePoolWithTag(SeWorldSid, TAG_SID); + if (SeLocalSid) ExFreePoolWithTag(SeLocalSid, TAG_SID); + if (SeCreatorOwnerSid) ExFreePoolWithTag(SeCreatorOwnerSid, TAG_SID); + if (SeCreatorGroupSid) ExFreePoolWithTag(SeCreatorGroupSid, TAG_SID); + if (SeCreatorOwnerServerSid) ExFreePoolWithTag(SeCreatorOwnerServerSid, TAG_SID); + if (SeCreatorGroupServerSid) ExFreePoolWithTag(SeCreatorGroupServerSid, TAG_SID); + if (SeNtAuthoritySid) ExFreePoolWithTag(SeNtAuthoritySid, TAG_SID); + if (SeDialupSid) ExFreePoolWithTag(SeDialupSid, TAG_SID); + if (SeNetworkSid) ExFreePoolWithTag(SeNetworkSid, TAG_SID); + if (SeBatchSid) ExFreePoolWithTag(SeBatchSid, TAG_SID); + if (SeInteractiveSid) ExFreePoolWithTag(SeInteractiveSid, TAG_SID); + if (SeServiceSid) ExFreePoolWithTag(SeServiceSid, TAG_SID); + if (SePrincipalSelfSid) ExFreePoolWithTag(SePrincipalSelfSid, TAG_SID); + if (SeLocalSystemSid) ExFreePoolWithTag(SeLocalSystemSid, TAG_SID); + if (SeAuthenticatedUserSid) ExFreePoolWithTag(SeAuthenticatedUserSid, TAG_SID); + if (SeRestrictedCodeSid) ExFreePoolWithTag(SeRestrictedCodeSid, TAG_SID); + if (SeAliasAdminsSid) ExFreePoolWithTag(SeAliasAdminsSid, TAG_SID); + if (SeAliasUsersSid) ExFreePoolWithTag(SeAliasUsersSid, TAG_SID); + if (SeAliasGuestsSid) ExFreePoolWithTag(SeAliasGuestsSid, TAG_SID); + if (SeAliasPowerUsersSid) ExFreePoolWithTag(SeAliasPowerUsersSid, TAG_SID); + if (SeAliasAccountOpsSid) ExFreePoolWithTag(SeAliasAccountOpsSid, TAG_SID); + if (SeAliasSystemOpsSid) ExFreePoolWithTag(SeAliasSystemOpsSid, TAG_SID); + if (SeAliasPrintOpsSid) ExFreePoolWithTag(SeAliasPrintOpsSid, TAG_SID); + if (SeAliasBackupOpsSid) ExFreePoolWithTag(SeAliasBackupOpsSid, TAG_SID); + if (SeAuthenticatedUsersSid) ExFreePoolWithTag(SeAuthenticatedUsersSid, TAG_SID); + if (SeRestrictedSid) ExFreePoolWithTag(SeRestrictedSid, TAG_SID); + if (SeAnonymousLogonSid) ExFreePoolWithTag(SeAnonymousLogonSid, TAG_SID); }
BOOLEAN @@ -306,7 +306,7 @@ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { /* Free the SID and return the exception code */ - ExFreePool(NewSid); + ExFreePoolWithTag(NewSid, TAG_SID); _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; @@ -357,7 +357,7 @@ (AccessMode != KernelMode || (AccessMode == KernelMode && CaptureIfKernel))) { - ExFreePool(CapturedSid); + ExFreePoolWithTag(CapturedSid, TAG_SID); } }
Modified: trunk/reactos/ntoskrnl/se/token.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/token.c?rev=520... ============================================================================== --- trunk/reactos/ntoskrnl/se/token.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/token.c [iso-8859-1] Wed Jun 1 13:39:36 2011 @@ -293,7 +293,7 @@ AccessToken->UserAndGroups = (PSID_AND_ATTRIBUTES)ExAllocatePoolWithTag(PagedPool, uLength, - 'uKOT'); + TAG_TOKEN_USERS);
EndMem = &AccessToken->UserAndGroups[AccessToken->UserAndGroupCount];
@@ -320,7 +320,7 @@ AccessToken->Privileges = (PLUID_AND_ATTRIBUTES)ExAllocatePoolWithTag(PagedPool, uLength, - 'pKOT'); + TAG_TOKEN_PRIVILAGES);
for (i = 0; i < AccessToken->PrivilegeCount; i++) { @@ -335,7 +335,7 @@ AccessToken->DefaultDacl = (PACL) ExAllocatePoolWithTag(PagedPool, Token->DefaultDacl->AclSize, - 'kDOT'); + TAG_TOKEN_ACL); memcpy(AccessToken->DefaultDacl, Token->DefaultDacl, Token->DefaultDacl->AclSize); @@ -460,13 +460,13 @@ PTOKEN AccessToken = (PTOKEN)ObjectBody;
if (AccessToken->UserAndGroups) - ExFreePool(AccessToken->UserAndGroups); + ExFreePoolWithTag(AccessToken->UserAndGroups, TAG_TOKEN_USERS);
if (AccessToken->Privileges) - ExFreePool(AccessToken->Privileges); + ExFreePoolWithTag(AccessToken->Privileges, TAG_TOKEN_PRIVILAGES);
if (AccessToken->DefaultDacl) - ExFreePool(AccessToken->DefaultDacl); + ExFreePoolWithTag(AccessToken->DefaultDacl, TAG_TOKEN_ACL); }
@@ -639,7 +639,7 @@ AccessToken->UserAndGroups = (PSID_AND_ATTRIBUTES)ExAllocatePoolWithTag(PagedPool, uLength, - 'uKOT'); + TAG_TOKEN_USERS);
EndMem = &AccessToken->UserAndGroups[AccessToken->UserAndGroupCount];
@@ -675,7 +675,7 @@ AccessToken->Privileges = (PLUID_AND_ATTRIBUTES)ExAllocatePoolWithTag(PagedPool, uLength, - 'pKOT'); + TAG_TOKEN_PRIVILAGES);
if (PreviousMode != KernelMode) { @@ -704,7 +704,7 @@ AccessToken->DefaultDacl = (PACL) ExAllocatePoolWithTag(PagedPool, DefaultDacl->AclSize, - 'kDOT'); + TAG_TOKEN_ACL); memcpy(AccessToken->DefaultDacl, DefaultDacl, DefaultDacl->AclSize); @@ -1720,7 +1720,7 @@ /* Free the previous dacl if present */ if(Token->DefaultDacl != NULL) { - ExFreePool(Token->DefaultDacl); + ExFreePoolWithTag(Token->DefaultDacl, TAG_TOKEN_ACL); }
/* Set the new dacl */ @@ -1732,7 +1732,7 @@ /* Clear and free the default dacl if present */ if (Token->DefaultDacl != NULL) { - ExFreePool(Token->DefaultDacl); + ExFreePoolWithTag(Token->DefaultDacl, TAG_TOKEN_ACL); Token->DefaultDacl = NULL; } } @@ -2478,7 +2478,7 @@ PreviousMode, &hToken); }
- if (Dacl) ExFreePool(Dacl); + if (Dacl) ExFreePoolWithTag(Dacl, TAG_TOKEN_ACL);
if (OpenAsSelf) {