https://git.reactos.org/?p=reactos.git;a=commitdiff;h=47cb3c20a3cf809ebec052f1a5c84f693c1efa98

commit 47cb3c20a3cf809ebec052f1a5c84f693c1efa98
Author:     George Bișoc <[email protected]>
AuthorDate: Sun Jan 2 20:21:22 2022 +0100
Commit:     George Bișoc <[email protected]>
CommitDate: Tue Jan 11 10:10:56 2022 +0100

    [NTOSKRNL] Implement InterlockedExchangeSizeT macro
---
 ntoskrnl/include/internal/ex.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ntoskrnl/include/internal/ex.h b/ntoskrnl/include/internal/ex.h
index 2b8b0026794..a8273001523 100644
--- a/ntoskrnl/include/internal/ex.h
+++ b/ntoskrnl/include/internal/ex.h
@@ -1537,6 +1537,14 @@ XIPInit(
 #define InterlockedCompareExchangeSizeT(Destination, Exchange, Comperand) \
    (SIZE_T)InterlockedCompareExchangePointer((PVOID*)(Destination), 
(PVOID)(SIZE_T)(Exchange), (PVOID)(SIZE_T)(Comperand))
 
+#ifdef _WIN64
+#define InterlockedExchangeSizeT(Target, Value) \
+    (SIZE_T)InterlockedExchange64((PLONG64)Target, (LONG64)Value)
+#else
+#define InterlockedExchangeSizeT(Target, Value) \
+    (SIZE_T)InterlockedExchange((PLONG)Target, (LONG)Value)
+#endif
+
 #define ExfInterlockedCompareExchange64UL(Destination, Exchange, Comperand) \
    (ULONGLONG)ExfInterlockedCompareExchange64((PLONGLONG)(Destination), 
(PLONGLONG)(Exchange), (PLONGLONG)(Comperand))
 

Reply via email to