Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 199 of file wait.c.
{ PRTLP_WAIT Wait = (PRTLP_WAIT) WaitHandle; NTSTATUS Status = STATUS_SUCCESS; //TRACE( "(%p)\n", WaitHandle ); NtSetEvent( Wait->CancelEvent, NULL ); if (Wait->CallbackInProgress) { if (CompletionEvent != NULL) { if (CompletionEvent == INVALID_HANDLE_VALUE) { Status = NtCreateEvent( &CompletionEvent, EVENT_ALL_ACCESS, NULL, TRUE, FALSE ); if (Status != STATUS_SUCCESS) return Status; (void)InterlockedExchangePointer( &Wait->CompletionEvent, CompletionEvent ); if (Wait->CallbackInProgress) NtWaitForSingleObject( CompletionEvent, FALSE, NULL ); NtClose( CompletionEvent ); } else { (void)InterlockedExchangePointer( &Wait->CompletionEvent, CompletionEvent ); if (Wait->CallbackInProgress) Status = STATUS_PENDING; } } else Status = STATUS_PENDING; } if (InterlockedIncrement( &Wait->DeleteCount ) == 2 ) { Status = STATUS_SUCCESS; NtClose( Wait->CancelEvent ); RtlFreeHeap( RtlGetProcessHeap(), 0, Wait ); } return Status; }