Hello, Chavdar!
When creating WindowsIdentity object token passed to the constructor is
duplicated.
However, to do this as far as I remember special privileges are needed.
--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com
You wrote on Tue, 23 Oct 2007 10:21:12 -0700:
C> Hi,
C> We get this for some users and not others. We tracked it down to the
C> following:
C> Our programs are .NET 2.0. The computers exibiting the issue had .NET
C> 2.0
C> AND .NET 3.0 installed. After we uninstalled .NET 3.0 the problem
C> went away.
C> This to be is a bug somewhere in the framework - not sure
C> where....2.0 or 3.0.
C> Please help.
C> Thanks
C> "Vadym Stetsiak" wrote:
>> Hello, Chavdar!
>> Do you get this for different users? What is there in the Security
>> Audit event log?
>> --
>> With best regards, Vadym Stetsiak.
>> Blog: http://vadmyst.blogspot.com
>> You wrote on Fri, 12 Oct 2007 16:49:01 -0700:
C>>> We randomly get an error "System.ArgumentException: Invalid token
C>>> for impersonation - it cannot be duplicated" when executing
C>>> IntPtr logonToken= WindowsIdentity.GetCurrent().Token;
C>>> WindowsIdentity windowsIdentity = new WindowsIdentity(logonToken);
Chavdar - 23 Oct 2007 22:17 GMT
Hi Vadym,
1. Who/what duplicates the token?
2. Why does this work under .NET 2.0 and blows up sporadically under .NET 3.0?
Thanks in advance.
> Hello, Chavdar!
>
[quoted text clipped - 43 lines]
>
> C>>> WindowsIdentity windowsIdentity = new WindowsIdentity(logonToken);