|
SecurityHelperGetTokenInformation Method |
The GetTokenInformation function retrieves a specified type of information about an access
token. The calling process must have appropriate access rights to obtain the information.
GetTokenInformation function Namespace: Xcalibur.NativeMethods.V2.SecurityAssembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax [DllImportAttribute("advapi32.dll", SetLastError = true)]
public static bool GetTokenInformation(
IntPtr tokenHandle,
TokenInformationClass tokenInformationClass,
IntPtr tokenInformation,
uint tokenInformationLength,
out uint returnLength
)
<DllImportAttribute("advapi32.dll", SetLastError := true>]
Public Shared Function GetTokenInformation (
tokenHandle As IntPtr,
tokenInformationClass As TokenInformationClass,
tokenInformation As IntPtr,
tokenInformationLength As UInteger,
<OutAttribute> ByRef returnLength As UInteger
) As Boolean
public:
[DllImportAttribute(L"advapi32.dll", SetLastError = true)]
static bool GetTokenInformation(
IntPtr tokenHandle,
TokenInformationClass tokenInformationClass,
IntPtr tokenInformation,
unsigned int tokenInformationLength,
[OutAttribute] unsigned int% returnLength
)
[<DllImportAttribute("advapi32.dll", SetLastError = true)>]
static member GetTokenInformation :
tokenHandle : IntPtr *
tokenInformationClass : TokenInformationClass *
tokenInformation : IntPtr *
tokenInformationLength : uint32 *
returnLength : uint32 byref -> bool
Parameters
- tokenHandle IntPtr
- A handle to an access token from which information is retrieved.
If specifies TokenSource, the handle must have
access. For all other
values, the handle must have
access.
- tokenInformationClass TokenInformationClass
- Specifies a value from the
enumerated type to identify the type of information
the function retrieves. Any callers who check the
and have it return 0 should
also verify that the caller token is not an identify level impersonation token. If the
current token is not an app container but is an identity level token, you should return
AccessDenied.
- tokenInformation IntPtr
- A pointer to a buffer the function fills with the requested
information. The structure put into this buffer depends upon the type of information
specified by the parameter.
- tokenInformationLength UInt32
- Specifies the size, in bytes, of the buffer pointed to
by the TokenInformation parameter. If TokenInformation is NULL, this parameter must be zero.
- returnLength UInt32
- A pointer to a variable that receives the number of bytes needed
for the buffer pointed to by the TokenInformation parameter. If this value is larger than
the value specified in the TokenInformationLength parameter, the function fails and stores
no data in the buffer.
Return Value
BooleanIf the function succeeds, the return value is nonzero. To determine whether the
function adjusted all of the specified privileges, call
.
See Also