ole32: Fix RPC_GetLocalClassObject to wait for 30 seconds, even if messages arrive while we are waiting.

This commit is contained in:
Rob Shearman 2007-12-20 09:51:57 +00:00 committed by Alexandre Julliard
parent 9a888e6465
commit 93df1675f1
1 changed files with 6 additions and 1 deletions

View File

@ -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;