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.

67 lines
929 B

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. All rights reserved
  4. Module Name:
  5. impersonation.hxx
  6. Abstract:
  7. This file provides useful accssors and mutators.
  8. Author:
  9. Larry Zhu (LZhu) January 1, 2002
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. --*/
  14. #ifndef IMPERSONATION_HXX
  15. #define IMPERSONATION_HXX
  16. #ifdef __cplusplus
  17. class TImpersonation
  18. {
  19. SIGNATURE('impr');
  20. public:
  21. TImpersonation(
  22. IN OPTIONAL HANDLE hToken
  23. );
  24. ~TImpersonation(
  25. VOID
  26. );
  27. NTSTATUS
  28. Validate(
  29. VOID
  30. ) const;
  31. private:
  32. NO_COPY(TImpersonation)
  33. NTSTATUS
  34. Initialize(
  35. VOID
  36. );
  37. HANDLE m_hTokenOld;
  38. BOOLEAN m_bIsOldTokenValid;
  39. HANDLE m_hTokenNew;
  40. TNtStatus m_Status;
  41. };
  42. #endif // #ifdef __cplusplus
  43. #endif // #ifndef IMPERSONATION_HXX