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 OpenProcessToken(
__in HANDLE ProcessHandle,
__in DWORD DesiredAccess,
__out PHANDLE TokenHandle
);
DECLARE INTEGER OpenProcessToken IN advapi32;
INTEGER ProcessHandle,;
LONG DesiredAccess,;
INTEGER @TokenHandle
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.
If the function succeeds, the return value is nonzero.
The process must have the PROCESS_QUERY_INFORMATION access permission.
Close the access token handle returned through the TokenHandle parameter by calling CloseHandle.