问题描述:

I have successfully created a service:

hService = CreateService(hSCManager,lpServiceName,lpDisplayName,

SERVICE_ALL_ACCESS,

SERVICE_KERNEL_DRIVER,

dwStartType,

SERVICE_ERROR_NORMAL,

lpFilePath,

NULL,

NULL,

NULL,

NULL,

NULL);

But when I try to start the service:

hService = OpenService(hSCManager, lpServiceName, SERVICE_ALL_ACCESS);

if (StartService(hService,0,NULL)== NULL){

DWORD error = GetLastError();

}

The error is equal to ERROR_SERVICE_DISABLED. How does one enable the service? This is not immediately obvious from the Windows API documentation.

相关阅读:
Top