forked from Mirrors/wine-wine
advapi32: service_control_dispatcher(): Fixed invalid pipe test to display GetLastError() before it gets overwritten.
parent
9649ca2aa2
commit
65d2f8a68d
|
@ -686,6 +686,11 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg)
|
||||||
name = service_get_pipe_name(service->name);
|
name = service_get_pipe_name(service->name);
|
||||||
pipe = CreateNamedPipeW(name, PIPE_ACCESS_DUPLEX,
|
pipe = CreateNamedPipeW(name, PIPE_ACCESS_DUPLEX,
|
||||||
PIPE_TYPE_BYTE|PIPE_WAIT, 1, 256, 256, 10000, NULL );
|
PIPE_TYPE_BYTE|PIPE_WAIT, 1, 256, 256, 10000, NULL );
|
||||||
|
|
||||||
|
if (pipe==INVALID_HANDLE_VALUE)
|
||||||
|
ERR("failed to create pipe for %s, error = %d\n",
|
||||||
|
debugstr_w(service->name), GetLastError());
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, name);
|
HeapFree(GetProcessHeap(), 0, name);
|
||||||
|
|
||||||
/* let the process who started us know we've tried to create a pipe */
|
/* let the process who started us know we've tried to create a pipe */
|
||||||
|
@ -693,12 +698,7 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg)
|
||||||
SetEvent(event);
|
SetEvent(event);
|
||||||
CloseHandle(event);
|
CloseHandle(event);
|
||||||
|
|
||||||
if (pipe==INVALID_HANDLE_VALUE)
|
if (pipe==INVALID_HANDLE_VALUE) return 0;
|
||||||
{
|
|
||||||
ERR("failed to create pipe for %s, error = %d\n",
|
|
||||||
debugstr_w(service->name), GetLastError());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* dispatcher loop */
|
/* dispatcher loop */
|
||||||
while (1)
|
while (1)
|
||||||
|
|
Loading…
Reference in New Issue