Export (0) Print
Expand All
Expand Minimize

CreateTokenEx function

Creates tokens while processing calls to SpAcceptLsaModeContext.

Syntax


NTSTATUS NTAPI CreateTokenEx(
  _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

LogonId [in]

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

TokenSource [in]

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

LogonType [in]

A SECURITY_LOGON_TYPE value that indicates the type of logon.

ImpersonationLevel [in]

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

TokenInformationType [in]

Specifies the type of structure in the TokenInformation parameter.

ValueMeaning
LsaTokenInformationNull

LSA_TOKEN_INFORMATION_NULL

LsaTokenInformationV1

LSA_TOKEN_INFORMATION_V1

 

TokenInformation [in]

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

TokenGroups [in]

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

Workstation [in]

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

ProfilePath [in]

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

SessionInformation [in]

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

SessionInformationType [in]

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.

Token [out]

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.

SubStatus [out]

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

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Ntsecpkg.h

See also

SpInitialize

 

 

Community Additions

ADD
Show:
© 2015 Microsoft