AuthzInitializeContextFromAuthzContext function (authz.h)

The AuthzInitializeContextFromAuthzContext function creates a new client context based on an existing client context.

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


AUTHZAPI BOOL AuthzInitializeContextFromAuthzContext(
  [in]           DWORD                        Flags,
  [in]           AUTHZ_CLIENT_CONTEXT_HANDLE  hAuthzClientContext,
  [in, optional] PLARGE_INTEGER               pExpirationTime,
  [in]           LUID                         Identifier,
  [in]           PVOID                        DynamicGroupArgs,
  [out]          PAUTHZ_CLIENT_CONTEXT_HANDLE phNewAuthzClientContext


[in] Flags

Reserved for future use.

[in] hAuthzClientContext

The handle to an existing client context.

[in, optional] pExpirationTime

Sets the time limit for how long the returned context structure is valid. If no value is passed, then the token never expires. Expiration time is not currently enforced.

[in] Identifier

The specific identifier for the resource manager.

[in] DynamicGroupArgs

A pointer to parameters to be passed to the callback function that computes dynamic groups. If the value is NULL, then the callback function is not called.

[out] phNewAuthzClientContext

A pointer to the duplicated AUTHZ_CLIENT_CONTEXT_HANDLE handle. When you have finished using the handle, release it by calling the AuthzFreeContext function.

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.


Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header authz.h
Library Authz.lib
DLL Authz.dll
Redistributable Windows Server 2003 Administration Tools Pack on Windows XP

See also


Basic Access Control Functions