
12-08-2006
|
|
|
|
Re: OpenSCManager fails access denied
I was mistaken in where the error is occurring.
It is not in the OpenSCManager() call, it is actually occuirring in my next
call:
DWORD dwDesiredAccess = SERVICE_CHANGE_CONFIG | SERVICE_START |
SERVICE_QUERY_STATUS | SERVICE_PAUSE_CONTINUE;
hService = ::OpenService(hSCManager, _T("Schedule"), dwDesiredAccess);
The code is trying to open the Task Scheduler service. This was possible on
XP, but is no longer working on vista.
I noticed that the Task Scheduler service appears to be special when looking
at it in the Services applet - all fields are disabled. Perhaps even the
administrator user has limited access to it? Perhaps the
SERVICE_CHANGE_CONFIG access is just invalid now for this service?
Does anyone have any more info on this?
"Dave G" <nospam@nospam.com> wrote in message
news:%231ZEZpkGHHA.3468@TK2MSFTNGP04.phx.gbl...
> I have an application on Vista that calls OpenSCManager():
>
> hSCManager = ::OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
> and is returning access denied.
>
> This happens even if I am logged in as a user in the Administrators group
> and run the program set to "Run as Administrator" to elevate privileges.
>
> This code runs without a problem on Windows XP.
>
> Is there some extra privilege I need? What am I missing?
>
>
>
>
>
>
>
>
>
>
|