|
SC_LOCK sclLock;
sclLock = LockServiceDatabase(scm);
if (sclLock == NULL)
{
if (GetLastError() != ERROR_SERVICE_DATABASE_
LOCKED)
Printf("LockServiceDatabase error\n");
} if (! ChangeServiceConfig(
service, // handle of service
SERVICE_NO_CHANGE, // service type: no change
SERVICE_DISABLED, // 这里做了更改
SERVICE_NO_CHANGE, // error control: no change
NULL, // binary path: no change
NULL, // load order group: no change
NULL, // tag ID: no change
NULL, // dependencies: no change
NULL, // account name: no change
NULL, // password: no change
NULL)) //displayname
{Printf("ChangeServiceConfig error!\n"); }
UnlockServiceDatabase(sclLock); |