advapi32: service_control_dispatcher(): Fixed invalid pipe test to display GetLastError() before it gets overwritten.

oldstable
Tim Schwartz 2007-12-03 09:44:37 -06:00 committed by Alexandre Julliard
parent 9649ca2aa2
commit 65d2f8a68d
1 changed files with 6 additions and 6 deletions

View File

@ -686,6 +686,11 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg)
name = service_get_pipe_name(service->name);
pipe = CreateNamedPipeW(name, PIPE_ACCESS_DUPLEX,
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);
/* 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);
CloseHandle(event);
if (pipe==INVALID_HANDLE_VALUE)
{
ERR("failed to create pipe for %s, error = %d\n",
debugstr_w(service->name), GetLastError());
return 0;
}
if (pipe==INVALID_HANDLE_VALUE) return 0;
/* dispatcher loop */
while (1)