Platform SDK: Logon Authentication

ExportSecurityContext

The ExportSecurityContext function exports a security context into a context buffer for later use by ImportSecurityContext.

SECURITY_STATUS SEC_Entry ExportSecurityContext(
  PCtxtHandle phContext,
  Ulong fFlags,
  PSecBuffer pPackedContext,
  void SEC_FAR *pToken 
);

Parameters

phContext
[in] Handle of the security context to be exported.
fFlags
[in] Only the SECPKG_CONTEXT_EXPORT_DELETE_OLD flag is currently used. If this flag is set, the old context is deleted after the export copy of the credentials is created.
pPackedContext
[out] Pointer to a buffer that receives the serialized security context. This context must be freed by the application with FreeContextBuffer.
pToken
[out, optional] Optional pointer to receive the handle of the context's token.

Return Values

If the function succeeds, the return value is SEC_E_OK.

If the function fails, the return value can be one of the following error codes.

Value Meaning
SEC_E_UNKNOWN_CREDENTIALS The credentials supplied to the package were not recognized.
SEC_E_NO_CREDENTIALS No credentials are available in the security package.
SEC_E_NOT_OWNER The caller of the function does not have the necessary credentials.
SEC_E_INSUFFICIENT_MEMORY Not enough memory is available to complete the request.
SEC_E_INTERNAL_ERROR The Local Security Authority (LSA) cannot be contacted.

Requirements

  Windows NT/2000: Requires Windows NT 3.51 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Sspi.h; include Security.h.
  Library: Use Secur32.lib.

See Also

ImportSecurityContext, FreeContextBuffer