ExportSecurityContext function (sspi.h)
The ExportSecurityContext function creates a serialized representation of a security context that can later be imported into a different process by calling
ImportSecurityContext. The process that imports the security context must be running on the same computer as the process that called ExportSecurityContext.
Syntax
KSECDDDECLSPEC SECURITY_STATUS SEC_ENTRY ExportSecurityContext(
[in] PCtxtHandle phContext,
[in] ULONG fFlags,
[out] PSecBuffer pPackedContext,
[out, optional] void **pToken
);
Parameters
[in] phContext
A handle of the security context to be exported.
[in] fFlags
This parameter can be a bitwise-OR combination of the following values.
[out] pPackedContext
A pointer to a buffer of type SECBUFFER_EMPTY that receives the serialized security context. When you have finished using this context, free it by calling the FreeContextBuffer function.
[out, optional] pToken
A pointer to receive the handle of the context's token.
When you have finished using the user token, release the handle by calling the CloseHandle function.
Return value
If the function succeeds, the function returns SEC_E_OK.
If the function fails, it returns one of the following error codes.
Return code | Description |
---|---|
|
There is not enough memory available to complete the requested action. |
|
The phContext parameter does not point to a valid handle. |
|
Schannel kernel mode does not support this function. |
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 |