Fix a few serious race conditions in the OLE object pipe server.
This commit is contained in:
parent
9f58ee709d
commit
e42d8aef24
|
@ -1094,29 +1094,23 @@ _LocalServerThread(LPVOID param) {
|
|||
}
|
||||
IStream_Release(pStm);
|
||||
|
||||
while (1) {
|
||||
hPipe = CreateNamedPipeA(
|
||||
pipefn,
|
||||
PIPE_ACCESS_DUPLEX,
|
||||
PIPE_TYPE_BYTE|PIPE_WAIT,
|
||||
PIPE_UNLIMITED_INSTANCES,
|
||||
4096,
|
||||
4096,
|
||||
NMPWAIT_USE_DEFAULT_WAIT,
|
||||
NULL
|
||||
);
|
||||
if (hPipe == INVALID_HANDLE_VALUE) {
|
||||
FIXME("pipe creation failed for %s, le is %lx\n",pipefn,GetLastError());
|
||||
return 1;
|
||||
}
|
||||
if (!ConnectNamedPipe(hPipe,NULL)) {
|
||||
ERR("Failure during ConnectNamedPipe %lx, ABORT!\n",GetLastError());
|
||||
CloseHandle(hPipe);
|
||||
continue;
|
||||
}
|
||||
WriteFile(hPipe,buffer,buflen,&res,NULL);
|
||||
CloseHandle(hPipe);
|
||||
hPipe = CreateNamedPipeA( pipefn, PIPE_ACCESS_DUPLEX,
|
||||
PIPE_TYPE_BYTE|PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
|
||||
4096, 4096, NMPWAIT_USE_DEFAULT_WAIT, NULL );
|
||||
if (hPipe == INVALID_HANDLE_VALUE) {
|
||||
FIXME("pipe creation failed for %s, le is %lx\n",pipefn,GetLastError());
|
||||
return 1;
|
||||
}
|
||||
while (1) {
|
||||
if (!ConnectNamedPipe(hPipe,NULL)) {
|
||||
ERR("Failure during ConnectNamedPipe %lx, ABORT!\n",GetLastError());
|
||||
break;
|
||||
}
|
||||
WriteFile(hPipe,buffer,buflen,&res,NULL);
|
||||
FlushFileBuffers(hPipe);
|
||||
DisconnectNamedPipe(hPipe);
|
||||
}
|
||||
CloseHandle(hPipe);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -512,6 +512,7 @@ HRESULT create_marshalled_proxy(REFCLSID rclsid, REFIID iid, LPVOID *ppv) {
|
|||
WINE_StringFromCLSID(rclsid,pipefn+strlen(PIPEPREF));
|
||||
|
||||
while (tries++<MAXTRIES) {
|
||||
WaitNamedPipeA( pipefn, NMPWAIT_WAIT_FOREVER );
|
||||
hPipe = CreateFileA(
|
||||
pipefn,
|
||||
GENERIC_READ|GENERIC_WRITE,
|
||||
|
|
Loading…
Reference in New Issue