WinStd Additional templates and function helpers for Microsoft Windows using Standard C++ classes

Public Member Functions | Protected Attributes | List of all members
winstd::user_impersonator Class Reference
Windows API

Lets the calling thread impersonate the security context of a logged-on user. More...

`#include <Win.h>`

## Public Member Functions
| user_impersonator (_In_opt_ HANDLE hToken) noexcept
| Construct the impersonator and impersonates the given user. More...
virtual | ~user_impersonator ()
| Reverts to current user and destructs the impersonator. More...

## Protected Attributes
BOOL | m_cookie
| Did impersonation succeed?

## Detailed Description

Lets the calling thread impersonate the security context of a logged-on user.

## Constructor & Destructor Documentation

## ◆ user_impersonator()

winstd::user_impersonator::user_impersonator | ( | _In_opt_ HANDLE | hToken | ) |
| inline noexcept

Construct the impersonator and impersonates the given user.

Parameters

  [in] | hToken | A handle to a primary or impersonation access token that represents a logged-on user or NULL for no impersonation.

See also
  ImpersonateLoggedOnUser function

## ◆ ~user_impersonator()

virtual winstd::user_impersonator::~user_impersonator | ( |  | ) |
| inline virtual

Reverts to current user and destructs the impersonator.

See also
  RevertToSelf function

The documentation for this class was generated from the following file:

- include/WinStd/Win.h