[SERVICES]

- If a service will be started and another service is already running in the same image, send a start command instead of starting the process again.
This enables us to run multiple services within a single process, like svchost.exe.

svn path=/trunk/; revision=53036
This commit is contained in:
Eric Kohl 2011-08-02 20:37:48 +00:00
parent 657d4463e4
commit 3d34260a62

View file

@ -218,6 +218,8 @@ ScmCreateOrReferenceServiceImage(PSERVICE pService)
pServiceImage->dwImageRunCount++;
}
DPRINT("pServiceImage->dwImageRunCount: %lu\n", pServiceImage->dwImageRunCount);
/* Link the service image to the service */
pService->lpImage = pServiceImage;
@ -1081,6 +1083,13 @@ ScmStartUserModeService(PSERVICE Service,
DPRINT("ScmStartUserModeService(%p)\n", Service);
/* If the image is already running ... */
if (Service->lpImage->dwImageRunCount > 1)
{
/* ... just send a start command */
return ScmSendStartCommand(Service, argc, argv);
}
StartupInfo.cb = sizeof(StartupInfo);
StartupInfo.lpReserved = NULL;
StartupInfo.lpDesktop = NULL;