c# Programming Glossary: token_information_class
Detect if running as Administrator with or without elevated privileges? http://stackoverflow.com/questions/1220213/detect-if-running-as-administrator-with-or-without-elevated-privileges static extern bool GetTokenInformation IntPtr TokenHandle TOKEN_INFORMATION_CLASS TokenInformationClass IntPtr TokenInformation uint TokenInformationLength.. TokenInformationLength out uint ReturnLength public enum TOKEN_INFORMATION_CLASS TokenUser 1 TokenGroups TokenPrivileges TokenOwner TokenPrimaryGroup.. bool success GetTokenInformation tokenHandle TOKEN_INFORMATION_CLASS.TokenElevationType elevationTypePtr uint elevationResultSize..
How to get the logon SID in c# http://stackoverflow.com/questions/2146153/how-to-get-the-logon-sid-in-c-sharp GetTokenInformation WindowsIdentity.GetCurrent .Token TOKEN_INFORMATION_CLASS.TokenSessionId TokenInformation TokenInfLength out TokenInfLength.. I changed the example by altering just one line I replaced TOKEN_INFORMATION_CLASS.TokenUser with TOKEN_INFORMATION_CLASS.TokenSessionId which.. one line I replaced TOKEN_INFORMATION_CLASS.TokenUser with TOKEN_INFORMATION_CLASS.TokenSessionId which is exactly what you need. Hope this helps...
Process.Start with different credentials with UAC on http://stackoverflow.com/questions/2313553/process-start-with-different-credentials-with-uac-on enum TOKEN_TYPE TokenPrimary 1 TokenImpersonation 2 enum TOKEN_INFORMATION_CLASS TokenUser 1 TokenGroups TokenPrivileges TokenOwner TokenPrimaryGroup.. extern Boolean SetTokenInformation IntPtr TokenHandle TOKEN_INFORMATION_CLASS TokenInformationClass ref UInt32 TokenInformation UInt32 TokenInformationLength.. Token privilege if SetTokenInformation hUserTokenDup TOKEN_INFORMATION_CLASS.TokenSessionId ref dwSessionId UInt32 IntPtr.Size output.AppendLine..
Using Process.Start() to start a process as a different user from within a Windows Service http://stackoverflow.com/questions/362419/using-process-start-to-start-a-process-as-a-different-user-from-within-a-windo SizeConst 1 public LUID_AND_ATTRIBUTES Privileges enum TOKEN_INFORMATION_CLASS TokenUser 1 TokenGroups TokenPrivileges TokenOwner TokenPrimaryGroup.. WINAPI GetTokenInformation __in HANDLE TokenHandle __in TOKEN_INFORMATION_CLASS TokenInformationClass __out_opt LPVOID TokenInformation __in.. static extern bool GetTokenInformation IntPtr TokenHandle TOKEN_INFORMATION_CLASS TokenInformationClass IntPtr TokenInformation int TokenInformationLength..
|