ole32: Cleanup return value handling in CoWaitForMultipleHandles.

This commit is contained in:
Alexandre Julliard 2011-01-21 14:51:37 +01:00
parent 75801f095d
commit 8c2a9414a6
1 changed files with 8 additions and 17 deletions

View File

@ -3646,28 +3646,19 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout,
(dwFlags & COWAIT_ALERTABLE) ? TRUE : FALSE);
}
if (res < WAIT_OBJECT_0 + cHandles)
{
/* handle signaled, store index */
*lpdwindex = (res - WAIT_OBJECT_0);
break;
}
else if (res == WAIT_TIMEOUT)
switch (res)
{
case WAIT_TIMEOUT:
hr = RPC_S_CALLPENDING;
break;
}
else if (res == WAIT_IO_COMPLETION)
{
*lpdwindex = WAIT_IO_COMPLETION;
break;
}
else
{
ERR("Unexpected wait termination: %d, %d\n", res, GetLastError());
hr = E_UNEXPECTED;
case WAIT_FAILED:
hr = HRESULT_FROM_WIN32( GetLastError() );
break;
default:
*lpdwindex = res;
break;
}
break;
}
TRACE("-- 0x%08x\n", hr);
return hr;