QueryContextAttributesExA function (sspi.h)
Enables a transport application to query a security package for certain attributes of a security context.
Syntax
SECURITY_STATUS SEC_ENTRY QueryContextAttributesExA(
[in] PCtxtHandle phContext,
[in] unsigned long ulAttribute,
[out] void *pBuffer,
[in] unsigned long cbBuffer
);
Parameters
[in] phContext
A handle to the security context to be queried.
[in] ulAttribute
Specifies the attribute of the context to be returned. This parameter can be one of the following values.
Value | Meaning |
---|---|
|
The pBuffer parameter contains a pointer to a SecPkgContext_AccessToken structure.
Returns a handle to the access token. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_SessionAppData structure.
Returns or specifies application data for the session. This attribute is supported only by the Schannel security package. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_Authority structure.
Queries the name of the authenticating authority. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_ClientSpecifiedTarget structure that represents the service principal name (SPN) of the initial target supplied by the client.
Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_ConnectionInfo structure.
Returns detailed information on the established connection. This attribute is supported only by the Schannel security package. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_ClientCreds structure that specifies client credentials.
If the client credential is user name and password, the buffer is a packed KERB_INTERACTIVE_LOGON structure. If the client credential is user name and smart card PIN, the buffer is a packed KERB_CERTIFICATE_LOGON structure. If the client credential is an online identity credential, the buffer is a marshaled SEC_WINNT_AUTH_IDENTITY_EX2 structure. This attribute is supported only on the CredSSP server. Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_DceInfo structure.
Queries for authorization data used by DCE services. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_Bindings structure that specifies channel binding information.
This attribute is supported only by the Schannel security package. Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_EapKeyBlock structure.
Queries for key data used by the EAP TLS protocol. This attribute is supported only by the Schannel security package. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_Flags structure.
Returns information about the negotiated context flags. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_IssuerListInfoEx structure.
Returns a list of certificate issuers that are accepted by the server. This attribute is supported only by the Schannel security package. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_KeyInfo structure.
Queries information about the keys used in a security context. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_LastClientTokenStatus structure that specifies whether the token from the most recent call to the InitializeSecurityContext function is the last token from the client.
This value is supported only by the Negotiate, Kerberos, and NTLM security packages. Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_Lifespan structure.
Queries the life span of the context. |
|
The pBuffer parameter contains a pointer to a PCCERT_CONTEXT structure.
Finds a certificate context that contains a local end certificate. This attribute is supported only by the Schannel security package. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_LocalCredentialInfo structure. (obsolete)
Superseded by SECPKG_ATTR_LOCAL_CERT_CONTEXT. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_Names structure.
Queries the name associated with the context. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_NativeNames structure.
Returns the principal name (CNAME) from the outbound ticket. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_NegotiationInfo structure.
Returns information about the security package to be used with the negotiation process and the current state of the negotiation for the use of that package. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_PackageInfo structure.
Returns information on the SSP in use. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_PasswordExpiry structure.
Returns password expiration information. |
|
The pBuffer parameter contains a pointer to a PCCERT_CONTEXT structure.
Finds a certificate context that contains the end certificate supplied by the server. This attribute is supported only by the Schannel security package. |
|
The pBuffer parameter contains a pointer to a HCERTCONTEXT. Finds a certificate context that contains a certificate supplied by the Root store. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_SessionKey structure.
Returns information about the session keys. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_SessionInfo structure.
Returns information about the session. Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported. This attribute is supported only by the Schannel security package. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_Sizes structure.
Queries the sizes of the structures used in the per-message functions. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_StreamSizes structure.
Queries the sizes of the various parts of a stream used in the per-message functions. This attribute is supported only by the Schannel security package. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_SubjectAttributes structure.
This value returns information about the security attributes for the connection. This value is supported only on the CredSSP server. Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_SupportedSignatures structure.
This value returns information about the signature types that are supported for the connection. This value is supported only by the Schannel security package. Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_TargetInformation structure.
Returns information about the name of the remote server. |
|
The pBuffer parameter contains a pointer to a SecPkgContext_Bindings structure that specifies channel binding information.
This value is supported only by the Schannel security package. Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported. |
[out] pBuffer
A pointer to a structure that receives the attributes. The type of structure pointed to depends on the value specified in the ulAttribute parameter.
[in] cbBuffer
The size, in bytes, of the pBuffer parameter.
Return value
If the function succeeds, the return value is SEC_E_OK.
If the function fails, the return value is a nonzero error code.
Remarks
Note
The sspi.h header defines QueryContextAttributesEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | sspi.h (include Security.h) |
Library | Secur32.lib |
DLL | Secur32.dll |