Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

AuthzInitializeContextFromToken function

The AuthzInitializeContextFromToken function initializes a client authorization context from a kernel token. The kernel token must have been opened for TOKEN_QUERY.

Starting with Windows Server 2012 and Windows 8, this function can also copy device groups, user claims, and device claims.


BOOL WINAPI AuthzInitializeContextFromToken(
  _In_      DWORD Flags,
  _In_      HANDLE TokenHandle,
  _In_      AUTHZ_RESOURCE_MANAGER_HANDLE hAuthzResourceManager,
  _In_opt_  PLARGE_INTEGER pExpirationTime,
  _In_      LUID Identifier,
  _In_opt_  PVOID DynamicGroupArgs,
  _Out_     PAUTHZ_CLIENT_CONTEXT_HANDLE phAuthzClientContext


Flags [in]

Reserved for future use.

TokenHandle [in]

A handle to the client token used to initialize the pAuthzClientContext parameter. The token must have been opened with TOKEN_QUERY access.

hAuthzResourceManager [in]

A handle to the resource manager that created this client context. This handle is stored in the client context structure.

pExpirationTime [in, optional]

Expiration date and time of the token. If no value is passed, the token never expires. Expiration time is not currently enforced.

Identifier [in]

Identifier that is specific to the resource manager. This parameter is not currently used.

DynamicGroupArgs [in, optional]

A pointer to parameters to be passed to the callback function that computes dynamic groups.

phAuthzClientContext [out]

A pointer to the AuthzClientContext handle returned. Call AuthzFreeContext when done with the client context.

Return value

If the function succeeds, it returns TRUE.

If the function fails, it returns FALSE. To get extended error information, call GetLastError.


This function calls the AuthzComputeGroupsCallback callback function to add security identifiers to the newly created context.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]


Windows Server 2003 Administration Tools Pack on Windows XP







See also

Basic Access Control Functions



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.