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/databa... ============================================================================== --- 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