当前位置: 动力学知识库 > 问答 > 编程问答 >

visual c++ - Windows Starting a service returns ERROR_SERVICE_DISABLED

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: