SetContextAttributes function
Enables a transport application to set attributes of a security context for a security package. This function is supported only by the Schannel security package.
Syntax
SECURITY_STATUS SEC_ENTRY SetContextAttributes(
_In_ PCtxtHandle phContext,
_In_ ULONG ulAttribute,
_In_ void *pBuffer,
_In_ ULONG cbBuffer
);
Parameters
- phContext [in]
-
A handle to the security context to be set.
- ulAttribute [in]
-
The attribute of the context to be set. This parameter can be one of the following values.
Value Meaning - SECPKG_ATTR_APP_DATA
The pBuffer parameter contains a pointer to a SecPkgContext_SessionAppData structure.
Sets application data for the session.
This attribute is supported only by the Schannel security package.
- SECPKG_ATTR_EAP_PRF_INFO
The pBuffer parameter contains a pointer to a SecPkgContext_EapPrfInfo structure.
Sets the pseudo-random function (PRF) used by the Extensible Authentication Protocol (EAP). This is the value that is returned by a call to the QueryContextAttributes (Schannel) function when SECPKG_ATTR_EAP_KEY_BLOCK is passed as the value of the ulAttribute parameter.
This attribute is supported only by the Schannel security package.
- SECPKG_ATTR_DTLS_MTU
- 34
Sets and retrieves the MTU (maximum transmission unit) value for use with DTLS. If DTLS is not enabled in a security context, this attribute is not supported.
Valid values are between 200 bytes and 64 kilobytes. The default DTLS MTU value in Schannel is 1096 bytes.
- SECPKG_ATTR_KEYING_MATERIAL_INFO
- 106
The pBuffer parameter contains a pointer to a SecPgkContext_KeyingMaterialInfo structure. The keying material export feature follows the RFC 5705 standard.
This attribute is supported only by the Schannel security package in Windows 10 and Windows Server 2016 or later versions.
- pBuffer [in]
-
A pointer to a structure that contains values to set the attributes to. The type of structure pointed to depends on the value specified in the ulAttribute parameter.
- cbBuffer [in]
-
The size, in bytes, of the pBuffer parameter.
Return value
If the function succeeds, the function returns SEC_E_OK.
If the function fails, it returns a nonzero error code. The following error code is one of the possible error codes.
| Return code | Description |
|---|---|
|
This value is returned by Schannel kernel mode to indicate that this function is not supported. |
Requirements
|
Minimum supported client |
Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
SetContextAttributesW (Unicode) and SetContextAttributesA (ANSI) |