Re: Running a console application from a service : 0x80040154




Thanks Steve,

I will try it out. Failing that I will try and send you some sample code. I
won't get a chance to try this until Monday unfortunately

Ian

--
Ian H


"Steve Hale" wrote:

> Since the console application runs fine when logged on as the user
> "SCA_DefaultUser" but fails when you are doing it via LogonUser API, I have
> to conclude the user's rights are sufficient. There are numerous parameters
> to LogonUser() and in particular the dwLogonType plays a role in privileges
> the logon obtains. I would try using different values for dwLogonType to
> see if that is the issue. I'm sorry that I can't give you a specific answer
> but I've never written a service like this. If you want to send a small
> repro with source I may be able to investigate further.
>
> Steve
>
> "Ian Hannah" <IanHannah@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:31D421B3-FA15-4514-AD06-0BA53BDA8BDB@xxxxxxxxxxxxxxxx
> >I have a windows service (written in C++) that is running on Windows 2003.
> > This service is running under an account called "Workflow Service".
> >
> > This service launches different components. Before launching a component
> > it
> > uses the LogonUser API to login as a particular user. The component in
> > question then runs under this account.
> >
> > One of these components is a C++ console application. This console
> > application opens a connection to a database. Before this component is
> > processed the user "SCA_DefaultUser" is logged in. This is where I am
> > getting
> > my problem.
> >
> > The line that is failing in the console application is the following:
> >
> > if (FAILED(hr = CoCreateInstance( CLSID_DataLinks, NULL,
> > CLSCTX_INPROC_SERVER, IID_IDataInitialize, reinterpret_cast<void
> > **>(&m_pIDataInit))))
> >
> > with a 0x80040154 (Class not registered) error. The dll that implements
> > this
> > (oledb32.dll) is registered on my machine.
> >
> > Things to note:
> >
> > I have tried to set the default DCOM settings on the machine to give
> > "SCA_DefaultUser" launch and access permissions. Doing this did not make
> > any
> > difference.
> >
> > I can run the console application quite happily logged in to the machine
> > as
> > "SCA_DefaultUser"
> >
> > If I make "SCA_DefaultUser" a member of local administrators of the
> > machine
> > the above line runs happily
> >
> > There is clearly a permissions issue here but I cannot seem to work it
> > out.
> >
> > --
> > Ian H
>
>
>
.



Relevant Pages

  • Re: Really tough Stored Procedure Debug Problem.
    ... "Ian" wrote in message ... > Hi Steve. ... >> Excel import, but it could also bee that one of your Excel sheets ... >>>NOT WORKING CODE ...
    (microsoft.public.sqlserver.programming)
  • Re: Geographical Spread
    ... STOKE ON TRENT, STAFFS (Ian Myatt) ... MANCHESTER (Steve Robinson) ... Also I think it would be a good idea if whichever area of the country ... Organising venue, Pa, accomodation ...
    (uk.music.guitar)
  • Re: Problems applying GPO to a client
    ... Steve, thanks for the info. ... >Moving them is the correct way to do it - right ... I don't think drag and drop works for ...
    (microsoft.public.win2000.group_policy)
  • Re: Bachmann 2006
    ... If Hornby did not leverage its recognisable brand name to ... then it would be failing in its duty as a PLC. ... > If they don't make as much profit, ... Steve ...
    (uk.rec.models.rail)
  • Re: blocked inheritance
    ... --- Steve ... >> both read and apply permissions for allow will have the GPO apply to them ... We're all domain admins in IT at the moment until i ... >>> Ian G ...
    (microsoft.public.windows.group_policy)

Loading