[ros-diffs] [ekohl] 45663: Split the initial status code for drivers and services. You can easily test services by uncommenting '#define USE_SERVICE_STATUS_PENDING'.

ekohl at svn.reactos.org ekohl at svn.reactos.org
Tue Feb 23 00:17:03 CET 2010


Author: ekohl
Date: Tue Feb 23 00:17:03 2010
New Revision: 45663

URL: http://svn.reactos.org/svn/reactos?rev=45663&view=rev
Log:
Split the initial status code for drivers and services.

You can easily test services by uncommenting '#define USE_SERVICE_STATUS_PENDING'.

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=45663&r1=45662&r2=45663&view=diff
==============================================================================
--- trunk/reactos/base/system/services/database.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/database.c [iso-8859-1] Tue Feb 23 00:17:03 2010
@@ -17,6 +17,11 @@
 #define NDEBUG
 #include <debug.h>
 
+/*
+ * Uncomment the line below to start services
+ *  using the SERVICE_START_PENDING state
+ */
+// #define USE_SERVICE_START_PENDING
 
 /* GLOBALS *******************************************************************/
 
@@ -1038,12 +1043,23 @@
         /* Load driver */
         dwError = ScmLoadDriver(Service);
         if (dwError == ERROR_SUCCESS)
+        {
             Service->Status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
+            Service->Status.dwCurrentState = SERVICE_RUNNING;
+        }
     }
     else
     {
         /* Start user-mode service */
         dwError = ScmStartUserModeService(Service, argc, argv);
+        if (dwError == ERROR_SUCCESS)
+        {
+#ifdef USE_SERVICE_START_PENDING
+            Service->Status.dwCurrentState = SERVICE_START_PENDING;
+#else
+            Service->Status.dwCurrentState = SERVICE_RUNNING;
+#endif
+        }
     }
 
     DPRINT("ScmStartService() done (Error %lu)\n", dwError);
@@ -1054,7 +1070,6 @@
         {
             Group->ServicesRunning = TRUE;
         }
-        Service->Status.dwCurrentState = SERVICE_RUNNING;
     }
 #if 0
     else




More information about the Ros-diffs mailing list