mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
[NTOSKRNL] Implement ExInitializeRundownProtectionCacheAware()
This commit is contained in:
parent
bc77f83888
commit
ce94d37dbe
1 changed files with 46 additions and 5 deletions
|
@ -552,16 +552,57 @@ ExFreeCacheAwareRundownProtection(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAwar
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented NT5.2
|
* @implemented NT5.2
|
||||||
*/
|
*/
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
ExInitializeRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware,
|
ExInitializeRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware,
|
||||||
IN SIZE_T Count)
|
IN SIZE_T Size)
|
||||||
{
|
{
|
||||||
DBG_UNREFERENCED_PARAMETER(RunRefCacheAware);
|
PVOID Pool;
|
||||||
DBG_UNREFERENCED_PARAMETER(Count);
|
PEX_RUNDOWN_REF RunRef;
|
||||||
|
ULONG Count, RunRefSize, Offset;
|
||||||
|
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
/* Get the user allocate pool for runrefs */
|
||||||
|
Pool = (PVOID)((ULONG_PTR)RunRefCacheAware + sizeof(EX_RUNDOWN_REF_CACHE_AWARE));
|
||||||
|
|
||||||
|
/* By default a runref is structure-sized */
|
||||||
|
RunRefSize = sizeof(EX_RUNDOWN_REF);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we just have enough room for a single runref, deduce were on a single
|
||||||
|
* processor machine
|
||||||
|
*/
|
||||||
|
if (Size == sizeof(EX_RUNDOWN_REF_CACHE_AWARE) + sizeof(EX_RUNDOWN_REF))
|
||||||
|
{
|
||||||
|
Count = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* FIXME: Properly align on SMP */
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize the structure */
|
||||||
|
RunRefCacheAware->RunRefs = Pool;
|
||||||
|
RunRefCacheAware->RunRefSize = RunRefSize;
|
||||||
|
RunRefCacheAware->Number = Count;
|
||||||
|
|
||||||
|
/* There is no allocated pool! */
|
||||||
|
RunRefCacheAware->PoolToFree = (PVOID)0xBADCA11u;
|
||||||
|
|
||||||
|
/* Initialize runref */
|
||||||
|
if (RunRefCacheAware->Number != 0)
|
||||||
|
{
|
||||||
|
for (Count = 0; Count < RunRefCacheAware->Number; ++Count)
|
||||||
|
{
|
||||||
|
Offset = RunRefCacheAware->RunRefSize * Count;
|
||||||
|
RunRef = (PEX_RUNDOWN_REF)((ULONG_PTR)RunRefCacheAware->RunRefs + Offset);
|
||||||
|
RunRef->Count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue