Using Win32 functions in Visual FoxPro Image Gallery
Authorization
AdjustTokenPrivileges
GetTokenInformation
LookupPrivilegeDisplayName
LookupPrivilegeName
LookupPrivilegeValue
OpenProcessToken
Code examples:
How to enable the SE_SHUTDOWN_NAME privilege for the application
How to load a user profile
Reading and setting system access privileges for the current process
OpenProcessToken
..msdn    Add comment     W32 Constants      Translate this page
Opens the access token associated with a process.
Code examples:
How to load a user profile
How to enable the SE_SHUTDOWN_NAME privilege for the application
Reading and setting system access privileges for the current process
Declaration:
BOOL WINAPI OpenProcessToken(
  __in   HANDLE ProcessHandle,
  __in   DWORD DesiredAccess,
  __out  PHANDLE TokenHandle
);
FoxPro declaration:
DECLARE INTEGER OpenProcessToken IN advapi32;
    INTEGER ProcessHandle,;
    LONG DesiredAccess,;
    INTEGER @TokenHandle
Parameters:
ProcessHandle [in]
A handle to the process whose access token is opened.

DesiredAccess [in]
Specifies an access mask that specifies the requested types of access to the access token.

TokenHandle [out]
A pointer to a handle that identifies the newly opened access token when the function returns.
Return value:
If the function succeeds, the return value is nonzero.
Usage:
LOCAL hProcess, hToken, nResult

hProcess=GetCurrentProcess()
nAccessFlags=BITOR(TOKEN_ADJUST_PRIVILEGES, TOKEN_QUERY)

hToken=0
nResult = OpenProcessToken(hProcess,;
    nAccessFlags, @hToken)

IF nResult = 0
    ? "OpenProcessToken call failed:", GetLastError()
    RETURN
ENDIF
My comment:
The process must have the PROCESS_QUERY_INFORMATION access permission.

Close the access token handle returned through the TokenHandle parameter by calling CloseHandle.
Word Index links for the OpenProcessToken :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2009-02-02 11:24:00
Modified: 2009-02-02 13:19:59
Visited in last 7 days: 43
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.83.122.227)
14 sec.Function: 'CharLower'
28 sec.
Function group: 'Coordinate Space and Transformation'
42 sec.Function: 'GetPriorityClipboardFormat'
56 sec.Function: 'DefWindowProc'
1.17 min.Function: 'GetCurrentThread'
1.38 min.Function: 'PathGetShortPath'
1.6 min.Function: 'OpenEventLog'
1.83 min.
Function group: 'Hook'
2.08 min.Function: 'CeRapiInit'
2.32 min.Function: 'EnumProcesses'
Google
Advertise here!