mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +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
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Uncomment the line below to start services
|
||||||
|
* using the SERVICE_START_PENDING state
|
||||||
|
*/
|
||||||
|
// #define USE_SERVICE_START_PENDING
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
@ -1038,12 +1043,23 @@ ScmStartService(PSERVICE Service, DWORD argc, LPWSTR *argv)
|
||||||
/* Load driver */
|
/* Load driver */
|
||||||
dwError = ScmLoadDriver(Service);
|
dwError = ScmLoadDriver(Service);
|
||||||
if (dwError == ERROR_SUCCESS)
|
if (dwError == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
Service->Status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
|
Service->Status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
|
||||||
|
Service->Status.dwCurrentState = SERVICE_RUNNING;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Start user-mode service */
|
/* Start user-mode service */
|
||||||
dwError = ScmStartUserModeService(Service, argc, argv);
|
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);
|
DPRINT("ScmStartService() done (Error %lu)\n", dwError);
|
||||||
|
@ -1054,7 +1070,6 @@ ScmStartService(PSERVICE Service, DWORD argc, LPWSTR *argv)
|
||||||
{
|
{
|
||||||
Group->ServicesRunning = TRUE;
|
Group->ServicesRunning = TRUE;
|
||||||
}
|
}
|
||||||
Service->Status.dwCurrentState = SERVICE_RUNNING;
|
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue