Group: Authorization - Library: advapi32
How to enable the SE_SHUTDOWN_NAME privilege for the application
Reading and setting system access privileges for the current process
How to load a user profile
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
); DECLARE INTEGER AdjustTokenPrivileges IN advapi32;
INTEGER TokenHandle,;
INTEGER DisableAllPrivileges,;
STRING @NewState,;
LONG BufferLength,;
INTEGER PreviousState,;
INTEGER ReturnLength 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.
If the function succeeds, the return value is nonzero.
Enabling or disabling privileges in an access token requires TOKEN_ADJUST_PRIVILEGES access.
See also: OpenProcessToken, GetTokenInformation.
Home