Using Win32 functions in Visual FoxPro Image Gallery
Authorization
AdjustTokenPrivileges
GetTokenInformation
LookupPrivilegeDisplayName
LookupPrivilegeName
LookupPrivilegeValue
OpenProcessToken
Code examples:
Reading and setting system access privileges for the current process
GetTokenInformation
..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
Declaration:
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
Parameters:
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.
Usage:
* find the number of bytes needed for the buffer
nBufsize=0
nClass=3  && TokenPrivileges
= GetTokenInformation(hToken, nClass, NULL, 0, @nBufsize)

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

= 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  
FreeTranslation.com 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: 16
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 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.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.227.127.109)
16 sec.Function: 'MAPIFindNext'
33 sec.Function: 'SwitchDesktop'
49 sec.Function: 'ChooseFont'
1.07 min.Function: 'OpenWaitableTimer'
1.32 min.Function: 'GetFileTitle'
1.55 min.Function: 'WNetOpenEnum'
1.82 min.Function: 'MAPILogon'
2.08 min.Function: 'CM_Connect_Machine'
2.35 min.Function: 'IcmpCreateFile'
2.63 min.Function: 'inet_ntoa'
Google
Advertise here!