|
|
|
date: Fri, 5 Sep 2008 00:12:29 -0700 (PDT),
group: microsoft.public.platformsdk.security
back
Windows sevices and user permissions
Hi all,
I'm developing a basic windows service.
The developing environment is VC++ 6 on Win XP - SP 3.
The service is being developed as a windows console application that
supports MFC.
It is of SERVICE_WIN32_OWN_PROCESS type and is configured as
SERVICE_AUTO_START.
I've specified NULL for the lpServiceStartName parameter of the
CreateService()
function, implying a LocalSystem account for the service.
I can successfully install the service and in the services.msc
display, the logon
for the service is shown as "Local System".
I've logged into my system as a domain user and the network
administrator in my
organization reports that a domain user has local admin rights on my
system.
Now the issues are.
1. When I try to start the service from the services.msc, an error
message stating
"Error 5: Access denied" appears and the service fails to start. But
if I specify my
domain user name and pass word in the Log On tab of service properties
dialog, I can
sucessfully start service.
2. If I delete the service programatically using DeleteService, the
service does not
disappear from the services.msc window. Instead, it is shown as
disabled. If try to
start it from there, a message "Service marked for deletion" appears.
The service disappears from services.msc only if I restart the system.
Meanwhile, I can very well start or stop other services which have
Local system
logon.
a. Could anybody tell me what causes the above issues in my service?
Is it a issue
with my permission level?
b. Could anybody tell me how to debug the startup of a window service?
If I try to
debug from VC++ 6 IDE, the StartServiceCtrlDispatcher function fails
with
ERROR_FAILED_SERVICE_CONTROLLER_CONNECT error.
Thanks in advance.
Shaji.
date: Fri, 5 Sep 2008 00:12:29 -0700 (PDT)
author: shaji
RE: Windows sevices and user permissions
I think the problem is that your service doesn't have a name with which you
could manipulate (start / stop). Since your service is running
(auto-started), you cannot delete it until next restart - and that's exactly
what you see.
In the past I used SoftICE for service (and device driver) debugging, but
you can also use Kernel Debugger - although for that you will need a SECOND
computer connected to your test computer.
Laszlo Elteto
SafeNet, Inc.
"shaji" wrote:
> Hi all,
> I'm developing a basic windows service.
>
> The developing environment is VC++ 6 on Win XP - SP 3.
>
> The service is being developed as a windows console application that
> supports MFC.
> It is of SERVICE_WIN32_OWN_PROCESS type and is configured as
> SERVICE_AUTO_START.
>
> I've specified NULL for the lpServiceStartName parameter of the
> CreateService()
>
> function, implying a LocalSystem account for the service.
>
> I can successfully install the service and in the services.msc
> display, the logon
>
> for the service is shown as "Local System".
>
> I've logged into my system as a domain user and the network
> administrator in my
>
> organization reports that a domain user has local admin rights on my
> system.
>
> Now the issues are.
>
> 1. When I try to start the service from the services.msc, an error
> message stating
>
> "Error 5: Access denied" appears and the service fails to start. But
> if I specify my
>
> domain user name and pass word in the Log On tab of service properties
> dialog, I can
>
> sucessfully start service.
>
> 2. If I delete the service programatically using DeleteService, the
> service does not
>
> disappear from the services.msc window. Instead, it is shown as
> disabled. If try to
>
> start it from there, a message "Service marked for deletion" appears.
> The service disappears from services.msc only if I restart the system.
>
> Meanwhile, I can very well start or stop other services which have
> Local system
>
> logon.
>
> a. Could anybody tell me what causes the above issues in my service?
> Is it a issue
>
> with my permission level?
> b. Could anybody tell me how to debug the startup of a window service?
> If I try to
>
> debug from VC++ 6 IDE, the StartServiceCtrlDispatcher function fails
> with
>
> ERROR_FAILED_SERVICE_CONTROLLER_CONNECT error.
>
> Thanks in advance.
> Shaji.
>
>
date: Mon, 8 Sep 2008 09:18:01 -0700
author: lelteto
|
|