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.
BOOL GetTokenInformation(
HANDLE TokenHandle, |
// handle of access token |
TOKEN_INFORMATION_CLASS TokenInformationClass, |
// type of information to retrieve |
LPVOID TokenInformation, |
// address of retrieved information |
DWORD TokenInformationLength, |
// size of information buffer |
PDWORD ReturnLength |
// address of required buffer size |
); |
Token Information Class |
Structure Returned |
TokenUser |
TOKEN_USER structure. TOKEN_QUERY access is needed to retrieve this information. |
TokenGroups |
TOKEN_GROUPS structure. TOKEN_QUERY access is needed to retrieve this information. |
TokenPrivileges |
TOKEN_PRIVILEGES structure. TOKEN_QUERY access is needed to retrieve this information. |
TokenOwner |
TOKEN_OWNER structure. TOKEN_QUERY access is needed to retrieve this information. |
TokenPrimaryGroup |
TOKEN_PRIMARY_GROUP structure. TOKEN_QUERY access is needed to retrieve this information. |
TokenDefaultDacl |
TOKEN_DEFAULT_DACL structure. TOKEN_QUERY access is needed to retrieve this information. |
TokenSource |
TOKEN_SOURCE structure. TOKEN_QUERY_SOURCE access is needed to retrieve this information. |
TokenType |
TOKEN_TYPE enumerated type. TOKEN_QUERY access is needed to retrieve this information. |
TokenImpersonationLevel |
SECURITY_IMPERSONATION_LEVEL enumerated type. TOKEN_QUERY access is needed to retrieve this information about a token. If the access token is not an impersonation token, the function fails. |
TokenStatistics |
TOKEN_STATISTICS structure. TOKEN_QUERY access is needed to retrieve this information. |
The formats for the retrieved structures and enumerated types are listed in
the following Remarks section.
If the value of the TokenInformationClass parameter is TokenDefaultDacl and the token has no default access-control list, the function sets the variable pointed to by ReturnLength to zero and stores no data in the buffer.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
AdjustTokenGroups, AdjustTokenPrivileges, OpenProcessToken, OpenThreadToken, SetTokenInformation, SECURITY_IMPERSONATION_LEVEL, TOKEN_DEFAULT_DACL, TOKEN_GROUPS, TOKEN_INFORMATION_CLASS, TOKEN_OWNER, TOKEN_PRIMARY_GROUP, TOKEN_PRIVILEGES, TOKEN_SOURCE, TOKEN_STATISTICS, TOKEN_TYPE, TOKEN_USER
file: /Techref/os/win/api/win32/func/src/f41_17.htm, 8KB, , updated: 2000/4/7 11:19, local time: 2024/12/26 02:47,
3.17.174.204:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/os/win/api/win32/func/src/f41_17.htm"> GetTokenInformation</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.