ImportSecurityContext function
Applies to: desktop apps only
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 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | ImportSecurityContextW (Unicode) and ImportSecurityContextA (ANSI) |
See also
Send comments about this topic to Microsoft
Build date: 3/13/2012