Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista security

Vista - OpenSCManager fails access denied

Reply
 
Old 12-07-2006   #1 (permalink)
Dave G


 
 

OpenSCManager fails access denied

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?











My System SpecsSystem Spec
Old 12-08-2006   #2 (permalink)
Dave G


 
 

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?
>
>
>
>
>
>
>
>
>
>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
DHCP Service Fails to Start with "Access Denied" Error Vista networking & sharing
Backup Fails - Error 0x80070005 Access Denied Vista General
Re: 'Vista backup fails - access is denied' - QUICK FIX & broader issu Vista General
Service startup fails with "Access Denied" after Win2K3 domain joi Vista networking & sharing
Service Startup fails with "Access denied" Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46