BOOL WINAPI StartService(
_In_ SC_HANDLE hService,
_In_ DWORD dwNumServiceArgs,
_In_opt_ LPCTSTR *lpServiceArgVectors
);
Return code | Description |
---|---|
|
The handle does not have the SERVICE_START access right. |
|
The handle is invalid. |
|
The service binary file could not be found. |
|
An instance of the service is already running. |
|
The database is locked. |
|
The service depends on a service that does not exist or has been marked for deletion. |
|
The service depends on another service that has failed to start. |
|
The service has been disabled. |
|
The service did not start due to a logon failure. This error occurs if the service is configured to run under an account that does not have the "Log on as a service" right. |
|
The service has been marked for deletion. |
|
A thread could not be created for the service. |
|
The process for the service was started, but it did not call StartServiceCtrlDispatcher, or the thread that called StartServiceCtrlDispatcher may be blocked in a control handler function. |
- 當前服務的狀態設為SERVICE_START_PENDING
- 接收的控制(Controls accepted)設為0
- CheckPoint變量設為0
- WaitHint時間值設為2s