LSA_CREATE_TOKEN_EX callback function (ntsecpkg.h)

Creates tokens while processing calls to SpAcceptLsaModeContext.

Syntax

LSA_CREATE_TOKEN_EX LsaCreateTokenEx;

NTSTATUS LsaCreateTokenEx(
  [in]  PLUID LogonId,
  [in]  PTOKEN_SOURCE TokenSource,
  [in]  SECURITY_LOGON_TYPE LogonType,
  [in]  SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
  [in]  LSA_TOKEN_INFORMATION_TYPE TokenInformationType,
  [in]  PVOID TokenInformation,
  [in]  PTOKEN_GROUPS TokenGroups,
  [in]  PUNICODE_STRING Workstation,
  [in]  PUNICODE_STRING ProfilePath,
  [in]  PVOID SessionInformation,
  [in]  SECPKG_SESSIONINFO_TYPE SessionInformationType,
  [out] PHANDLE Token,
  [out] PNTSTATUS SubStatus
)
{...}

Parameters

[in] LogonId

A pointer to a logon session identifier for the new token. This identifier is obtained from a previous call to CreateLogonSession.

[in] TokenSource

A pointer to a TOKEN_SOURCE structure that specifies the source for this token. Specify the package name.

[in] LogonType

A SECURITY_LOGON_TYPE value that indicates the type of logon.

[in] ImpersonationLevel

A SECURITY_IMPERSONATION_LEVEL value that indicates the extent to which a server process can impersonate a client process.

[in] TokenInformationType

Specifies the type of structure in the TokenInformation parameter.

Value Meaning
LsaTokenInformationNull

LSA_TOKEN_INFORMATION_NULL

LsaTokenInformationV1

LSA_TOKEN_INFORMATION_V1

[in] TokenInformation

A pointer to the token information. The type of structure pointed to by TokenInformation is indicated by the TokenInformationType parameter.

[in] TokenGroups

A pointer to a TOKEN_GROUPS structure that specifies groups not contained in TokenInformation.

[in] Workstation

A pointer to a UNICODE_STRING structure that contains the name of the client's workstation, normally a NetBIOS name.

[in] ProfilePath

A pointer to a UNICODE_STRING structure that contains the path to the user's profile, if any.

[in] SessionInformation

Data that specifies information about the current logon session. The format of this data is specified by the value of the SessionInformationType parameter.

[in] SessionInformationType

A value of the SECPKG_SESSIONINFO_TYPE enumeration that specifies the format of the SessionInformation parameter. Currently, the only defined value is SecSessionPrimaryCred, which specifies that the value of the SessionInformation parameter is a SECPKG_PRIMARY_CRED structure.

[out] Token

A pointer that receives the address of a handle to the new token. When you have finished using the handle, close it by calling the CloseHandle function.

[out] SubStatus

A pointer to a variable that receives error information.

Return value

If the function succeeds, the return value is STATUS_SUCCESS.

If the function fails, the return value is an NTSTATUS code that indicates the reason it failed.

Remarks

A pointer to the CreateTokenEx function is available in the LSA_SECPKG_FUNCTION_TABLE structure received by the SpInitialize 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

SpInitialize