Properly define tags for allocations
svn path=/trunk/; revision=57844
}
LOCK_SHARED_RANGE, *PLOCK_SHARED_RANGE;
}
LOCK_SHARED_RANGE, *PLOCK_SHARED_RANGE;
+#define TAG_TABLE 'LTAB'
+#define TAG_RANGE 'FSRA'
+#define TAG_FLOCK 'FLCK'
+
/* PRIVATE FUNCTIONS *********************************************************/
VOID
/* PRIVATE FUNCTIONS *********************************************************/
VOID
static PVOID NTAPI LockAllocate(PRTL_GENERIC_TABLE Table, CLONG Bytes)
{
PVOID Result;
static PVOID NTAPI LockAllocate(PRTL_GENERIC_TABLE Table, CLONG Bytes)
{
PVOID Result;
- Result = ExAllocatePoolWithTag(NonPagedPool, Bytes, 'LTAB');
+ Result = ExAllocatePoolWithTag(NonPagedPool, Bytes, TAG_TABLE);
DPRINT("LockAllocate(%d) => %p\n", Bytes, Result);
return Result;
}
DPRINT("LockAllocate(%d) => %p\n", Bytes, Result);
return Result;
}
static VOID NTAPI LockFree(PRTL_GENERIC_TABLE Table, PVOID Buffer)
{
DPRINT("LockFree(%p)\n", Buffer);
static VOID NTAPI LockFree(PRTL_GENERIC_TABLE Table, PVOID Buffer)
{
DPRINT("LockFree(%p)\n", Buffer);
- ExFreePoolWithTag(Buffer, 'LTAB');
+ ExFreePoolWithTag(Buffer, TAG_TABLE);
}
static RTL_GENERIC_COMPARE_RESULTS NTAPI LockCompare
}
static RTL_GENERIC_COMPARE_RESULTS NTAPI LockCompare
/* Initialize the lock, if necessary */
if (!FileLock->LockInformation)
{
/* Initialize the lock, if necessary */
if (!FileLock->LockInformation)
{
- LockInfo = ExAllocatePoolWithTag(NonPagedPool, sizeof(LOCK_INFORMATION), 'FLCK');
+ LockInfo = ExAllocatePoolWithTag(NonPagedPool, sizeof(LOCK_INFORMATION), TAG_FLOCK);
if (!LockInfo)
{
IoStatus->Status = STATUS_NO_MEMORY;
if (!LockInfo)
{
IoStatus->Status = STATUS_NO_MEMORY;
DPRINT("Adding shared lock %wZ\n", &FileObject->FileName);
NewSharedRange =
DPRINT("Adding shared lock %wZ\n", &FileObject->FileName);
NewSharedRange =
- ExAllocatePoolWithTag(NonPagedPool, sizeof(*NewSharedRange), 'FSRA');
+ ExAllocatePoolWithTag(NonPagedPool, sizeof(*NewSharedRange), TAG_RANGE);
if (!NewSharedRange)
{
IoStatus->Status = STATUS_NO_MEMORY;
if (!NewSharedRange)
{
IoStatus->Status = STATUS_NO_MEMORY;
if (!ExclusiveLock)
{
NewSharedRange =
if (!ExclusiveLock)
{
NewSharedRange =
- ExAllocatePoolWithTag(NonPagedPool, sizeof(*NewSharedRange), 'FSRA');
+ ExAllocatePoolWithTag(NonPagedPool, sizeof(*NewSharedRange), TAG_RANGE);
if (!NewSharedRange)
{
IoStatus->Status = STATUS_NO_MEMORY;
if (!NewSharedRange)
{
IoStatus->Status = STATUS_NO_MEMORY;
{
/* Remove the found range from the shared range lists */
RemoveEntryList(&SharedRange->Entry);
{
/* Remove the found range from the shared range lists */
RemoveEntryList(&SharedRange->Entry);
- ExFreePoolWithTag(SharedRange, 'FSRA');
+ ExFreePoolWithTag(SharedRange, TAG_RANGE);
/* We need to rebuild the list of shared ranges. */
DPRINT("Removing the lock entry %wZ (%08x%08x:%08x%08x)\n",
&FileObject->FileName,
/* We need to rebuild the list of shared ranges. */
DPRINT("Removing the lock entry %wZ (%08x%08x:%08x%08x)\n",
&FileObject->FileName,
SharedRange = CONTAINING_RECORD(SharedEntry, LOCK_SHARED_RANGE, Entry);
SharedEntry = SharedEntry->Flink;
RemoveEntryList(&SharedRange->Entry);
SharedRange = CONTAINING_RECORD(SharedEntry, LOCK_SHARED_RANGE, Entry);
SharedEntry = SharedEntry->Flink;
RemoveEntryList(&SharedRange->Entry);
- ExFreePoolWithTag(SharedRange, 'FSRA');
+ ExFreePoolWithTag(SharedRange, TAG_RANGE);
}
while ((Entry = RtlGetElementGenericTable(&InternalInfo->RangeTable, 0)) != NULL)
{
}
while ((Entry = RtlGetElementGenericTable(&InternalInfo->RangeTable, 0)) != NULL)
{
{
FsRtlProcessFileLock(FileLock, Irp, NULL);
}
{
FsRtlProcessFileLock(FileLock, Irp, NULL);
}
- ExFreePoolWithTag(InternalInfo, 'FLCK');
+ ExFreePoolWithTag(InternalInfo, TAG_FLOCK);
FileLock->LockInformation = NULL;
}
}
FileLock->LockInformation = NULL;
}
}