SpExportSecurityContextFn callback function (ntsecpkg.h)

Exports a security context to another process.

The SpExportSecurityContext function is the dispatch function for the ExportSecurityContext function of the Security Support Provider Interface.

Syntax

SpExportSecurityContextFn Spexportsecuritycontextfn;

NTSTATUS Spexportsecuritycontextfn(
  [in]  LSA_SEC_HANDLE phContext,
  [in]  ULONG fFlags,
  [out] PSecBuffer pPackedContext,
  [out] PHANDLE pToken
)
{...}

Parameters

[in] phContext

A handle to the security context to export.

[in] fFlags

Optional. Specifies context duplication options. The following table lists the valid values which are defined in Sspi.h.

Value Meaning
SECPKG_CONTEXT_EXPORT_RESET_NEW
New context is reset to initial state.
SECPKG_CONTEXT_EXPORT_DELETE_OLD
Old context is deleted during export.

[out] pPackedContext

Pointer to a SecBuffer structure containing the serialized context. Resources should be allocated using the AllocateClientBuffer function, and freed by the caller using the FreeContextBuffer function.

[out] pToken

Optional. Pointer to a handle that receives the context's token.

Return value

If the function succeeds, return STATUS_SUCCESS.

If the function fails, return an NTSTATUS code that indicates the reason it failed.

Remarks

To import a previously exported security context use the SpImportSecurityContext function.

SSP/APs must implement the SpExportSecurityContext function; however, the actual name given to the implementation is up to the developer.

A pointer to the SpExportSecurityContext function is available in the SECPKG_USER_FUNCTION_TABLE structure received from the SpUserModeInitialize 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 ntsecpkg.h

See also

SECPKG_USER_FUNCTION_TABLE

SpImportSecurityContext

SpUserModeInitialize