@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: Contains information about a set of privileges for an access token. !!!!C# Definitions: public const UInt32 SE_PRIVILEGE_ENABLED_BY_DEFAULT = 0x00000001; public const UInt32 SE_PRIVILEGE_ENABLED = 0x00000002; public const UInt32 SE_PRIVILEGE_REMOVED = 0x00000004; public const UInt32 SE_PRIVILEGE_USED_FOR_ACCESS = 0x80000000; public struct TOKEN_PRIVILEGES { public UInt32 PrivilegeCount; [MarshalAs(UnmanagedType.ByValArray, SizeConst=ANYSIZE_ARRAY)] public LUID_AND_ATTRIBUTES [] Privileges; } Alternate simple structure for single privilege setting: [StructLayout(LayoutKind.Sequential)] public struct TOKEN_PRIVILEGES { public UInt32 PrivilegeCount; public LUID Luid; public UInt32 Attributes; } !!!!VB Definition: Structure TOKEN_PRIVILEGES Public PrivilegeCount As Integer Public TheLuid As LUID Public Attributes As Integer End Structure !!!!User-Defined Field Types: [LUID] [LUID_AND_ATTRIBUTES] [WINNT] (for ANYSIZE_ARRAY) !!!!Notes: Do NOT define LUID as UInt64! Use the structure LUID consisted of two UInt32 because of memory alignment. !!!!VB.Net Sample Code: ' Token Privilege Dim tp As New TOKEN_PRIVILEGES tp.PrivilegeCount = 1 tp.TheLuid = luid_Restore tp.Attributes = SE_PRIVILEGE_ENABLED !!!!Alternative Managed API: Documentation: TOKEN_PRIVILEGES@msdn on MSDN
Edit Structures.TOKEN_...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.