mirror of
https://github.com/reactos/reactos.git
synced 2025-01-21 02:53:30 +08:00
Replace some ExFreePool by ExFreePoolWithTag
svn path=/trunk/; revision=35834
This commit is contained in:
parent
56c56ab228
commit
d2ba8bac96
@ -62,7 +62,7 @@ CmpFreeKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
|
||||
if (!Kcb->PrivateAlloc)
|
||||
{
|
||||
/* Free it from the pool */
|
||||
ExFreePool(Kcb);
|
||||
ExFreePoolWithTag(Kcb, TAG_CM);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ CmpFreeKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
|
||||
}
|
||||
|
||||
/* Free the page */
|
||||
ExFreePool(AllocPage);
|
||||
ExFreePoolWithTag(AllocPage, TAG_CM);
|
||||
}
|
||||
|
||||
/* Release the lock */
|
||||
@ -296,7 +296,7 @@ CmpFreeDelayItem(PVOID Entry)
|
||||
}
|
||||
|
||||
/* Now free the page */
|
||||
ExFreePool(AllocPage);
|
||||
ExFreePoolWithTag(AllocPage, TAG_CM);
|
||||
}
|
||||
|
||||
/* Release the lock */
|
||||
|
@ -386,7 +386,7 @@ CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||
}
|
||||
|
||||
/* Close our handle, free the buffer and return status */
|
||||
ExFreePool(CmpConfigurationData);
|
||||
ExFreePoolWithTag(CmpConfigurationData, TAG_CM);
|
||||
NtClose(KeyHandle);
|
||||
return Status;
|
||||
}
|
||||
|
@ -129,8 +129,8 @@ CmpHiveRootSecurityDescriptor(VOID)
|
||||
if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 8, Status, 0);
|
||||
|
||||
/* Free the SIDs and original ACL */
|
||||
for (i = 0; i < 4; i++) ExFreePool(Sid[i]);
|
||||
ExFreePool(Acl);
|
||||
for (i = 0; i < 4; i++) ExFreePoolWithTag(Sid[i], TAG_CM);
|
||||
ExFreePoolWithTag(Acl, TAG_CM);
|
||||
|
||||
/* Return the security descriptor */
|
||||
return SecurityDescriptor;
|
||||
|
@ -804,7 +804,7 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||
SecurityDescriptor);
|
||||
|
||||
/* Free the security descriptor */
|
||||
ExFreePool(SecurityDescriptor);
|
||||
ExFreePoolWithTag(SecurityDescriptor, TAG_CM);
|
||||
if (!NT_SUCCESS(Status)) return FALSE;
|
||||
|
||||
/* Add the hive to the hive list */
|
||||
@ -944,7 +944,7 @@ CmpCreateRegistryRoot(VOID)
|
||||
0,
|
||||
0,
|
||||
(PVOID*)&RootKey);
|
||||
ExFreePool(SecurityDescriptor);
|
||||
ExFreePoolWithTag(SecurityDescriptor, TAG_CM);
|
||||
if (!NT_SUCCESS(Status)) return FALSE;
|
||||
|
||||
/* Sanity check, and get the key cell */
|
||||
@ -1041,7 +1041,7 @@ CmpGetRegistryPath(IN PWCHAR ConfigPath)
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Fail */
|
||||
ExFreePool(ValueInfo);
|
||||
ExFreePoolWithTag(ValueInfo, TAG_CM);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -1050,7 +1050,7 @@ CmpGetRegistryPath(IN PWCHAR ConfigPath)
|
||||
ValueInfo->Data,
|
||||
ValueInfo->DataLength);
|
||||
ConfigPath[ValueInfo->DataLength / sizeof(WCHAR)] = UNICODE_NULL;
|
||||
ExFreePool(ValueInfo);
|
||||
ExFreePoolWithTag(ValueInfo, TAG_CM);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1356,7 +1356,7 @@ CmpInitializeHiveList(IN USHORT Flag)
|
||||
}
|
||||
|
||||
/* Get rid of the SD */
|
||||
ExFreePool(SecurityDescriptor);
|
||||
ExFreePoolWithTag(SecurityDescriptor, TAG_CM);
|
||||
|
||||
/* FIXME: Link SECURITY to SAM */
|
||||
|
||||
@ -1541,7 +1541,7 @@ CmInitSystem1(VOID)
|
||||
/* FIXME: Add to HiveList key */
|
||||
|
||||
/* Free the security descriptor */
|
||||
ExFreePool(SecurityDescriptor);
|
||||
ExFreePoolWithTag(SecurityDescriptor, TAG_CM);
|
||||
|
||||
/* Fill out the Hardware key with the ARC Data from the Loader */
|
||||
Status = CmpInitializeHardwareConfiguration(KeLoaderBlock);
|
||||
@ -1568,7 +1568,7 @@ CmInitSystem1(VOID)
|
||||
}
|
||||
|
||||
/* Free the load options */
|
||||
ExFreePool(CmpLoadOptions.Buffer);
|
||||
ExFreePoolWithTag(CmpLoadOptions.Buffer, TAG_CM);
|
||||
|
||||
/* If we got here, all went well */
|
||||
return TRUE;
|
||||
|
@ -546,7 +546,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc
|
||||
}
|
||||
|
||||
/* Free the configuration data */
|
||||
ExFreePool(CmpConfigurationData);
|
||||
ExFreePoolWithTag(CmpConfigurationData, TAG_CM);
|
||||
}
|
||||
|
||||
/* Open physical memory */
|
||||
@ -824,7 +824,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc
|
||||
ZwClose(SectionHandle);
|
||||
|
||||
/* Free the BIOS version string buffer */
|
||||
if (BiosVersion) ExFreePool(BiosVersion);
|
||||
if (BiosVersion) ExFreePoolWithTag(BiosVersion, TAG_CM);
|
||||
|
||||
Quickie:
|
||||
/* Close the procesor handle */
|
||||
|
@ -324,7 +324,7 @@ ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||
RtlCopyMemory(SectionBase, ExpNlsTableBase, ExpNlsTableSize);
|
||||
|
||||
/* Free the previously allocated buffer and set the new location */
|
||||
ExFreePool(ExpNlsTableBase);
|
||||
ExFreePoolWithTag(ExpNlsTableBase, TAG('R', 't', 'l', 'i'));
|
||||
ExpNlsTableBase = SectionBase;
|
||||
|
||||
/* Initialize the NLS Tables */
|
||||
|
@ -948,7 +948,7 @@ HalpGetFullGeometry(IN PDEVICE_OBJECT DeviceObject,
|
||||
if (!Irp)
|
||||
{
|
||||
/* Fail, free the event */
|
||||
ExFreePool(Event);
|
||||
ExFreePoolWithTag(Event, TAG_FILE_SYSTEM);
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
@ -977,7 +977,7 @@ HalpGetFullGeometry(IN PDEVICE_OBJECT DeviceObject,
|
||||
if (!Irp)
|
||||
{
|
||||
/* Fail, free the event */
|
||||
ExFreePool(Event);
|
||||
ExFreePoolWithTag(Event, TAG_FILE_SYSTEM);
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
@ -1000,7 +1000,7 @@ HalpGetFullGeometry(IN PDEVICE_OBJECT DeviceObject,
|
||||
}
|
||||
|
||||
/* Free the event and return the Status */
|
||||
ExFreePool(Event);
|
||||
ExFreePoolWithTag(Event, TAG_FILE_SYSTEM);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -1200,7 +1200,7 @@ xHalGetPartialGeometry(IN PDEVICE_OBJECT DeviceObject,
|
||||
|
||||
Cleanup:
|
||||
/* Free all the pointers */
|
||||
if (Event) ExFreePool(Event);
|
||||
if (Event) ExFreePoolWithTag(Event, TAG_FILE_SYSTEM);
|
||||
if (IoStatusBlock) ExFreePool(IoStatusBlock);
|
||||
if (DiskGeometry) ExFreePool(DiskGeometry);
|
||||
return;
|
||||
@ -1251,7 +1251,7 @@ xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
|
||||
if (!Irp)
|
||||
{
|
||||
/* Failed */
|
||||
ExFreePool(Buffer);
|
||||
ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1275,7 +1275,7 @@ xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
|
||||
if (((PUSHORT)Buffer)[BOOT_SIGNATURE_OFFSET] != BOOT_RECORD_SIGNATURE)
|
||||
{
|
||||
/* Failed */
|
||||
ExFreePool(Buffer);
|
||||
ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1287,7 +1287,7 @@ xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject,
|
||||
if (PartitionDescriptor->PartitionType != MbrTypeIdentifier)
|
||||
{
|
||||
/* It's not, free our buffer */
|
||||
ExFreePool(Buffer);
|
||||
ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1367,7 +1367,7 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
|
||||
Status = HalpGetFullGeometry(DeviceObject, &DiskGeometry, &MaxOffset);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ExFreePool(*PartitionBuffer);
|
||||
ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM);
|
||||
*PartitionBuffer = NULL;
|
||||
return Status;
|
||||
}
|
||||
@ -1383,7 +1383,8 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
|
||||
if (!Buffer)
|
||||
{
|
||||
/* Fail, free the input buffer */
|
||||
ExFreePool(*PartitionBuffer);
|
||||
ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM);
|
||||
*PartitionBuffer = NULL;
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
@ -1549,7 +1550,7 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
|
||||
BufferSize);
|
||||
|
||||
/* Free the old buffer and set this one as the new one */
|
||||
ExFreePool(*PartitionBuffer);
|
||||
ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM);
|
||||
*PartitionBuffer = DriveLayoutInfo;
|
||||
|
||||
/* Double the size */
|
||||
@ -1732,8 +1733,8 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
|
||||
if (!i) (*PartitionBuffer)->Signature = 0;
|
||||
|
||||
/* Free the buffer and check for success */
|
||||
if (Buffer) ExFreePool(Buffer);
|
||||
if (!NT_SUCCESS(Status)) ExFreePool(*PartitionBuffer);
|
||||
if (Buffer) ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM);
|
||||
if (!NT_SUCCESS(Status)) ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM);
|
||||
|
||||
/* Return status */
|
||||
return Status;
|
||||
@ -2212,7 +2213,7 @@ xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
|
||||
}
|
||||
|
||||
/* If we had a buffer, free it, then return status */
|
||||
if (Buffer) ExFreePool(Buffer);
|
||||
if (Buffer) ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@ -242,8 +242,8 @@ IopGetDiskInformation(IN ULONG i,
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Try again */
|
||||
ExFreePool(PartitionBuffer);
|
||||
ExFreePool(DriveLayout);
|
||||
ExFreePoolWithTag(PartitionBuffer, TAG_IO);
|
||||
ExFreePoolWithTag(DriveLayout, TAG_FILE_SYSTEM);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -257,8 +257,8 @@ IopGetDiskInformation(IN ULONG i,
|
||||
*PartitionCount = DriveLayout->PartitionCount;
|
||||
|
||||
/* Free the buffer */
|
||||
ExFreePool(PartitionBuffer);
|
||||
ExFreePool(DriveLayout);
|
||||
ExFreePoolWithTag(PartitionBuffer, TAG_IO);
|
||||
ExFreePoolWithTag(DriveLayout, TAG_FILE_SYSTEM);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -574,7 +574,7 @@ IopCreateArcNames(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||
}
|
||||
|
||||
/* Free the buffer */
|
||||
ExFreePool(PartitionBuffer);
|
||||
ExFreePoolWithTag(PartitionBuffer, TAG_IO);
|
||||
}
|
||||
|
||||
/* Return success */
|
||||
|
@ -122,7 +122,7 @@ IoShutdownRegisteredDevices(VOID)
|
||||
}
|
||||
|
||||
/* Free the shutdown entry and reset the event */
|
||||
ExFreePool(ShutdownEntry);
|
||||
ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY);
|
||||
KeClearEvent(&Event);
|
||||
|
||||
/* Go to the next entry */
|
||||
@ -317,7 +317,7 @@ IopUnloadDevice(IN PDEVICE_OBJECT DeviceObject)
|
||||
if (DeviceObject->SecurityDescriptor)
|
||||
{
|
||||
/* Free it */
|
||||
ExFreePool(DeviceObject->SecurityDescriptor);
|
||||
ExFreePoolWithTag(DeviceObject->SecurityDescriptor, TAG_SD);
|
||||
}
|
||||
|
||||
/* Remove the device from the list */
|
||||
@ -1328,7 +1328,7 @@ IoUnregisterShutdownNotification(PDEVICE_OBJECT DeviceObject)
|
||||
NextEntry = NextEntry->Blink;
|
||||
|
||||
/* Free the entry */
|
||||
ExFreePool(ShutdownEntry);
|
||||
ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY);
|
||||
}
|
||||
|
||||
/* Go to the next entry */
|
||||
@ -1352,7 +1352,7 @@ IoUnregisterShutdownNotification(PDEVICE_OBJECT DeviceObject)
|
||||
NextEntry = NextEntry->Blink;
|
||||
|
||||
/* Free the entry */
|
||||
ExFreePool(ShutdownEntry);
|
||||
ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY);
|
||||
}
|
||||
|
||||
/* Go to the next entry */
|
||||
|
@ -29,6 +29,8 @@ UNICODE_STRING IopHardwareDatabaseKey =
|
||||
|
||||
POBJECT_TYPE IoDriverObjectType = NULL;
|
||||
|
||||
#define TAG_RTLREGISTRY TAG('R', 'q', 'r', 'v')
|
||||
|
||||
extern BOOLEAN ExpInTextModeSetup;
|
||||
|
||||
/* PRIVATE FUNCTIONS **********************************************************/
|
||||
@ -246,7 +248,7 @@ IopNormalizeImagePath(
|
||||
RtlAppendUnicodeStringToString(ImagePath, &InputImagePath);
|
||||
|
||||
/* Free caller's string */
|
||||
RtlFreeUnicodeString(&InputImagePath);
|
||||
ExFreePoolWithTag(InputImagePath.Buffer, TAG_RTLREGISTRY);
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -37,6 +37,8 @@ typedef struct _SERVICE
|
||||
/* BOOLEAN ServiceRunning;*/ // needed ??
|
||||
} SERVICE, *PSERVICE;
|
||||
|
||||
#define TAG_RTLREGISTRY TAG('R', 'q', 'r', 'v')
|
||||
|
||||
/* GLOBALS ********************************************************************/
|
||||
|
||||
LIST_ENTRY GroupListHead = {NULL, NULL};
|
||||
@ -205,11 +207,11 @@ IopCreateServiceListEntry(PUNICODE_STRING ServiceName)
|
||||
*/
|
||||
if (Service->ServiceGroup.Buffer)
|
||||
{
|
||||
ExFreePool(Service->ServiceGroup.Buffer);
|
||||
ExFreePoolWithTag(Service->ServiceGroup.Buffer, TAG_RTLREGISTRY);
|
||||
}
|
||||
if (Service->ImagePath.Buffer)
|
||||
{
|
||||
ExFreePool(Service->ImagePath.Buffer);
|
||||
ExFreePoolWithTag(Service->ImagePath.Buffer, TAG_RTLREGISTRY);
|
||||
}
|
||||
ExFreePool(Service);
|
||||
return(Status);
|
||||
|
@ -1031,7 +1031,7 @@ IopDeleteFile(IN PVOID ObjectBody)
|
||||
/* Clear the file name */
|
||||
if (FileObject->FileName.Buffer)
|
||||
{
|
||||
ExFreePool(FileObject->FileName.Buffer);
|
||||
ExFreePoolWithTag(FileObject->FileName.Buffer, TAG_IO_NAME);
|
||||
FileObject->FileName.Buffer = NULL;
|
||||
}
|
||||
|
||||
|
@ -1890,7 +1890,7 @@ NtQueryInformationFile(IN HANDLE FileHandle,
|
||||
{
|
||||
/* Clear it in the IRP for completion */
|
||||
Irp->UserEvent = NULL;
|
||||
ExFreePool(Event);
|
||||
ExFreePoolWithTag(Event, TAG_IO);
|
||||
}
|
||||
|
||||
/* Set the caller IOSB */
|
||||
|
@ -179,7 +179,7 @@ IopQueryDeviceDescription(
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
if (ControllerFullInformation != NULL)
|
||||
ExFreePool(ControllerFullInformation);
|
||||
ExFreePoolWithTag(ControllerFullInformation, TAG_IO_RESOURCE);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ IopQueryDeviceDescription(
|
||||
MaximumControllerNumber = ControllerFullInformation->SubKeys;
|
||||
|
||||
/* Free Memory */
|
||||
ExFreePool(ControllerFullInformation);
|
||||
ExFreePoolWithTag(ControllerFullInformation, TAG_IO_RESOURCE);
|
||||
ControllerFullInformation = NULL;
|
||||
}
|
||||
|
||||
@ -318,7 +318,7 @@ IopQueryDeviceDescription(
|
||||
MaximumPeripheralNumber = PeripheralFullInformation->SubKeys;
|
||||
|
||||
/* Free Memory */
|
||||
ExFreePool(PeripheralFullInformation);
|
||||
ExFreePoolWithTag(PeripheralFullInformation, TAG_IO_RESOURCE);
|
||||
PeripheralFullInformation = NULL;
|
||||
}
|
||||
|
||||
@ -400,7 +400,7 @@ IopQueryDeviceDescription(
|
||||
{
|
||||
if (PeripheralInformation[PeripheralLoop])
|
||||
{
|
||||
ExFreePool(PeripheralInformation[PeripheralLoop]);
|
||||
ExFreePoolWithTag(PeripheralInformation[PeripheralLoop], TAG_IO_RESOURCE);
|
||||
PeripheralInformation[PeripheralLoop] = NULL;
|
||||
}
|
||||
}
|
||||
@ -416,7 +416,7 @@ EndLoop:
|
||||
{
|
||||
if (ControllerInformation[ControllerLoop])
|
||||
{
|
||||
ExFreePool(ControllerInformation[ControllerLoop]);
|
||||
ExFreePoolWithTag(ControllerInformation[ControllerLoop], TAG_IO_RESOURCE);
|
||||
ControllerInformation[ControllerLoop] = NULL;
|
||||
}
|
||||
}
|
||||
@ -498,7 +498,7 @@ IopQueryBusDescription(
|
||||
}
|
||||
|
||||
/* Deallocate the old Buffer */
|
||||
ExFreePool(FullInformation);
|
||||
ExFreePoolWithTag(FullInformation, TAG_IO_RESOURCE);
|
||||
|
||||
/* Try to find a Bus */
|
||||
for (BusLoop = 0; NT_SUCCESS(Status); BusLoop++)
|
||||
@ -619,7 +619,7 @@ IopQueryBusDescription(
|
||||
{
|
||||
if (BusInformation[SubBusLoop])
|
||||
{
|
||||
ExFreePool(BusInformation[SubBusLoop]);
|
||||
ExFreePoolWithTag(BusInformation[SubBusLoop], TAG_IO_RESOURCE);
|
||||
BusInformation[SubBusLoop] = NULL;
|
||||
}
|
||||
}
|
||||
@ -645,7 +645,7 @@ IopQueryBusDescription(
|
||||
|
||||
/* Free the last remaining Allocated Memory */
|
||||
if (BasicInformation)
|
||||
ExFreePool(BasicInformation);
|
||||
ExFreePoolWithTag(BasicInformation, TAG_IO_RESOURCE);
|
||||
|
||||
return Status;
|
||||
}
|
||||
@ -788,7 +788,7 @@ IoQueryDeviceDescription(PINTERFACE_TYPE BusType OPTIONAL,
|
||||
}
|
||||
|
||||
/* Free Memory */
|
||||
ExFreePool(RootRegKey.Buffer);
|
||||
ExFreePoolWithTag(RootRegKey.Buffer, TAG_IO_RESOURCE);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@ -1499,7 +1499,7 @@ IoFreeIrp(IN PIRP Irp)
|
||||
if (!(Irp->AllocationFlags & IRP_ALLOCATED_FIXED_SIZE))
|
||||
{
|
||||
/* Free it */
|
||||
ExFreePool(Irp);
|
||||
ExFreePoolWithTag(Irp, TAG_IRP);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1528,7 +1528,7 @@ IoFreeIrp(IN PIRP Irp)
|
||||
{
|
||||
/* All lists failed, use the pool */
|
||||
List->L.FreeMisses++;
|
||||
ExFreePool(Irp);
|
||||
ExFreePoolWithTag(Irp, TAG_IRP);
|
||||
Irp = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ MmGetFileNameForSection(IN PROS_SECTION_OBJECT Section,
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Failed, free memory */
|
||||
ExFreePool(ObjectNameInfo);
|
||||
ExFreePoolWithTag(ObjectNameInfo, TAG('M', 'm', ' ', ' '));
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -2759,7 +2759,7 @@ ExeFmtpReadFile(IN PVOID File,
|
||||
}
|
||||
else
|
||||
{
|
||||
ExFreePool(Buffer);
|
||||
ExFreePoolWithTag(Buffer, TAG('M', 'm', 'X', 'r'));
|
||||
}
|
||||
|
||||
return Status;
|
||||
@ -3168,7 +3168,7 @@ ExeFmtpCreateImageSection(HANDLE FileHandle,
|
||||
break;
|
||||
}
|
||||
|
||||
ExFreePool(FileHeaderBuffer);
|
||||
ExFreePoolWithTag(FileHeaderBuffer, TAG('M', 'm', 'X', 'r'));
|
||||
|
||||
/*
|
||||
* No loader handled the format
|
||||
@ -3963,7 +3963,7 @@ MmUnmapViewOfSegment(PMM_AVL_TABLE AddressSpace,
|
||||
{
|
||||
CurrentEntry = RemoveHeadList(RegionListHead);
|
||||
CurrentRegion = CONTAINING_RECORD(CurrentEntry, MM_REGION, RegionListEntry);
|
||||
ExFreePool(CurrentRegion);
|
||||
ExFreePoolWithTag(CurrentRegion, TAG_MM_REGION);
|
||||
}
|
||||
|
||||
if (Section->AllocationAttributes & SEC_PHYSICALMEMORY)
|
||||
|
@ -660,7 +660,7 @@ MiSnapThunk(IN PVOID DllBase,
|
||||
&MissingForwarder);
|
||||
|
||||
/* Free the forwarder name and set the thunk */
|
||||
ExFreePool(ForwardName);
|
||||
ExFreePoolWithTag(ForwardName, TAG_LDR_WSTR);
|
||||
Address->u1 = ForwardThunk.u1;
|
||||
break;
|
||||
}
|
||||
@ -876,7 +876,7 @@ MiResolveImageReferences(IN PVOID ImageBase,
|
||||
{
|
||||
/* Failed */
|
||||
MiDereferenceImports(LoadedImports);
|
||||
if (LoadedImports) ExFreePool(LoadedImports);
|
||||
if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -997,7 +997,7 @@ CheckDllState:
|
||||
/* Cleanup and return */
|
||||
RtlFreeUnicodeString(&NameString);
|
||||
MiDereferenceImports(LoadedImports);
|
||||
if (LoadedImports) ExFreePool(LoadedImports);
|
||||
if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -1030,7 +1030,7 @@ CheckDllState:
|
||||
{
|
||||
/* Cleanup and return */
|
||||
MiDereferenceImports(LoadedImports);
|
||||
if (LoadedImports) ExFreePool(LoadedImports);
|
||||
if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR);
|
||||
return STATUS_DRIVER_ENTRYPOINT_NOT_FOUND;
|
||||
}
|
||||
|
||||
@ -1059,7 +1059,7 @@ CheckDllState:
|
||||
{
|
||||
/* Cleanup and return */
|
||||
MiDereferenceImports(LoadedImports);
|
||||
if (LoadedImports) ExFreePool(LoadedImports);
|
||||
if (LoadedImports) ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -1091,13 +1091,13 @@ CheckDllState:
|
||||
if (!ImportCount)
|
||||
{
|
||||
/* Free the list and set it to no imports */
|
||||
ExFreePool(LoadedImports);
|
||||
ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR);
|
||||
LoadedImports = (PVOID)-2;
|
||||
}
|
||||
else if (ImportCount == 1)
|
||||
{
|
||||
/* Just one entry, we can free the table and only use our entry */
|
||||
ExFreePool(LoadedImports);
|
||||
ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR);
|
||||
LoadedImports = (PLOAD_IMPORTS)ImportEntry;
|
||||
}
|
||||
else if (ImportCount != LoadedImports->Count)
|
||||
@ -1125,7 +1125,7 @@ CheckDllState:
|
||||
}
|
||||
|
||||
/* Free the old copy */
|
||||
ExFreePool(LoadedImports);
|
||||
ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR);
|
||||
LoadedImports = NewImports;
|
||||
}
|
||||
}
|
||||
@ -1834,7 +1834,7 @@ LoaderScan:
|
||||
}
|
||||
|
||||
/* Free the entry itself */
|
||||
ExFreePool(LdrEntry);
|
||||
ExFreePoolWithTag(LdrEntry, TAG_MODULE_OBJECT);
|
||||
LdrEntry = NULL;
|
||||
goto Quickie;
|
||||
}
|
||||
@ -1924,7 +1924,7 @@ Quickie:
|
||||
if (NamePrefix) ExFreePool(PrefixName.Buffer);
|
||||
|
||||
/* Free the name buffer and return status */
|
||||
ExFreePool(Buffer);
|
||||
ExFreePoolWithTag(Buffer, TAG_LDR_WSTR);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ ObpDeleteEntryDirectory(POBP_LOOKUP_CONTEXT Context)
|
||||
CurrentEntry->ChainLink = NULL;
|
||||
|
||||
/* Free it */
|
||||
ExFreePool(CurrentEntry);
|
||||
ExFreePoolWithTag(CurrentEntry, OB_DIR_TAG);
|
||||
|
||||
/* Return */
|
||||
return TRUE;
|
||||
@ -529,7 +529,7 @@ NtQueryDirectoryObject(IN HANDLE DirectoryHandle,
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Free the buffer and fail */
|
||||
ExFreePool(LocalBuffer);
|
||||
ExFreePoolWithTag(LocalBuffer, OB_NAME_TAG);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -701,7 +701,7 @@ Quickie:
|
||||
|
||||
/* Dereference the directory and free our buffer */
|
||||
ObDereferenceObject(Directory);
|
||||
ExFreePool(LocalBuffer);
|
||||
ExFreePoolWithTag(LocalBuffer, OB_NAME_TAG);
|
||||
|
||||
/* Return status to caller */
|
||||
return Status;
|
||||
|
@ -289,7 +289,7 @@ ObpInsertHandleCount(IN POBJECT_HEADER ObjectHeader)
|
||||
else
|
||||
{
|
||||
/* Otherwise we had a DB, free it */
|
||||
ExFreePool(OldHandleDatabase);
|
||||
ExFreePoolWithTag(OldHandleDatabase, TAG_OB_HANDLE);
|
||||
}
|
||||
|
||||
/* Find the end of the copy and zero out the new data */
|
||||
@ -2425,7 +2425,7 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Fail */
|
||||
ExFreePool(TempBuffer);
|
||||
ExFreePoolWithTag(TempBuffer, TAG_OB_TEMP_STORAGE);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -2533,7 +2533,7 @@ Quickie:
|
||||
/* Release the object attributes and temporary buffer */
|
||||
ObpReleaseObjectCreateInformation(&TempBuffer->ObjectCreateInfo);
|
||||
if (ObjectName.Buffer) ObpFreeObjectNameBuffer(&ObjectName);
|
||||
ExFreePool(TempBuffer);
|
||||
ExFreePoolWithTag(TempBuffer, TAG_OB_TEMP_STORAGE);
|
||||
|
||||
/* Return status */
|
||||
OBTRACE(OB_HANDLE_DEBUG,
|
||||
|
@ -720,7 +720,7 @@ ParseFromRoot:
|
||||
if (ObjectNameInfo->Name.Buffer)
|
||||
{
|
||||
/* Free it */
|
||||
ExFreePool(ObjectNameInfo->Name.Buffer);
|
||||
ExFreePoolWithTag(ObjectNameInfo->Name.Buffer, OB_NAME_TAG );
|
||||
}
|
||||
|
||||
/* Write new one */
|
||||
|
@ -40,7 +40,7 @@ ObAssignObjectSecurityDescriptor(IN PVOID Object,
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
/* Free the old copy */
|
||||
ExFreePool(SecurityDescriptor);
|
||||
ExFreePoolWithTag(SecurityDescriptor, TAG_SD);
|
||||
|
||||
/* Set the new pointer */
|
||||
ASSERT(NewSd);
|
||||
@ -633,7 +633,7 @@ ObGetObjectSecurity(IN PVOID Object,
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Free the descriptor and tell the caller we failed */
|
||||
ExFreePool(*SecurityDescriptor);
|
||||
ExFreePoolWithTag(*SecurityDescriptor, TAG_SEC_QUERY);
|
||||
*MemoryAllocated = FALSE;
|
||||
}
|
||||
|
||||
|
@ -279,7 +279,7 @@ Quickie:
|
||||
}
|
||||
|
||||
/* Free wait block array */
|
||||
if (WaitBlockArray) ExFreePool(WaitBlockArray);
|
||||
if (WaitBlockArray) ExFreePoolWithTag(WaitBlockArray, TAG_WAIT);
|
||||
|
||||
/* Re-enable APCs if needed */
|
||||
if (LockInUse) KeLeaveCriticalRegion();
|
||||
|
@ -13,6 +13,8 @@
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#define TAG_ATMT TAG('A', 't', 'o', 'T') /* Atom table */
|
||||
|
||||
extern ULONG NtGlobalFlag;
|
||||
|
||||
typedef struct _RTL_RANGE_ENTRY
|
||||
@ -482,21 +484,21 @@ RtlpFreeAtomTable(PRTL_ATOM_TABLE AtomTable)
|
||||
PRTL_ATOM_TABLE_ENTRY
|
||||
RtlpAllocAtomTableEntry(ULONG Size)
|
||||
{
|
||||
PRTL_ATOM_TABLE_ENTRY Entry = ExAllocatePool(NonPagedPool,
|
||||
Size);
|
||||
if (Entry != NULL)
|
||||
{
|
||||
RtlZeroMemory(Entry,
|
||||
Size);
|
||||
}
|
||||
PRTL_ATOM_TABLE_ENTRY Entry;
|
||||
|
||||
return Entry;
|
||||
Entry = ExAllocatePoolWithTag(NonPagedPool, Size, TAG_ATMT);
|
||||
if (Entry != NULL)
|
||||
{
|
||||
RtlZeroMemory(Entry, Size);
|
||||
}
|
||||
|
||||
return Entry;
|
||||
}
|
||||
|
||||
VOID
|
||||
RtlpFreeAtomTableEntry(PRTL_ATOM_TABLE_ENTRY Entry)
|
||||
{
|
||||
ExFreePool(Entry);
|
||||
ExFreePoolWithTag(Entry, TAG_ATMT);
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -619,8 +619,9 @@ DescriptorCopy.AclType = NULL; \
|
||||
|
||||
/* allocate enough memory to store a complete copy of a self-relative
|
||||
security descriptor */
|
||||
NewDescriptor = ExAllocatePool(PoolType,
|
||||
DescriptorSize);
|
||||
NewDescriptor = ExAllocatePoolWithTag(PoolType,
|
||||
DescriptorSize,
|
||||
TAG_SD);
|
||||
if(NewDescriptor != NULL)
|
||||
{
|
||||
ULONG_PTR Offset = sizeof(SECURITY_DESCRIPTOR);
|
||||
@ -872,7 +873,7 @@ SeReleaseSecurityDescriptor(IN PSECURITY_DESCRIPTOR CapturedSecurityDescriptor,
|
||||
(CurrentMode == KernelMode && CaptureIfKernelMode)))
|
||||
{
|
||||
/* only delete the descriptor when SeCaptureSecurityDescriptor() allocated one! */
|
||||
ExFreePool(CapturedSecurityDescriptor);
|
||||
ExFreePoolWithTag(CapturedSecurityDescriptor, TAG_SD);
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
@ -1450,8 +1451,9 @@ SeAssignSecurity(PSECURITY_DESCRIPTOR _ParentDescriptor OPTIONAL,
|
||||
DaclLength,
|
||||
SaclLength);
|
||||
|
||||
Descriptor = ExAllocatePool(PagedPool,
|
||||
Length);
|
||||
Descriptor = ExAllocatePoolWithTag(PagedPool,
|
||||
Length,
|
||||
TAG_SD);
|
||||
if (Descriptor == NULL)
|
||||
{
|
||||
DPRINT1("ExAlloctePool() failed\n");
|
||||
|
Loading…
Reference in New Issue
Block a user