Improved error logging for wait functions.
authorArmin Novak <armin.novak@thincast.com>
Thu, 7 Feb 2019 16:13:21 +0000 (17:13 +0100)
committerArmin Novak <armin.novak@thincast.com>
Fri, 5 Apr 2019 07:14:35 +0000 (09:14 +0200)
winpr/libwinpr/synch/wait.c

index da75487..efefce5 100644 (file)
@@ -320,9 +320,13 @@ DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds)
 
 DWORD WaitForSingleObjectEx(HANDLE hHandle, DWORD dwMilliseconds, BOOL bAlertable)
 {
-       WLog_ERR(TAG, "%s: Not implemented.", __FUNCTION__);
-       SetLastError(ERROR_NOT_SUPPORTED);
-       return WAIT_FAILED;
+       if (bAlertable)
+       {
+               /* TODO: Implement */
+               WLog_ERR(TAG, "%s: Not implemented: bAlertable", __FUNCTION__);
+               return WAIT_FAILED;
+       }
+       return WaitForSingleObject(hHandle, dwMilliseconds);
 }
 
 DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAll,
@@ -564,6 +568,13 @@ DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAl
 DWORD WaitForMultipleObjectsEx(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAll,
                                DWORD dwMilliseconds, BOOL bAlertable)
 {
+       if (bAlertable)
+       {
+               /* TODO: Implement */
+               WLog_ERR(TAG, "%s: Not implemented: bAlertable", __FUNCTION__);
+               return WAIT_FAILED;
+       }
+
        return WaitForMultipleObjects(nCount, lpHandles, bWaitAll, dwMilliseconds);
 }