The QueryContextAttributes function enables a transport application to query a security package for certain attributes of a security context.
SECURITY_STATUS QueryContextAttributes(
PCtxtHandle phContext, // handle of the context to query
ULONG ulAttribute, // attribute to query
PVOID pBuffer // buffer for attributes
);
Value | Meaning |
---|---|
SECPKG_ATTR_SIZES | Query the sizes of the structures used in the per-message functions. The pBuffer parameter is a pointer to a SecPkgContext_Sizes structure. |
SECPKG_ATTR_NAMES | Query the name associated with the context. The pBuffer parameter is a pointer to a SecPkgContext_Names structure. |
SECPKG_ATTR_LIFESPAN | Query the life span of the context. pBuffer is a pointer to a SecPkgContext_Lifespan structure. |
SECPKG_ATTR_DCE_INFO | Query for authorization data used by DCE services. pBuffer is a pointer to a SecPkgContext_DceInfo structure. |
SECPKG_ATTR_STREAM_SIZES | Query the sizes of the various stream components used in the per-message functions. The pBuffer parameter is a pointer to a SecPkgContext_StreamSizes structure. |
SECPKG_ATTR_AUTHORITY | Query the name of the authenticating authority. The pBuffer parameter is a pointer to a SecPkgContext_Authority structure. |
SECPKG_ATTR_KEY_INFO | Query information about the keys used in a security context. The pBuffer parameter is a pointer to a SecPkgContext_KeyInfo structure. |
If the function succeeds, the return value is SEC_E_OK.
If the function fails, the return value is a nonzero error code.
The structure pointed to by the pBuffer parameter varies, depending on the attribute being queried. The caller must allocate the structure itself, but the package allocates other pointers that are returned in the structure. Any pointers allocated by the package can be freed by calling the FreeContextBuffer function.