MSDN says
If the function fails, the return value is WAIT_FAILED. To get extended error information, call GetLastError.
The cod
Passing in a bogus object might cause that.