Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than advapi32, prefix the name with the module name and a period.
Public Declare Function GetTokenInformation Lib "advapi32.dll" ( _
ByVal TokenHandle As IntPtr, ByVal TokenInformationClass As TOKEN_INFORMATION_CLASS, _
ByVal TokenInformation As IntPtr, ByVal TokenInformationLength As System.UInt32, _
ByRef ReturnLength As System.UInt32) As Boolean
Call once with zero for the third and fourth parameters to obtain the required size, then allocate the buffer and call again supplying these parameters.
Tips & Tricks:
Please add some!
Sample Code:
// Prints out sid of current user
using System;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Text;
namespace test
{
class clsLookupAccountName
{
public struct TOKEN_USER
{
public SID_AND_ATTRIBUTES User ;
}
[StructLayout(LayoutKind.Sequential)]
public struct SID_AND_ATTRIBUTES
{
public IntPtr Sid ;
public int Attributes ;
}
// Using IntPtr for pSID insted of Byte[]
[DllImport("advapi32", CharSet=CharSet.Auto, SetLastError=true)]
static extern bool ConvertSidToStringSid(
IntPtr pSID,
out IntPtr ptrSid);
Specifies the type of information being assigned to or retrieved from an access token.
6/2/2010 8:51:40 PM - -68.231.175.154
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).