OpenThreadToken fails for current thread 
Author Message
 OpenThreadToken fails for current thread

Debugging my application, OpenThreadToken( GetCurrentThreadToken.... )
fails with "An attempt was made to reference a token that does not
exist" while running the executable works fine.
I assume that de{*filter*} intervention is the problem, but does somebody
know it in detail??

TIA
Christian

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Fri, 06 Dec 2002 03:00:00 GMT  
 OpenThreadToken fails for current thread
Christian,

Quote:
> Debugging my application, OpenThreadToken( GetCurrentThreadToken.... )
> fails with "An attempt was made to reference a token that does not
> exist" while running the executable works fine.
> I assume that de{*filter*} intervention is the problem, but does somebody
> know it in detail??

Unless the threads is impersonating another security context, has called
ImpersonateSelf() or has explicitly called SetThreadToken(), it's possible
(and expected) that the thread has not token associated directly with it. In
those cases, the system will use the process' token, and so should you.

--
Tomas Restrepo
http://www.*-*-*.com/



Fri, 06 Dec 2002 03:00:00 GMT  
 OpenThreadToken fails for current thread


Quote:
> Christian,
> > Debugging my application, OpenThreadToken(

GetCurrentThreadToken.... )
Quote:
> > fails with "An attempt was made to reference a token that does not
> > exist" while running the executable works fine.
> > I assume that de{*filter*} intervention is the problem, but does
somebody
> > know it in detail??

> Unless the threads is impersonating another security context, has
called
> ImpersonateSelf() or has explicitly called SetThreadToken(), it's
possible
> (and expected) that the thread has not token associated directly with
it. In
> those cases, the system will use the process' token, and so should

you.

The funny thing is, it only happens if the program runs in debug mode.
Simply starting the apllication always works.
As the error occurs in a COM-inproc server, I assume that the de{*filter*}
disables COM's impersonation and therefore no thread token is available.

Christian

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sat, 07 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. determining if current thread is main thread

2. Determine if current thread is a worker thread

3. Detecting window with current focus (even in another thread)

4. changing current thread

5. Detecting window with current focus (even in another thread)

6. wait (or sleep) for current thread

7. How to get the id of the current unnamed thread?(NT)

8. Current thread

9. Current directory of the current process

10. Firing Events from thread fail

11. __argv fails in dll when using multi-threaded msvcrt dll's

12. Connect() fails in worker thread???

 

 
Powered by phpBB® Forum Software