X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fbase%2Fsystem%2Fservices%2Fdatabase.c;h=2a0ae9859f9092c1c13335481fbe1b698bf5c09e;hp=9c157175483da280141e0cf9a657055a4b01e044;hb=b37ba9e7e6ca8933b4ce7a462188166175dd5108;hpb=606504c91881da7fe94a8a56593fa8940b5623ac 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