From: Eric Kohl Date: Mon, 22 Feb 2010 23:17:03 +0000 (+0000) Subject: Split the initial status code for drivers and services. X-Git-Tag: ReactOS-0.3.11-CLT2010~8^2~96 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=b37ba9e7e6ca8933b4ce7a462188166175dd5108 Split the initial status code for drivers and services. You can easily test services by uncommenting '#define USE_SERVICE_STATUS_PENDING'. svn path=/trunk/; revision=45663 --- diff --git a/reactos/base/system/services/database.c b/reactos/base/system/services/database.c index 9c157175483..2a0ae9859f9 100644 --- a/reactos/base/system/services/database.c +++ b/reactos/base/system/services/database.c @@ -17,6 +17,11 @@ #define NDEBUG #include +/* + * Uncomment the line below to start services + * using the SERVICE_START_PENDING state + */ +// #define USE_SERVICE_START_PENDING /* GLOBALS *******************************************************************/ @@ -1038,12 +1043,23 @@ ScmStartService(PSERVICE Service, DWORD argc, LPWSTR *argv) /* 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 @@ ScmStartService(PSERVICE Service, DWORD argc, LPWSTR *argv) { Group->ServicesRunning = TRUE; } - Service->Status.dwCurrentState = SERVICE_RUNNING; } #if 0 else