Commit 5a559f18 authored by Alexandre Julliard's avatar Alexandre Julliard

ole32: Don't continue to wait for a local server if the process has terminated.

parent 1ab83018
...@@ -1637,7 +1637,7 @@ void RPC_StartRemoting(struct apartment *apt) ...@@ -1637,7 +1637,7 @@ void RPC_StartRemoting(struct apartment *apt)
} }
static HRESULT create_server(REFCLSID rclsid) static HRESULT create_server(REFCLSID rclsid, HANDLE *process)
{ {
static const WCHAR wszLocalServer32[] = { 'L','o','c','a','l','S','e','r','v','e','r','3','2',0 }; static const WCHAR wszLocalServer32[] = { 'L','o','c','a','l','S','e','r','v','e','r','3','2',0 };
static const WCHAR embedding[] = { ' ', '-','E','m','b','e','d','d','i','n','g',0 }; static const WCHAR embedding[] = { ' ', '-','E','m','b','e','d','d','i','n','g',0 };
...@@ -1676,7 +1676,7 @@ static HRESULT create_server(REFCLSID rclsid) ...@@ -1676,7 +1676,7 @@ static HRESULT create_server(REFCLSID rclsid)
WARN("failed to run local server %s\n", debugstr_w(command)); WARN("failed to run local server %s\n", debugstr_w(command));
return HRESULT_FROM_WIN32(GetLastError()); return HRESULT_FROM_WIN32(GetLastError());
} }
CloseHandle(pinfo.hProcess); *process = pinfo.hProcess;
CloseHandle(pinfo.hThread); CloseHandle(pinfo.hThread);
return S_OK; return S_OK;
...@@ -1813,9 +1813,10 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) ...@@ -1813,9 +1813,10 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
if (hPipe == INVALID_HANDLE_VALUE) { if (hPipe == INVALID_HANDLE_VALUE) {
DWORD index; DWORD index;
DWORD start_ticks; DWORD start_ticks;
HANDLE process = 0;
if (tries == 1) { if (tries == 1) {
if ( (hres = create_local_service(rclsid)) && if ( (hres = create_local_service(rclsid)) &&
(hres = create_server(rclsid)) ) (hres = create_server(rclsid, &process)) )
return hres; return hres;
} else { } else {
WARN("Connecting to %s, no response yet, retrying: le is %u\n", debugstr_w(pipefn), GetLastError()); WARN("Connecting to %s, no response yet, retrying: le is %u\n", debugstr_w(pipefn), GetLastError());
...@@ -1823,8 +1824,16 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) ...@@ -1823,8 +1824,16 @@ HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
/* wait for one second, even if messages arrive */ /* wait for one second, even if messages arrive */
start_ticks = GetTickCount(); start_ticks = GetTickCount();
do { do {
CoWaitForMultipleHandles(0, 1000, 0, NULL, &index); if (SUCCEEDED(CoWaitForMultipleHandles(0, 1000, (process != 0),
&process, &index)) && process && !index)
{
WARN( "server for %s failed to start\n", debugstr_guid(rclsid) );
CloseHandle( hPipe );
CloseHandle( process );
return E_NOINTERFACE;
}
} while (GetTickCount() - start_ticks < 1000); } while (GetTickCount() - start_ticks < 1000);
if (process) CloseHandle( process );
continue; continue;
} }
bufferlen = 0; bufferlen = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment