From 1e1d9962686a8af725bc917848ea62f7035f62ae Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sat, 11 Oct 2008 09:39:08 +0000 Subject: [PATCH] - Fix portable Ex/ExfInterlockedCompareExchange64 to compare Destination with the Comparand instead of...itself? svn path=/trunk/; revision=36712 --- reactos/ntoskrnl/ex/fastinterlck.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/ntoskrnl/ex/fastinterlck.c b/reactos/ntoskrnl/ex/fastinterlck.c index cd3d25d4bd5..9478807ea48 100644 --- a/reactos/ntoskrnl/ex/fastinterlck.c +++ b/reactos/ntoskrnl/ex/fastinterlck.c @@ -105,12 +105,12 @@ LONGLONG FASTCALL ExfInterlockedCompareExchange64(IN OUT LONGLONG volatile *Destination, IN PLONGLONG Exchange, - IN PLONGLONG Comperand) + IN PLONGLONG Comparand) { LONGLONG Result; Result = *Destination; - if (*Destination == Result) *Destination = *Exchange; + if (*Destination == *Comparand) *Destination = *Exchange; return Result; } @@ -306,7 +306,7 @@ ExInterlockedCompareExchange64(IN OUT PLONGLONG Destination, KeAcquireSpinLock(Lock, &OldIrql); Result = *Destination; - if (*Destination == Result) *Destination = *Exchange; + if (*Destination == *Comparand) *Destination = *Exchange; KeReleaseSpinLock(Lock, OldIrql); return Result; }