Bewerken

Delen via


SpGetContextTokenFn callback function (ntsecpkg.h)

Obtains the token to impersonate. The SpGetContextToken function is used by the SSPI ImpersonateSecurityContext function to obtain the token to impersonate.

Syntax

SpGetContextTokenFn Spgetcontexttokenfn;

NTSTATUS Spgetcontexttokenfn(
  [in]  LSA_SEC_HANDLE ContextHandle,
  [out] PHANDLE ImpersonationToken
)
{...}

Parameters

[in] ContextHandle

A handle to the context to impersonate.

[out] ImpersonationToken

Pointer that receives a handle to the token for the specified context. Return the handle to the token without first duplicating the handle or the token.

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
SEC_E_INVALID_HANDLE
The handle is not valid.

Remarks

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

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

ImpersonateSecurityContext

SECPKG_USER_FUNCTION_TABLE

SpUserModeInitialize