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
AdjustTokenPrivileges
..msdn    Add comment     W32 Constants      Translate this page
Enables or disables privileges in the specified access token.
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 AdjustTokenPrivileges(
  __in       HANDLE TokenHandle,
  __in       BOOL DisableAllPrivileges,
  __in_opt   PTOKEN_PRIVILEGES NewState,
  __in       DWORD BufferLength,
  __out_opt  PTOKEN_PRIVILEGES PreviousState,
  __out_opt  PDWORD ReturnLength
);
FoxPro declaration:
DECLARE INTEGER AdjustTokenPrivileges IN advapi32;
    INTEGER TokenHandle,;
    INTEGER DisableAllPrivileges,;
    STRING @NewState,;
    LONG BufferLength,;
    INTEGER PreviousState,;
    INTEGER ReturnLength
Parameters:
TokenHandle [in]
A handle to the access token that contains the privileges to be modified. The handle must have TOKEN_ADJUST_PRIVILEGES access to the token.

DisableAllPrivileges [in]
Specifies whether the function disables all of the token"s privileges.

NewState [in, optional]
A pointer to a TOKEN_PRIVILEGES structure that specifies an array of privileges and their attributes.

BufferLength [in]
Specifies the size, in bytes, of the buffer pointed to by the PreviousState parameter.

PreviousState [out, optional]
A pointer to a buffer that the function fills with a TOKEN_PRIVILEGES structure that contains the previous state of any privileges that the function modifies.

ReturnLength [out, optional]
A pointer to a variable that receives the required size, in bytes, of the buffer pointed to by the PreviousState parameter.
Return value:
If the function succeeds, the return value is nonzero.
Usage:
nResult = AdjustTokenPrivileges(hToken, 0,;
    @cTokenPrivileges, LEN(cTokenPrivileges),;
    0, 0)
My comment:
Enabling or disabling privileges in an access token requires TOKEN_ADJUST_PRIVILEGES access.

See also: OpenProcessToken, GetTokenInformation
Word Index links for the AdjustTokenPrivileges :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2009-02-02 13:35:04
Modified: 2009-02-02 13:41:15
Visited in last 7 days: 22
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.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.162.154.91)
13 sec.Function: 'DrawFrameControl'
26 sec.Function: 'DestroyIcon'
39 sec.Function: 'CryptGetProvParam'
53 sec.Function: 'GetClipCursor'
1.08 min.Function: 'EnumPrinterData'
1.32 min.Function: 'GdiSetBatchLimit'
1.53 min.Function: 'EnableWindow'
1.75 min.Function: 'FindFirstUrlCacheEntry'
1.95 min.Function: 'GetClipboardViewer'
2.13 min.
Function group: 'Version Information'
Google
Advertise here!