Re: Running a console application from a service : 0x80040154
- From: "Ian Hannah" <IanHannah@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Sep 2005 01:04:02 -0700
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
>
>
>
.
- Prev by Date: Re: how to get functions from stored procedures
- Next by Date: Re: how to get functions from stored procedures
- Previous by thread: Re: How to get and set OleDb Connection access mode?
- Next by thread: Re: Export SQL Data into Excel
- Index(es):
Relevant Pages
|
Loading