[ros-diffs] [ekohl] 35768: Forgot to commit this file too! Patch based on bug report #3669 by Michael Martin (aka bugboy) <martinmnet at hotmail.com> just like the patches r35748, r35750, r35752 and r35753.

ekohl at svn.reactos.org ekohl at svn.reactos.org
Fri Aug 29 22:44:40 CEST 2008


Author: ekohl
Date: Fri Aug 29 15:44:40 2008
New Revision: 35768

URL: http://svn.reactos.org/svn/reactos?rev=35768&view=rev
Log:
Forgot to commit this file too!
 
 
Patch based on bug report #3669 by Michael Martin (aka bugboy) <martinmnet at hotmail.com> just like the patches r35748, r35750, r35752 and r35753.

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/database.c?rev=35768&r1=35767&r2=35768&view=diff
==============================================================================
--- trunk/reactos/base/system/services/database.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/database.c [iso-8859-1] Fri Aug 29 15:44:40 2008
@@ -172,10 +172,11 @@
     /* Set the resume count */
     lpService->dwResumeCount = dwResumeCount++;
 
-    /* Append service entry */
+    /* Append service record */
     InsertTailList(&ServiceListHead,
                    &lpService->ServiceListEntry);
 
+    /* Initialize the service status */
     lpService->Status.dwCurrentState = SERVICE_STOPPED;
     lpService->Status.dwControlsAccepted = 0;
     lpService->Status.dwWin32ExitCode = ERROR_SERVICE_NEVER_STARTED;
@@ -184,6 +185,42 @@
     lpService->Status.dwWaitHint = 2000; /* 2 seconds */
 
     return ERROR_SUCCESS;
+}
+
+
+VOID
+ScmDeleteServiceRecord(PSERVICE lpService)
+{
+    DPRINT1("Deleting Service %S\n", lpService->lpServiceName);
+
+    /* Delete the display name */
+    if (lpService->lpDisplayName != NULL &&
+        lpService->lpDisplayName != lpService->lpServiceName)
+        HeapFree(GetProcessHeap(), 0, lpService->lpDisplayName);
+
+    /* Decrement the image reference counter */
+    if (lpService->lpImage)
+        lpService->lpImage->dwServiceRefCount--;
+
+    /* Decrement the group reference counter */
+    if (lpService->lpGroup)
+        lpService->lpGroup->dwRefCount--;
+
+    /* FIXME: SecurityDescriptor */
+
+    /* Close the control pipe */
+    if (lpService->ControlPipeHandle != INVALID_HANDLE_VALUE)
+        CloseHandle(lpService->ControlPipeHandle);
+
+    /* Remove the Service from the List */
+    RemoveEntryList(&lpService->ServiceListEntry);
+
+    DPRINT1("Deleted Service %S\n", lpService->lpServiceName);
+
+    /* Delete the service record */
+    HeapFree(GetProcessHeap(), 0, lpService);
+
+    DPRINT1("Done\n");
 }
 
 



More information about the Ros-diffs mailing list