Module: wine Branch: master Commit: 8c2a9414a6517149f7b606091bbd2fcb4adcef05 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8c2a9414a6517149f7b606091b...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Jan 21 14:51:37 2011 +0100
ole32: Cleanup return value handling in CoWaitForMultipleHandles.
---
dlls/ole32/compobj.c | 23 +++++++---------------- 1 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 5dadb18..a637439 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -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; + case WAIT_FAILED: + hr = HRESULT_FROM_WIN32( GetLastError() ); break; - } - else - { - ERR("Unexpected wait termination: %d, %d\n", res, GetLastError()); - hr = E_UNEXPECTED; + default: + *lpdwindex = res; break; } + break; } TRACE("-- 0x%08x\n", hr); return hr;