((OldValue & GM_LOCK_WAITER_WOKEN) != 0));
/* Unlock it by removing the Lock Bit */
- NewValue = InterlockedCompareExchange(&GuardedMutex->Count,
+ NewValue = InterlockedCompareExchange((PLONG)&GuardedMutex->Count,
OldValue ^ BitsToRemove,
OldValue);
if (NewValue == OldValue) break;
else
{
/* The Guarded Mutex isn't locked, so simply set the bits */
- NewValue = InterlockedCompareExchange(&GuardedMutex->Count,
+ NewValue = InterlockedCompareExchange((PLONG)&GuardedMutex->Count,
OldValue + BitsToAdd,
OldValue);
if (NewValue != OldValue)
GuardedMutex->Owner = NULL;
/* Add the Lock Bit */
- OldValue = InterlockedExchangeAdd(&GuardedMutex->Count, 1);
+ OldValue = InterlockedExchangeAdd((PLONG)&GuardedMutex->Count, 1);
ASSERT((OldValue & GM_LOCK_BIT) == 0);
/* Check if it was already locked, but not woken */
OldValue |= GM_LOCK_BIT;
/* Remove the Woken bit */
- if (InterlockedCompareExchange(&GuardedMutex->Count,
+ if (InterlockedCompareExchange((PLONG)&GuardedMutex->Count,
OldValue - GM_LOCK_WAITER_WOKEN,
OldValue) == OldValue)
{