I've got this weird problem - I'm calling ChangeServiceConfig
on a newly installed service (I CreateService
it myself) to supply the logon credentials, but while the function succeeds (returns TRUE), if I try to start the service, it fails with a 1069 (logon failed). If I go into the service manager and modify credentials by hand (I can see the user name is correct, but of course can't see the password), then it's all ok and it starts ok.
The call itself is trivial:
ChangeServiceConfig(hService, SERVICE_NO_CHANGE, SERVICE_NO_CHANGE, SERVICE_NO_CHANGE, NULL, NULL, NULL, NULL, strUser, strPassword, NULL);
Any ideas on where I should be looking and what could be wrong?
Thanks in advance.