ImportSecurityContext
TOC
Collapse the table of content
Expand the table of content

ImportSecurityContext function

The ImportSecurityContext function imports a security context. The security context must have been exported to the process calling ImportSecurityContext by a previous call to ExportSecurityContext.

Syntax


SECURITY_STATUS SEC_Entry ImportSecurityContext(
  _In_     PSECURITY_STRING *pszPackage,
  _In_     PSecBuffer       pPackedContext,
  _In_opt_ HANDLE           pToken,
  _Out_    PCtxtHandle      phContext
);

Parameters

pszPackage [in]

A string that contains the name of the security package to which the security context was exported.

pPackedContext [in]

A pointer to a buffer that contains the serialized security context created by ExportSecurityContext.

pToken [in, optional]

A handle to the context's token.

phContext [out]

A handle of the new security context created from pPackedContext. When you have finished using the context, delete it by calling the DeleteSecurityContext 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 codeDescription
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

There is not enough memory available to complete the requested action.

SEC_E_INTERNAL_ERROR

An error occurred that did not map to an SSPI error code.

 

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Sspi.h (include Security.h)

Library

Secur32.lib

DLL

Secur32.dll

Unicode and ANSI names

ImportSecurityContextW (Unicode) and ImportSecurityContextA (ANSI)

See also

SSPI Functions
ExportSecurityContext
FreeContextBuffer

 

 

Community Additions

ADD
Show:
© 2016 Microsoft