https://git.reactos.org/?p=reactos.git;a=commitdiff;h=47d309b262b302cb86fe7…
commit 47d309b262b302cb86fe72d689a616bbbde3a7d4
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Nov 17 15:03:43 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Nov 17 16:44:35 2018 +0100
[NTOSKRNL] Implement ExSizeOfRundownProtectionCacheAware()
---
ntoskrnl/ex/rundown.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/ntoskrnl/ex/rundown.c b/ntoskrnl/ex/rundown.c
index 5b354857e3..ee1dbadb2b 100644
--- a/ntoskrnl/ex/rundown.c
+++ b/ntoskrnl/ex/rundown.c
@@ -606,13 +606,28 @@ ExInitializeRundownProtectionCacheAware(IN
PEX_RUNDOWN_REF_CACHE_AWARE RunRefCac
}
/*
- * @unimplemented NT5.2
+ * @implemented NT5.2
*/
SIZE_T
NTAPI
ExSizeOfRundownProtectionCacheAware(VOID)
{
- UNIMPLEMENTED;
- return 0;
+ SIZE_T Size;
+
+ PAGED_CODE();
+
+ /* Compute the needed size for runrefs */
+ if (KeNumberProcessors <= 1)
+ {
+ Size = sizeof(EX_RUNDOWN_REF);
+ }
+ else
+ {
+ /* We +1, to have enough room for alignment */
+ Size = (KeNumberProcessors + 1) * KeGetRecommendedSharedDataAlignment();
+ }
+
+ /* Return total size (master structure and runrefs) */
+ return Size + sizeof(EX_RUNDOWN_REF_CACHE_AWARE);
}