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 , or the thread that called StartServiceCtrlDispatcher may be blocked in a control handler function. |
- 当前服务的状态设为SERVICE_START_PENDING
- 接收的控制(Controls accepted)设为0
- CheckPoint变量设为0
- WaitHint时间值设为2s
本文链接: