- Fix portable Ex/ExfInterlockedCompareExchange64 to compare Destination with the Comparand instead of...itself?

svn path=/trunk/; revision=36712
This commit is contained in:
Stefan Ginsberg
2008-10-11 09:39:08 +00:00
parent f01ffb27dc
commit 1e1d996268
+3 -3
View File
@@ -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;
}