Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Reading and setting system access privileges for the current process
..msdn    Add comment     W32 Constants      Translate this page
Retrieves a specified type of information about an access token.
Code examples:
Reading and setting system access privileges for the current process
BOOL WINAPI GetTokenInformation(
  __in       HANDLE TokenHandle,
  __in       TOKEN_INFORMATION_CLASS TokenInformationClass,
  __out_opt  LPVOID TokenInformation,
  __in       DWORD TokenInformationLength,
  __out      PDWORD ReturnLength
FoxPro declaration:
DECLARE INTEGER GetTokenInformation IN advapi32;
    INTEGER TokenHandle,;
    INTEGER TokenInformationClass,;
    STRING @TokenInformation,;
    LONG TokenInformationLength,;
    LONG @ReturnLength
TokenHandle [in]
A handle to an access token from which information is retrieved.

TokenInformationClass [in]
Specifies a value from the TOKEN_INFORMATION_CLASS enumerated type to identify the type of information the function retrieves.

TokenInformation [out, optional]
A pointer to a buffer the function fills with the requested information.

TokenInformationLength [in]
Specifies the size, in bytes, of the buffer pointed to by the TokenInformation parameter.

ReturnLength [out]
A pointer to a variable that receives the number of bytes needed for the buffer pointed to by the TokenInformation parameter.
Return value:
If the function succeeds, the return value is nonzero.
* find the number of bytes needed for the buffer
nClass=3  && TokenPrivileges
= GetTokenInformation(hToken, nClass, NULL, 0, @nBufsize)

* allocate the buffer for the returned data
cBuffer=REPLICATE(CHR(0), nBufsize)

= GetTokenInformation(hToken, nClass, @cBuffer,;
    LEN(cBuffer), @nBufsize)
My comment:
An access token contains the security information for a logon session. The system creates an access token when a user logs on, and every process executed on behalf of the user has a copy of the token.

The token identifies the user, the user"s groups, and the user"s privileges.

See also: OpenProcessToken
Word Index links for the GetTokenInformation :
Translate this page:
  Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
Created: 2009-02-03 13:32:49
Modified: 2009-02-03 13:39:53
Visited in last 7 days: 40
User Contributed Notes:
There are no notes on this subject.

Copyright 2001-2018 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (
17 sec.Function: 'CountClipboardFormats'
33 sec.Function: 'WNetGetConnection'
51 sec.Function: 'FileTimeToLocalFileTime'
1.13 min.Function: 'MQHandleToFormatName'
1.4 min.Function: 'GetDlgCtrlID'
1.67 min.Function: 'WNetGetNetworkInformation'
1.92 min.Function: 'CeDeleteDatabase'
2.18 min.Function: 'RtlDecompressBuffer'
2.43 min.Function: 'GdipGetImageDecoders'
2.68 min.Function: 'OpenClipboard'
Advertise here!