CreateService的 第十二个参数怎么用? - C++ Builder / Windows SDK/API
SC_HANDLE CreateService(
SC_HANDLE hSCManager, // handle to SCM database
LPCTSTR lpServiceName, // name of service to start
LPCTSTR lpDisplayName, // display name
DWORD dwDesiredAccess, // type of access to service
DWORD dwServiceType, // type of service
DWORD dwStartType, // when to start service
DWORD dwErrorControl, // severity of service failure
LPCTSTR lpBinaryPathName, // name of binary file
LPCTSTR lpLoadOrderGroup, // name of load ordering group
LPDWORD lpdwTagId, // tag identifier
LPCTSTR lpDependencies, // array of dependency names
LPCTSTR lpServiceStartName, // account name
LPCTSTR lpPassword // account password
);
看了MSDN。还是不太会。
我需要最高权限。不要NULL,
LPCTSTR lpServiceStartName, // account name
LPCTSTR lpPassword // account password
这2个参数该如何设置?谢谢了
给个例子吧。万分感谢
[解决办法]
LPCTSTR lpServiceStartName,
//服务需要在哪个帐号下运行, "If this parameter is NULL, CreateService uses the LocalSystem account. "系统帐号的权限已经够高了吧
LPCTSTR lpPassword // account password
//如果是LocalService, NetworkService, or LocalSystem 帐号,用NULL