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 code | Description |
|---|---|
|
The credentials supplied to the package were not recognized. |
|
No credentials are available in the security package. |
|
The caller of the function does not have the necessary credentials. |
|
There is not enough memory available to complete the requested action. |
|
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 |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
ImportSecurityContextW (Unicode) and ImportSecurityContextA (ANSI) |
See also