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.
// api signature:
// WINADVAPI
// BOOL
// WINAPI
// SetTokenInformation(
// _In_ HANDLE TokenHandle,
// _In_ TOKEN_INFORMATION_CLASS TokenInformationClass,
// _In_reads_bytes_(TokenInformationLength) LPVOID TokenInformation,
// _In_ DWORD TokenInformationLength
// );
//
// Note: Parameter TokenInformation gets various data, use IntPtr to your data
// Example: pass int-value to SetTokenInformation
// Alloc 4 bytes for the value
var sessionIDPtr = Marshal.AllocHGlobal(4);
// Convert value to byte[] and copy to sessionIDPtr
Marshal.Copy(BitConverter.GetBytes(sessionID), 0, sessionIDPtr, 4);
if (!api.advapi32.SetTokenInformation(hProcTokenDub, api.TOKEN_INFORMATION_CLASS.TokenSessionId, sessionIDPtr, 4))
{
Trace.TraceError("SetTokenInformation");
}
// clean allocated data
Marshal.FreeHGlobal(sessionIDPtr);
Please add some!
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).