CAccessToken::CreatePrimaryToken
Call this method to create a new primary token.
bool CreatePrimaryToken(
CAccessToken* pPri,
DWORD dwDesiredAccess = MAXIMUM_ALLOWED,
const CSecurityAttributes* pTokenAttributes = NULL
) const throw(...);
Параметры
pPri
Pointer to the new CAccessToken object.dwDesiredAccess
Specifies the requested access rights for the new token. The default, MAXIMUM_ALLOWED, requests all access rights that are valid for the caller. See Access Rights and Access Masks for more on access rights.pTokenAttributes
Pointer to a SECURITY_ATTRIBUTES structure that specifies a security descriptor for the new token and determines whether child processes can inherit the token. If pTokenAttributes is NULL, the token gets a default security descriptor and the handle cannot be inherited.
Возвращаемое значение
Returns true on success, false on failure.
Заметки
CreatePrimaryToken calls DuplicateTokenEx to create a new primary token.
Требования
Header: atlsecurity.h