windows-nt/Source/XPSP1/NT/base/win32/fusion/sxs/impersonationdata.h

31 lines
975 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
#if !defined(_FUSION_SXS_IMPERSONATIONDATA_H_INCLUDED_)
#define _FUSION_SXS_IMPERSONATIONDATA_H_INCLUDED_
#pragma once
#include <sxsapi.h>
class CImpersonationData
{
public:
CImpersonationData() : m_Callback(NULL), m_Context(NULL) { }
CImpersonationData(PSXS_IMPERSONATION_CALLBACK Callback, PVOID Context) : m_Callback(Callback), m_Context(Context) { }
CImpersonationData(const CImpersonationData &r) : m_Callback(r.m_Callback), m_Context(r.m_Context) { }
void operator =(const CImpersonationData &r) { m_Callback = r.m_Callback; m_Context = r.m_Context; }
~CImpersonationData() { }
enum CallType
{
eCallTypeImpersonate,
eCallTypeUnimpersonate
};
BOOL Call(CallType ct) const { BOOL fSuccess = TRUE; if (m_Callback != NULL) { fSuccess = (*m_Callback)(m_Context, (ct == eCallTypeImpersonate) ? TRUE : FALSE); } return fSuccess; }
protected:
PSXS_IMPERSONATION_CALLBACK m_Callback;
PVOID m_Context;
};
#endif