[DllImport("advapi32.dll", SetLastError=true)]
static extern int DuplicateToken(IntPtr ExistingTokenHandle, SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, out IntPtr DuplicateTokenHandle);
Declare Function DuplicateToken Lib "advapi32.dll" (ExistingTokenHandle As IntPtr, _
SECURITY_IMPERSONATION_LEVEL As Integer, ByRef DuplicateTokenHandle As Integer) _
As Boolean
As always, only do SetLastError=true if you actually intend to call GetLastError.
Please add some!
Please add some!
TODO