A Windows Vista forum. Vista Banter

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.

Go Back   Home » Vista Banter forum » Microsoft Windows Vista » Security and Windows Vista
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Security and Windows Vista A forum for discussion on security issues with Windows Vista. (microsoft.public.windows.vista.security)

Vista: OpenService() returns Access Denied



 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old September 25th 06, 06:57 PM posted to microsoft.public.windows.vista.security
Mark Findlay
external usenet poster
 
Posts: 3
Default 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)  
Old September 25th 06, 11:54 PM posted to microsoft.public.windows.vista.security
Jane C
external usenet poster
 
Posts: 349
Default 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!


  #3 (permalink)  
Old September 26th 06, 09:53 PM posted to microsoft.public.windows.vista.security
Mark Findlay
external usenet poster
 
Posts: 3
Default 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!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Optimization by vBSEO 3.0.0 RC6
Copyright ©2004-2024 Vista Banter.
The comments are property of their posters.