/* We failed, this is bad... */
DPRINT1("Failed to Create Event!\n");
- _InterlockedDecrement(&CriticalSection->LockCount);
+ InterlockedDecrement(&CriticalSection->LockCount);
RtlRaiseStatus(Status);
return;
}
DPRINT("Created Event: %p \n", hNewEvent);
- if ((hEvent = (HANDLE)_InterlockedCompareExchangePointer((PVOID*)&CriticalSection->LockSemaphore,
- (PVOID)hNewEvent,
- 0))) {
+ if (InterlockedCompareExchangePointer((PVOID*)&CriticalSection->LockSemaphore,
+ (PVOID)hNewEvent,
+ 0)) {
/* Some just created an event */
DPRINT("Closing already created event: %p\n", hNewEvent);
HANDLE Thread = (HANDLE)NtCurrentTeb()->ClientId.UniqueThread;
/* Try to Lock it */
- if (_InterlockedIncrement(&CriticalSection->LockCount) != 0) {
+ if (InterlockedIncrement(&CriticalSection->LockCount) != 0) {
/*
* We've failed to lock it! Does this thread
if (--CriticalSection->RecursionCount) {
/* Someone still owns us, but we are free. This needs to be done atomically. */
- _InterlockedDecrement(&CriticalSection->LockCount);
+ InterlockedDecrement(&CriticalSection->LockCount);
} else {
CriticalSection->OwningThread = 0;
/* Was someone wanting us? This needs to be done atomically. */
- if (-1 != _InterlockedDecrement(&CriticalSection->LockCount)) {
+ if (-1 != InterlockedDecrement(&CriticalSection->LockCount)) {
/* Let him have us */
RtlpUnWaitCriticalSection(CriticalSection);
RtlTryEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
{
/* Try to take control */
- if (_InterlockedCompareExchange(&CriticalSection->LockCount,
+ if (InterlockedCompareExchange(&CriticalSection->LockCount,
0,
-1) == -1) {
} else if (CriticalSection->OwningThread == NtCurrentTeb()->ClientId.UniqueThread) {
/* It's already ours */
- _InterlockedIncrement(&CriticalSection->LockCount);
+ InterlockedIncrement(&CriticalSection->LockCount);
CriticalSection->RecursionCount++;
return TRUE;
}