mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
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
This commit is contained in:
parent
606504c918
commit
b37ba9e7e6
1 changed files with 16 additions and 1 deletions
|
@ -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 @@ 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
|
||||
|
|
Loading…
Reference in a new issue