mirror of
https://github.com/reactos/reactos.git
synced 2024-08-29 14:48:37 +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;
|
DWORD BytesRead, BytesWritten;
|
||||||
COMM_DHCP_REQ Req;
|
COMM_DHCP_REQ Req;
|
||||||
COMM_DHCP_REPLY Reply;
|
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 );
|
Result = ReadFile( CommPipe, &Req, sizeof(Req), &BytesRead, NULL );
|
||||||
if( Result ) {
|
if( Result ) {
|
||||||
switch( Req.Type ) {
|
switch( Req.Type ) {
|
||||||
|
|
|
@ -744,7 +744,8 @@ ScmStartUserModeService(PSERVICE Service,
|
||||||
ResumeThread(ProcessInformation.hThread);
|
ResumeThread(ProcessInformation.hThread);
|
||||||
|
|
||||||
/* Connect control pipe */
|
/* Connect control pipe */
|
||||||
if (ConnectNamedPipe(Service->ControlPipeHandle, NULL))
|
if (ConnectNamedPipe(Service->ControlPipeHandle, NULL) ?
|
||||||
|
TRUE : (dwError = GetLastError()) == ERROR_PIPE_CONNECTED)
|
||||||
{
|
{
|
||||||
DWORD dwProcessId = 0;
|
DWORD dwProcessId = 0;
|
||||||
DWORD dwRead = 0;
|
DWORD dwRead = 0;
|
||||||
|
@ -772,8 +773,7 @@ ScmStartUserModeService(PSERVICE Service,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dwError = GetLastError();
|
DPRINT1("Connecting control pipe failed! (Error %lu)\n", dwError);
|
||||||
DPRINT("Connecting control pipe failed!\n");
|
|
||||||
|
|
||||||
/* Close control pipe */
|
/* Close control pipe */
|
||||||
CloseHandle(Service->ControlPipeHandle);
|
CloseHandle(Service->ControlPipeHandle);
|
||||||
|
|
Loading…
Reference in a new issue