mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 00:43:21 +00:00
[NTOS:MM]
- Add a way to generate a pool tag from the calling driver name if none is specified. Disabled by default. svn path=/trunk/; revision=64889
This commit is contained in:
parent
2e4b0e9661
commit
6256673633
|
@ -2046,10 +2046,25 @@ NTAPI
|
|||
ExAllocatePool(POOL_TYPE PoolType,
|
||||
SIZE_T NumberOfBytes)
|
||||
{
|
||||
//
|
||||
// Use a default tag of "None"
|
||||
//
|
||||
return ExAllocatePoolWithTag(PoolType, NumberOfBytes, TAG_NONE);
|
||||
ULONG Tag = TAG_NONE;
|
||||
#if 0 && DBG
|
||||
PLDR_DATA_TABLE_ENTRY LdrEntry;
|
||||
|
||||
/* Use the first four letters of the driver name, or "None" if unavailable */
|
||||
LdrEntry = KeGetCurrentIrql() <= APC_LEVEL
|
||||
? MiLookupDataTableEntry(_ReturnAddress())
|
||||
: NULL;
|
||||
if (LdrEntry)
|
||||
{
|
||||
ULONG i;
|
||||
Tag = 0;
|
||||
for (i = 0; i < min(4, LdrEntry->BaseDllName.Length / sizeof(WCHAR)); i++)
|
||||
Tag = Tag >> 8 | (LdrEntry->BaseDllName.Buffer[i] & 0xff) << 24;
|
||||
for (; i < 4; i++)
|
||||
Tag = Tag >> 8 | ' ' << 24;
|
||||
}
|
||||
#endif
|
||||
return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2513,7 +2528,7 @@ ExAllocatePoolWithQuota(IN POOL_TYPE PoolType,
|
|||
//
|
||||
// Allocate the pool
|
||||
//
|
||||
return ExAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, 'enoN');
|
||||
return ExAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, TAG_NONE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue