Author: ekohl
Date: Sun Jul 31 10:29:41 2011
New Revision: 53004
URL:
http://svn.reactos.org/svn/reactos?rev=53004&view=rev
Log:
[SERVICES]
- ScmCreateOrReferenceServiceImage: Link the SERVICE_IMAGE struct to the SERVICE struct in
the create and the reference case. Otherwise only the first service started from an image
gets a valid pImage pointer.
- Add some debug code.
Modified:
trunk/reactos/base/system/services/database.c
Modified: trunk/reactos/base/system/services/database.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/datab…
==============================================================================
--- trunk/reactos/base/system/services/database.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/database.c [iso-8859-1] Sun Jul 31 10:29:41 2011
@@ -116,7 +116,7 @@
PLIST_ENTRY ImageEntry;
PSERVICE_IMAGE CurrentImage;
- DPRINT("ScmGetServiceImageByImagePath() called\n");
+ DPRINT("ScmGetServiceImageByImagePath(%S) called\n", lpImagePath);
ImageEntry = ImageListHead.Flink;
while (ImageEntry != &ImageListHead)
@@ -149,7 +149,7 @@
NTSTATUS Status;
DWORD dwError = ERROR_SUCCESS;
- DPRINT("ScmCreateOrReferenceServiceImage()");
+ DPRINT("ScmCreateOrReferenceServiceImage(%p)\n", pService);
RtlInitUnicodeString(&ImagePath, NULL);
@@ -211,17 +211,20 @@
/* Append service record */
InsertTailList(&ImageListHead,
&pServiceImage->ImageListEntry);
-
- pService->lpImage = pServiceImage;
}
else
{
- /* Create a new service image */
- pService->lpImage->dwImageRunCount++;
- }
+ /* Increment the run counter */
+ pServiceImage->dwImageRunCount++;
+ }
+
+ /* Link the service image to the service */
+ pService->lpImage = pServiceImage;
done:;
RtlFreeUnicodeString(&ImagePath);
+
+ DPRINT("ScmCreateOrReferenceServiceImage() done (Error: %lu)\n", dwError);
return dwError;
}
@@ -1075,6 +1078,8 @@
BOOL Result;
DWORD dwError = ERROR_SUCCESS;
DWORD dwProcessId;
+
+ DPRINT("ScmStartUserModeService(%p)\n", Service);
StartupInfo.cb = sizeof(StartupInfo);
StartupInfo.lpReserved = NULL;