mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 13:45:58 +00:00
[SERVICES]
- Protect whole contents of ScmStartService() with a critical section instead of just a few parts of ScmStartUserModeService(). Seems to fix the comment #8 issue of bug #5924. svn path=/trunk/; revision=50930
This commit is contained in:
parent
27b33c3045
commit
62de69219a
|
@ -922,8 +922,6 @@ ScmStartUserModeService(PSERVICE Service,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnterCriticalSection(&StartServiceCriticalSection);
|
|
||||||
|
|
||||||
/* Create '\\.\pipe\net\NtControlPipeXXX' instance */
|
/* Create '\\.\pipe\net\NtControlPipeXXX' instance */
|
||||||
swprintf(NtControlPipeName, L"\\\\.\\pipe\\net\\NtControlPipe%u", ServiceCurrent);
|
swprintf(NtControlPipeName, L"\\\\.\\pipe\\net\\NtControlPipe%u", ServiceCurrent);
|
||||||
Service->ControlPipeHandle = CreateNamedPipeW(NtControlPipeName,
|
Service->ControlPipeHandle = CreateNamedPipeW(NtControlPipeName,
|
||||||
|
@ -938,7 +936,6 @@ ScmStartUserModeService(PSERVICE Service,
|
||||||
if (Service->ControlPipeHandle == INVALID_HANDLE_VALUE)
|
if (Service->ControlPipeHandle == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to create control pipe!\n");
|
DPRINT1("Failed to create control pipe!\n");
|
||||||
LeaveCriticalSection(&StartServiceCriticalSection);
|
|
||||||
return GetLastError();
|
return GetLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -970,7 +967,6 @@ ScmStartUserModeService(PSERVICE Service,
|
||||||
Service->ControlPipeHandle = INVALID_HANDLE_VALUE;
|
Service->ControlPipeHandle = INVALID_HANDLE_VALUE;
|
||||||
|
|
||||||
DPRINT1("Starting '%S' failed!\n", Service->lpServiceName);
|
DPRINT1("Starting '%S' failed!\n", Service->lpServiceName);
|
||||||
LeaveCriticalSection(&StartServiceCriticalSection);
|
|
||||||
return dwError;
|
return dwError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1030,8 +1026,6 @@ ScmStartUserModeService(PSERVICE Service,
|
||||||
CloseHandle(ProcessInformation.hThread);
|
CloseHandle(ProcessInformation.hThread);
|
||||||
CloseHandle(ProcessInformation.hProcess);
|
CloseHandle(ProcessInformation.hProcess);
|
||||||
|
|
||||||
LeaveCriticalSection(&StartServiceCriticalSection);
|
|
||||||
|
|
||||||
return dwError;
|
return dwError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1042,6 +1036,8 @@ ScmStartService(PSERVICE Service, DWORD argc, LPWSTR *argv)
|
||||||
PSERVICE_GROUP Group = Service->lpGroup;
|
PSERVICE_GROUP Group = Service->lpGroup;
|
||||||
DWORD dwError = ERROR_SUCCESS;
|
DWORD dwError = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
EnterCriticalSection(&StartServiceCriticalSection);
|
||||||
|
|
||||||
DPRINT("ScmStartService() called\n");
|
DPRINT("ScmStartService() called\n");
|
||||||
|
|
||||||
Service->ControlPipeHandle = INVALID_HANDLE_VALUE;
|
Service->ControlPipeHandle = INVALID_HANDLE_VALUE;
|
||||||
|
@ -1072,6 +1068,7 @@ ScmStartService(PSERVICE Service, DWORD argc, LPWSTR *argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("ScmStartService() done (Error %lu)\n", dwError);
|
DPRINT("ScmStartService() done (Error %lu)\n", dwError);
|
||||||
|
LeaveCriticalSection(&StartServiceCriticalSection);
|
||||||
|
|
||||||
if (dwError == ERROR_SUCCESS)
|
if (dwError == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue