mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 01:13:38 +00:00
Check for ERROR_PIPE_CONNECTED.
svn path=/trunk/; revision=27024
This commit is contained in:
parent
cf7825f156
commit
822527aaa7
|
@ -34,9 +34,19 @@ DWORD WINAPI PipeThreadProc( LPVOID Parameter ) {
|
|||
DWORD BytesRead, BytesWritten;
|
||||
COMM_DHCP_REQ Req;
|
||||
COMM_DHCP_REPLY Reply;
|
||||
BOOL Result, Connection;
|
||||
BOOL Result, Connected;
|
||||
|
||||
while( TRUE ) {
|
||||
Connected = ConnectNamedPipe( CommPipe, NULL ) ?
|
||||
TRUE : GetLastError() == ERROR_PIPE_CONNECTED;
|
||||
|
||||
if (!Connected) {
|
||||
DbgPrint("DHCP: Could not connect named pipe\n");
|
||||
CloseHandle( CommPipe );
|
||||
CommPipe = INVALID_HANDLE_VALUE;
|
||||
break;
|
||||
}
|
||||
|
||||
while( (Connection = ConnectNamedPipe( CommPipe, NULL )) ) {
|
||||
Result = ReadFile( CommPipe, &Req, sizeof(Req), &BytesRead, NULL );
|
||||
if( Result ) {
|
||||
switch( Req.Type ) {
|
||||
|
|
|
@ -744,7 +744,8 @@ ScmStartUserModeService(PSERVICE Service,
|
|||
ResumeThread(ProcessInformation.hThread);
|
||||
|
||||
/* Connect control pipe */
|
||||
if (ConnectNamedPipe(Service->ControlPipeHandle, NULL))
|
||||
if (ConnectNamedPipe(Service->ControlPipeHandle, NULL) ?
|
||||
TRUE : (dwError = GetLastError()) == ERROR_PIPE_CONNECTED)
|
||||
{
|
||||
DWORD dwProcessId = 0;
|
||||
DWORD dwRead = 0;
|
||||
|
@ -772,8 +773,7 @@ ScmStartUserModeService(PSERVICE Service,
|
|||
}
|
||||
else
|
||||
{
|
||||
dwError = GetLastError();
|
||||
DPRINT("Connecting control pipe failed!\n");
|
||||
DPRINT1("Connecting control pipe failed! (Error %lu)\n", dwError);
|
||||
|
||||
/* Close control pipe */
|
||||
CloseHandle(Service->ControlPipeHandle);
|
||||
|
|
Loading…
Reference in a new issue