Check out the return codes secion of
MSDN[
^].
WAIT_FAILED (0xFFFFFFFF) The function has failed. To get extended error information, call GetLastError.
Edit: To clarify, 0xFFFFFFFF == -1. Search google for signed/unsigned conversions if you don't know why.
If you go on to read
GetLastError[
^] you will come across something like this, which prints to the console the error code and associated message from the pages at
http://msdn.microsoft.com/en-us/library/ms681381(v=vs.85).aspx[
^]
LPSTR szMessage;
DWORD nErr = GetLastError();
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, nErr , MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&szMessage, 0, NULL);
printf("Error 0x%08X (%u): %s\n", nErr, nErr, szMessage);
LocalFree(lpMsgBuf);