- 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
pServiceImage->dwImageRunCount++;
}
pServiceImage->dwImageRunCount++;
}
+ DPRINT("pServiceImage->dwImageRunCount: %lu\n", pServiceImage->dwImageRunCount);
+
/* Link the service image to the service */
pService->lpImage = pServiceImage;
/* Link the service image to the service */
pService->lpImage = pServiceImage;
DPRINT("ScmStartUserModeService(%p)\n", 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;
StartupInfo.cb = sizeof(StartupInfo);
StartupInfo.lpReserved = NULL;
StartupInfo.lpDesktop = NULL;