Welcome to Vista Banter. You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to ask questions and reply to others posts, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact support. |
|
Security and Windows Vista A forum for discussion on security issues with Windows Vista. (microsoft.public.windows.vista.security) |
|
LinkBack | Thread Tools | Display Modes |
|
|||
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! |
|
|||
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" wrote in message ... 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! |
|
|||
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 an Application 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" wrote in message ... 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" wrote in message ... 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! |