}
}
- (void)_InterlockedExchange((PLONG)&SRWLock->Ptr, NewValue);
+ (void)_InterlockedExchangePointer(&SRWLock->Ptr, (PVOID)NewValue);
if (FirstWaitBlock->Exclusive)
{
NewValue = RTL_SRWLOCK_OWNED;
}
- (void)_InterlockedExchange((PLONG)&SRWLock->Ptr, NewValue);
+ (void)_InterlockedExchangePointer(&SRWLock->Ptr, (PVOID)NewValue);
(void)InterlockedOr(&FirstWaitBlock->Wake,
TRUE);
NewValue = (CurrentValue >> RTL_SRWLOCK_BITS) + 1;
NewValue = (NewValue << RTL_SRWLOCK_BITS) | (CurrentValue & RTL_SRWLOCK_MASK);
- if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr,
- NewValue,
- CurrentValue) == CurrentValue)
+ if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) == CurrentValue)
{
/* Successfully incremented the shared count, we acquired the lock */
break;
ASSERT_SRW_WAITBLOCK(&StackWaitBlock);
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_OWNED | RTL_SRWLOCK_CONTENDED;
- if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr,
- NewValue,
- CurrentValue) == CurrentValue)
+ if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) == CurrentValue)
{
RtlpAcquireSRWLockSharedWait(SRWLock,
&StackWaitBlock,
RTL_SRWLOCK_SHARED nor the RTL_SRWLOCK_OWNED bit is set */
ASSERT(!(CurrentValue & RTL_SRWLOCK_CONTENDED));
- if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr,
- NewValue,
- CurrentValue) == CurrentValue)
+ if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) == CurrentValue)
{
/* Successfully set the shared count, we acquired the lock */
break;
NewValue = (NewValue << RTL_SRWLOCK_BITS) | RTL_SRWLOCK_SHARED | RTL_SRWLOCK_OWNED;
}
- if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr,
- NewValue,
- CurrentValue) == CurrentValue)
+ if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) == CurrentValue)
{
/* Successfully released the lock */
break;
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_SHARED | RTL_SRWLOCK_CONTENDED | RTL_SRWLOCK_OWNED;
- if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr,
- NewValue,
- CurrentValue) == CurrentValue)
+ if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) == CurrentValue)
{
RtlpAcquireSRWLockExclusiveWait(SRWLock,
&StackWaitBlock);
ASSERT_SRW_WAITBLOCK(&StackWaitBlock);
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_OWNED | RTL_SRWLOCK_CONTENDED;
- if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr,
- NewValue,
- CurrentValue) == CurrentValue)
+ if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) == CurrentValue)
{
RtlpAcquireSRWLockExclusiveWait(SRWLock,
&StackWaitBlock);
ASSERT(!(CurrentValue & ~RTL_SRWLOCK_OWNED));
NewValue = 0;
- if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr,
- NewValue,
- CurrentValue) == CurrentValue)
+ if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) == CurrentValue)
{
/* We released the lock */
break;