Re: Calling cocreateinstance from an impersonated thread




<sujilsekhar@xxxxxxxxx> wrote in message news:896af451-7a86-4bec-9b76-7ec52418e6e4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am facing one issue with the user context where com objects get
loaded. My program flow is as follows

1. I have two inproc com components say Comp1, Comp2
2. My client is an executable running in SYSTEM context
3. Client loads comp1 and is running in SYSTEM context
4. comp1 is creating a thread inside and this thread got impersonated
to a particular user context
5. This impersonated thread calls comp2 using cocreateinstance
6. My requirement is to load the comp2 in the impersonated context but
the cocreateinstance
takes the process token instead of impersonated token.

In various posts i read that for outproc servers you can overcome this
by setting security blankets. But this method is not working for
inproc severs.


CoSetSecurityBlanket is only for out-of-proc DCOM servers, and cannot work for inproc DLL's.

The only way I can see this working is to ensure that comp2 runs in the same apartment as the calling thread. The impersonated thread then can enter comp2 directly, and the security context is preserved.

HTH

Brian

.



Relevant Pages

  • Calling cocreateinstance from an impersonated thread
    ... I am facing one issue with the user context where com objects get ... I have two inproc com components say Comp1, Comp2 ...
    (microsoft.public.vc.atl)
  • Re: 3 NIC computer
    ... >seems to keep droping my connection every now and then. ... Comp1 needs routing enabled ... Comp2 may need routing enabled if you wish to forward from one ethernet ... connected interface to subnet 2 is the preferred interface. ...
    (comp.os.linux.networking)
  • System Error 5 ... Access Denied
    ... both running Windows XP Pro w/ Firewall on. ... Comp1 and Comp2 seem to be set up the same. ... All "Local Security Settings" ...
    (microsoft.public.windowsxp.network_web)
  • Re: syntax of ssh wrapper for X Windows command
    ... command line user and the connection is encrypted. ... allows logging into a comp2 Xwindows from comp1. ... You are saying it isn't possible to ssh wrap the command ...
    (comp.security.ssh)
  • Accessing Remote Win 2003 Index Server from XP/SQL Server
    ... I have IIS running on a Windows 2003 Server (comp1) and SQL Server Running on an XP machine (comp2). ... I *suspect* it has something to do with security. ...
    (microsoft.public.sqlserver.fulltext)