![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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! |
My System Specs![]() |
| | #2 (permalink) |
| | 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! > |
My System Specs![]() |
| | #3 (permalink) |
| | 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! >> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Access denied: Vista from XP | Network & Sharing | |||
| Attaching to Vista shared folder from MSDOS returns Error 5: Access has been denied | Vista networking & sharing | |||
| Access Denied, Access Denied- like a broken record! | Vista General | |||
| When standard users access Vista registry remotely, Access Denied | Vista account administration | |||
| Access Denied trying to access Vista PC | Vista networking & sharing | |||