Funzione SeQueryInformationToken (ntifs.h)

La routine SeQueryInformationToken recupera un tipo specificato di informazioni su un token di accesso. Per ottenere le informazioni, il processo chiamante deve disporre dei diritti di accesso appropriati.

Sintassi

NTSTATUS SeQueryInformationToken(
  [in]  PACCESS_TOKEN           Token,
  [in]  TOKEN_INFORMATION_CLASS TokenInformationClass,
  [out] PVOID                   *TokenInformation
);

Parametri

[in] Token

Puntatore a un token di accesso da cui recuperare le informazioni. Se TokenInformationClass è impostato su TokenSource, l'handle deve avere accesso TOKEN_QUERY_SOURCE. Per tutti gli altri valori TokenInformationClass , l'handle deve avere accesso TOKEN_QUERY.

[in] TokenInformationClass

Valore del tipo enumerato TOKEN_INFORMATION_CLASS che identifica il tipo di informazioni da recuperare.

[out] TokenInformation

Se STATUS_SUCCESS viene restituito, TokenInformation riceve un puntatore a una posizione contenente l'indirizzo di un buffer che contiene le informazioni richieste. Il formato di questo buffer di informazioni dipende dal valore di TokenInformationClass, come illustrato nella tabella seguente. Tenere presente che il buffer viene allocato da SeQueryInformationToken dal pool di paging. Questo buffer deve essere infine liberato dal chiamante usando ExFreePool.

Valore Descrizione
TokenDefaultDacl Il buffer riceve una struttura TOKEN_DEFAULT_DACL che contiene l'elenco DACL predefinito per gli oggetti appena creati.
TokenGroups Il buffer riceve una struttura TOKEN_GROUPS che contiene gli account di gruppo associati al token.
TokenImpersonationLevel Il buffer riceve un valore SECURITY_IMPERSONATION_LEVEL che indica il livello di rappresentazione del token. Se il token di accesso non è un token di rappresentazione, la chiamata a SeQueryInformationToken ha esito negativo.
TokenOwner Il buffer riceve una struttura TOKEN_OWNER che contiene l'identificatore di sicurezza del proprietario predefinito (SID) per gli oggetti appena creati.
TokenPrimaryGroup Il buffer riceve una struttura TOKEN_PRIMARY_GROUP che contiene il SID del gruppo primario predefinito per gli oggetti appena creati.
TokenPrivileges Il buffer riceve una struttura TOKEN_PRIVILEGES che contiene i privilegi del token.
TokenSessionId Il buffer riceve un valore DWORD (non un puntatore) che indica l'identificatore di sessione di Servizi terminal associato al token. Se il token è associato alla sessione della console terminal Server, l'identificatore di sessione è zero. Un identificatore di sessione diverso da zero indica una sessione client di Servizi terminal. In un ambiente non Terminal Services l'identificatore di sessione è zero.
TokenSource Il buffer riceve una struttura TOKEN_SOURCE che contiene l'origine del token. TOKEN_QUERY_SOURCE l'accesso è necessario per recuperare queste informazioni.
TokenStatistics Il buffer riceve una struttura TOKEN_STATISTICS che contiene varie statistiche del token.
TokenType Il buffer riceve un valore TOKEN_TYPE che indica se il token è un token primario o di rappresentazione.
TokenUser Il buffer riceve una struttura TOKEN_USER che contiene l'account utente del token.
TokenIntegrityLevel Il buffer riceve un valore DWORD (non un puntatore) che specifica il livello di integrità del token.

Valore restituito

Codice restituito Descrizione
STATUS_SUCCESS
La chiamata a SeQueryInformationToken ha avuto esito positivo.
STATUS_INVALID_INFO_CLASS
È stato fornito un valore non valido per TokenInformationClass.

Commenti

Per altre informazioni sulla sicurezza e sul controllo di accesso, vedere Modello di sicurezza di Windows per sviluppatori di driver e la documentazione su questi argomenti in Windows SDK.

Requisiti

Requisito Valore
Client minimo supportato Windows 2000
Piattaforma di destinazione Universale
Intestazione ntifs.h (include Ntifs.h)
Libreria NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL

Vedi anche

PsDereferenceImpersonationToken

PsDereferencePrimaryToken

SECURITY_IMPERSONATION_LEVEL

SID

SeQueryAuthenticationIdToken

SeQuerySubjectContextToken

SeTokenIsAdmin

SeTokenIsRestricted

TOKEN_DEFAULT_DACL

TOKEN_GROUPS

TOKEN_INFORMATION_CLASS

TOKEN_OWNER

TOKEN_PRIMARY_GROUP

TOKEN_PRIVILEGES

TOKEN_SOURCE

TOKEN_STATISTICS

TOKEN_TYPE

TOKEN_USER