https://git.reactos.org/?p=reactos.git;a=commitdiff;h=010b9b5469377fbddf2d6…
commit 010b9b5469377fbddf2d632de9a3945d7e522643
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Nov 17 15:32:10 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Nov 17 16:44:35 2018 +0100
[NTOSKRNL] Implement ExGetRunRefForCurrentProcessor() to get runref for a proc
---
ntoskrnl/include/internal/ex.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/ntoskrnl/include/internal/ex.h b/ntoskrnl/include/internal/ex.h
index a8e715aadd..e09eb9ba05 100644
--- a/ntoskrnl/include/internal/ex.h
+++ b/ntoskrnl/include/internal/ex.h
@@ -545,6 +545,15 @@ ExGetCountFastReference(IN EX_FAST_REF FastRef)
return (ULONG)FastRef.RefCnt;
}
+FORCEINLINE
+PEX_RUNDOWN_REF
+ExGetRunRefForCurrentProcessor(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
+{
+ return (PEX_RUNDOWN_REF)((ULONG_PTR)RunRefCacheAware->RunRefs +
+ RunRefCacheAware->RunRefSize *
+ (KeGetCurrentProcessorNumber() %
RunRefCacheAware->Number));
+}
+
FORCEINLINE
VOID
ExInitializeFastReference(OUT PEX_FAST_REF FastRef,