Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1005 B

  1. #if !defined(_FUSION_SXS_IMPERSONATIONDATA_H_INCLUDED_)
  2. #define _FUSION_SXS_IMPERSONATIONDATA_H_INCLUDED_
  3. #pragma once
  4. #include <sxsapi.h>
  5. class CImpersonationData
  6. {
  7. public:
  8. CImpersonationData() : m_Callback(NULL), m_Context(NULL) { }
  9. CImpersonationData(PSXS_IMPERSONATION_CALLBACK Callback, PVOID Context) : m_Callback(Callback), m_Context(Context) { }
  10. CImpersonationData(const CImpersonationData &r) : m_Callback(r.m_Callback), m_Context(r.m_Context) { }
  11. void operator =(const CImpersonationData &r) { m_Callback = r.m_Callback; m_Context = r.m_Context; }
  12. ~CImpersonationData() { }
  13. enum CallType
  14. {
  15. eCallTypeImpersonate,
  16. eCallTypeUnimpersonate
  17. };
  18. BOOL Call(CallType ct) const { BOOL fSuccess = TRUE; if (m_Callback != NULL) { fSuccess = (*m_Callback)(m_Context, (ct == eCallTypeImpersonate) ? TRUE : FALSE); } return fSuccess; }
  19. protected:
  20. PSXS_IMPERSONATION_CALLBACK m_Callback;
  21. PVOID m_Context;
  22. };
  23. #endif