SpInitUserModeContextFn callback function (ntsecpkg.h)

The SpInitUserModeContext function creates a user-mode security context from a packed Local Security Authority (LSA)-mode context.

Syntax

SpInitUserModeContextFn Spinitusermodecontextfn;

NTSTATUS Spinitusermodecontextfn(
  [in] LSA_SEC_HANDLE ContextHandle,
  [in] PSecBuffer PackedContext
)
{...}

Parameters

[in] ContextHandle

A handle to the LSA-mode context returned from the SpInitLsaModeContext or SpAcceptLsaModeContext function.

[in] PackedContext

Pointer to a SecBuffer structure that contains the serialized context data. Use the FreeContextBuffer function to free memory allocated for this structure.

Return value

If the function succeeds, return STATUS_SUCCESS.

If the function fails, return an NTSTATUS code that indicates the reason it failed. The following lists a common reason for failure and the error code that the function should return.

Return code Description
STATUS_INSUFFICIENT_RESOURCES
Insufficient memory to create the context.

Remarks

The SpInitUserModeContext function is called after a security context has been created by the security package, if the MappedContext parameter of the SpInitLsaModeContext or SpAcceptLsaModeContext is set to TRUE. The package-specific context data should contain the information required to determine which function resulted in the call to SpInitUserModeContext.

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

A pointer to the SpInitUserModeContext 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

SpAcceptLsaModeContext

SpInitLsaModeContext

SpUserModeInitialize