Reputation: 3059
What is the return value of the WaitForObject()
function?
I do not mean the type of return value (int).
What does it return if the event is signalled and what does it return if the event is not signalled?
Upvotes: 0
Views: 911
Reputation: 36016
This question isn't C++. C++ has no API called WaitForObject
.
The Windows API has a function called WaitForSingleObject
and another called WaitForMultipleObjects
.
These functions return -1 on failure, 0 if the first object in the array is signalled, and a number >= 0x80 if the wait times out or is abandoned. (0x80 if abandoned, 0x102 if there is a timeout).
Upvotes: 0
Reputation: 91805
There is no WaitForObject
function. I assume that you mean either WaitForSingleObject
or WaitForMultipleObjects
.
WaitForSingleObject
will return WAIT_TIMEOUT
, WAIT_OBJECT_0
or WAIT_ERROR
. WaitForMultipleObjects
will return WAIT_TIMEOUT
, WAIT_OBJECT_0 + n
(where n is the index to the object in the array) or WAIT_ERROR
.
Upvotes: 3