![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Vista: OpenService() returns Access Denied Our win32 app opens the Task Scheduler to enumerate tasks as follows: SC_HANDLE hSC = NULL; SC_HANDLE hSchSvc = NULL; hSC = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); if (hSC == NULL) return GetLastError(); hSchSvc = OpenService(hSC, "Schedule", SERVICE_START | SERVICE_QUERY_STATUS); This works fine on current Windows platforms, but on Microsoft Vista the OpenService fails and GetLastError() returns 5 ("Access Denied"). We get this even when the app is running under Admin context, and have also tried setting the app's security privilege to SE_DEBUG_NAME. Is this just a Vista BETA issue at this point, or is there a new security mechanism in place that we need to program for (and if so, what changes do we need to make)? Thanks! |
| | #2 (permalink) |
| Guest | Re: Vista: OpenService() returns Access Denied http://msdn.microsoft.com/windowsvis...e/default.aspx Sections on Application Compatibility and Security, which explains the new User Access Control. -- Jane, not plain 64 bit enabled :-)Batteries not included. Braincell on vacation ;-) "Mark Findlay" <mfindlay@speakeasy.org> wrote in message news:uF5JpRN4GHA.508@TK2MSFTNGP06.phx.gbl... > Our win32 app opens the Task Scheduler to enumerate tasks as follows: > > SC_HANDLE hSC = NULL; > SC_HANDLE hSchSvc = NULL; > > hSC = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); > if (hSC == NULL) return GetLastError(); > hSchSvc = OpenService(hSC, "Schedule", SERVICE_START | > SERVICE_QUERY_STATUS); > > This works fine on current Windows platforms, but on Microsoft Vista the > OpenService fails and GetLastError() returns 5 ("Access Denied"). > > We get this even when the app is running under Admin context, and have > also tried setting the app's security privilege to SE_DEBUG_NAME. > > Is this just a Vista BETA issue at this point, or is there a new security > mechanism in place that we need to program for (and if so, what changes do > we need to make)? > > Thanks! > |
| | #3 (permalink) |
| Guest | Re: Vista: OpenService() returns Access Denied Thanks Jane, I've been through a good chunk of the site you referenced and it appears that we're not in Kansas anymore It looks like I need to create anApplication Manifest and rebuild the app with this in order to enable the admin privileges necessary to execute the OpenService() call. Also, it appears that I need to rebuild with Visual Studio 7 (I am currently using Visual Studio 6) in order to include the Application Manifest. Finally, I will also need to digitally sign the application. I am going to proceed along these lines. Meanwhile, am I on the right track with this? Any other advice you would offer to a Vista novice at this point? Thanks! Mark "Jane C" <jellybean@nospam.xjgarage.org> wrote in message news:62484171-68FC-40A5-88B9-5C840FE8E6E2@microsoft.com... > http://msdn.microsoft.com/windowsvis...e/default.aspx > > Sections on Application Compatibility and Security, which explains the new > User Access Control. > > -- > Jane, not plain 64 bit enabled :-)> Batteries not included. Braincell on vacation ;-) > "Mark Findlay" <mfindlay@speakeasy.org> wrote in message > news:uF5JpRN4GHA.508@TK2MSFTNGP06.phx.gbl... >> Our win32 app opens the Task Scheduler to enumerate tasks as follows: >> >> SC_HANDLE hSC = NULL; >> SC_HANDLE hSchSvc = NULL; >> >> hSC = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); >> if (hSC == NULL) return GetLastError(); >> hSchSvc = OpenService(hSC, "Schedule", SERVICE_START | >> SERVICE_QUERY_STATUS); >> >> This works fine on current Windows platforms, but on Microsoft Vista the >> OpenService fails and GetLastError() returns 5 ("Access Denied"). >> >> We get this even when the app is running under Admin context, and have >> also tried setting the app's security privilege to SE_DEBUG_NAME. >> >> Is this just a Vista BETA issue at this point, or is there a new security >> mechanism in place that we need to program for (and if so, what changes >> do we need to make)? >> >> Thanks! >> > |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Attaching to Vista shared folder from MSDOS returns Error 5: Access has been denied | S. Johnson | Vista networking & sharing | 2 | 3 Weeks Ago 12:16 PM |
| Access Denied, Access Denied- like a broken record! | Sam | Vista General | 7 | 04-25-2008 11:54 PM |
| When standard users access Vista registry remotely, Access Denied | Gayle | Vista account administration | 1 | 10-10-2007 11:48 AM |
| Access Denied trying to access Vista PC | Ron | Vista networking & sharing | 7 | 09-30-2007 09:45 AM |
| Access denied to Vista from XP | Llew Ralph | Vista networking & sharing | 4 | 04-08-2007 05:48 PM |