mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 09:50:07 +00:00
[NTOSKRNL] In FsRtlAddToTunnelCache() allocate memory from PagedPool when required.
Also, if allocating from lookaside list, reattempt a cold allocation.
This commit is contained in:
parent
cb8cc0d098
commit
2abb99faa9
|
@ -346,7 +346,7 @@ FsRtlAddToTunnelCache(IN PTUNNEL Cache,
|
||||||
IN ULONG DataLength,
|
IN ULONG DataLength,
|
||||||
IN PVOID Data)
|
IN PVOID Data)
|
||||||
{
|
{
|
||||||
PTUNNEL_NODE_ENTRY NodeEntry;
|
PTUNNEL_NODE_ENTRY NodeEntry = NULL;
|
||||||
PRTL_SPLAY_LINKS CurEntry, LastEntry;
|
PRTL_SPLAY_LINKS CurEntry, LastEntry;
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
LONG Result = 0;
|
LONG Result = 0;
|
||||||
|
@ -384,25 +384,26 @@ FsRtlAddToTunnelCache(IN PTUNNEL Cache,
|
||||||
Length += LongName->Length;
|
Length += LongName->Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Length > DEFAULT_ENTRY_SIZE)
|
if (Length <= DEFAULT_ENTRY_SIZE)
|
||||||
{
|
|
||||||
/* bigger than default entry */
|
|
||||||
NodeEntry = ExAllocatePool(NonPagedPool, Length);
|
|
||||||
AllocatedFromPool = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* get standard entry */
|
/* get standard entry */
|
||||||
NodeEntry = ExAllocateFromPagedLookasideList(&TunnelLookasideList);
|
NodeEntry = ExAllocateFromPagedLookasideList(&TunnelLookasideList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NodeEntry == NULL)
|
||||||
|
{
|
||||||
|
/* bigger than default entry or allocation failed */
|
||||||
|
NodeEntry = ExAllocatePool(PagedPool | POOL_COLD_ALLOCATION, Length);
|
||||||
/* check for success */
|
/* check for success */
|
||||||
if (!NodeEntry)
|
if (NodeEntry == NULL)
|
||||||
{
|
{
|
||||||
/* out of memory */
|
/* out of memory */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AllocatedFromPool = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* acquire lock */
|
/* acquire lock */
|
||||||
ExAcquireFastMutex(&Cache->Mutex);
|
ExAcquireFastMutex(&Cache->Mutex);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue