please dont rip this site Prev Next

GetTokenInformation info  Overview  Group

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

   );

Parameters

TokenHandle
Identifies an access token from which information is retrieved.
TokenInformationClass
Specifies a variable of the TOKEN_INFORMATION_CLASS enumerated type identifying the type of information the function retrieves.
TokenInformation
Points 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 TokenInformationClass parameter, as shown in the following list:

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.

TokenInformationLength
Specifies the size, in bytes, of the buffer pointed to by the TokenInformation parameter.
ReturnLength
Points to a variable receiving the actual 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.

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.

Return Values

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.

See Also

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/11/13 19:21,
TOP NEW HELP FIND: 
18.221.102.63: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?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://sxlist.com/Techref/os/win/api/win32/func/src/f41_17.htm"> GetTokenInformation</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 
Quick, Easy and CHEAP! RCL-1 RS232 Level Converter in a DB9 backshell
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .