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>>> 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);