Module: wine Branch: master Commit: 93df1675f1cb00bc0a15bea6c50ba7c44b0706d0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=93df1675f1cb00bc0a15bea6c5...
Author: Rob Shearman rob@codeweavers.com Date: Thu Dec 20 09:51:57 2007 +0000
ole32: Fix RPC_GetLocalClassObject to wait for 30 seconds, even if messages arrive while we are waiting.
---
dlls/ole32/rpc.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c index 6760eb8..9fbff88 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -1726,6 +1726,7 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) hPipe = CreateFileW(pipefn, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); if (hPipe == INVALID_HANDLE_VALUE) { DWORD index; + DWORD start_ticks; if (tries == 1) { if ( (hres = create_local_service(rclsid)) && (hres = create_server(rclsid)) ) @@ -1733,7 +1734,11 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) } else { WARN("Connecting to %s, no response yet, retrying: le is %u\n", debugstr_w(pipefn), GetLastError()); } - CoWaitForMultipleHandles(0, 1000, 0, NULL, &index); + /* wait for one second, even if messages arrive */ + start_ticks = GetTickCount(); + do { + CoWaitForMultipleHandles(0, 1000, 0, NULL, &index); + } while (GetTickCount() - start_ticks < 1000); continue; } bufferlen = 0;