Re: Works now ... Re: How to start service programmatically ?

From: thatsalok (thatsalok_at_NO_gmail.com_I_DONT_NEED_SPAM)
Date: 03/30/05


Date: Wed, 30 Mar 2005 10:19:43 +0530

Are you creating service every time before starting!!!!!, better use
OpenService(...) api to get valid handle of service then pass it on
StartService(...) api.

--
With Regards
Alok Gupta
Visit me at http://alok.bizhat.com
                           "I Believe this will Help"
"Polaris" <etpolaris@hotmail.com> wrote in message
news:#dxHhmJNFHA.1176@TK2MSFTNGP12.phx.gbl...
> Hi:
> I tried the code again and it worked! I do not know why, the only thing I
> can think of is that I rebooted the machine and that might re-set the
> service control manager.
>
> Thanks
> Polaris
>
> "thatsalok" <thatsalok@NO_gmail.com_I_DONT_NEED_SPAM> wrote in message
> news:ehfDPrCNFHA.1436@TK2MSFTNGP10.phx.gbl...
> > Could you post little Code snippet ,describing extactly how are using
> > StartService(...) api?
> >  Have you tried taking valid HANDLE form OpenSCManager(...) with all
> > access.
> >
> >
> > --
> >
> > With Regards
> > Alok Gupta
> > Visit me at http://alok.bizhat.com
> >
> >                           "I Believe this will Help"
> >
> >
> > "Polaris" <etpolaris@hotmail.com> wrote in message
> > news:uRAwTcCNFHA.2252@TK2MSFTNGP15.phx.gbl...
> >> Hi:
> >>
> >> I wrote a service program on XP. The service can be started manually in
> > the
> >> Control Panel - Service program, but I could not start it
> > programmatically;
> >> call to StartService() returns Error message saying could not connect
to
> > the
> >> Service Control Manager.
> >>
> >> Appreciate any hits from you!
> >>
> >> Thanks in Advance
> >> Polaris
> >>
> >>
> >
> >
>
>


Relevant Pages

  • Works now ... Re: How to start service programmatically ?
    ... > With Regards ... > Alok Gupta ... >> I wrote a service program on XP. ... >> Service Control Manager. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Network cable unplugged
    ... > Ok so far we had API, WMI, how about going low level to NDIS? ... > Best regards, ... >> through various news groups and the MS API, ...
    (microsoft.public.windowsxp.embedded)
  • Re: Impersonate a user from a service
    ... > that when call an API to the get the cursor properties ... >>> Our tool needs to extract desktop and network settings of a user by ... >>> Regards, ... >>> RaminDeja. ...
    (microsoft.public.security)
  • Re: Impersonate a user from a service
    ... > that when call an API to the get the cursor properties ... >>> Our tool needs to extract desktop and network settings of a user by ... >>> Regards, ... >>> RaminDeja. ...
    (comp.os.ms-windows.nt.admin.security)
  • Re: Impersonate a user from a service
    ... > that when call an API to the get the cursor properties ... >>> Our tool needs to extract desktop and network settings of a user by ... >>> Regards, ... >>> RaminDeja. ...
    (microsoft.public.win2000.security)