IAzApplication2::InitializeClientContextFromToken2 method (azroles.h)

The InitializeClientContextFromToken2 method retrieves an IAzClientContext2 object pointer from the specified client token.

Syntax

HRESULT InitializeClientContextFromToken2(
  [in]           ULONG             ulTokenHandleLowPart,
  [in]           ULONG             ulTokenHandleHighPart,
  [in, optional] VARIANT           varReserved,
  [out]          IAzClientContext2 **ppClientContext
);

Parameters

[in] ulTokenHandleLowPart

Low byte of a handle to a token that specifies the client. If the values of both this parameter and the ulTokenHandleHighPart parameter are zero, the impersonation token of the caller's thread is used. If the thread does not have an impersonation token, the process token is used. The token must have been opened for TOKEN_QUERY, TOKEN_IMPERSONATE, or TOKEN_DUPLICATE access.

[in] ulTokenHandleHighPart

High byte of a handle to a token that specifies the client. If the values of both this parameter and the ulTokenHandleHighPart parameter are zero, the impersonation token of the caller's thread is used. If the thread does not have an impersonation token, the process token is used. The token must have been opened for TOKEN_QUERY, TOKEN_IMPERSONATE, or TOKEN_DUPLICATE access.

[in, optional] varReserved

Reserved for future use.

[out] ppClientContext

A pointer to a pointer to the returned IAzClientContext2 object.

Return value

If the method succeeds, the method returns S_OK.

If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008, Windows Server 2003 with SP1 [desktop apps only]
Target Platform Windows
Header azroles.h
Library Azroles.lib
DLL Azroles.dll
Redistributable Windows Server 2003 Administration Tools Pack on Windows XP