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.

85 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. All rights reserved
  4. Module Name:
  5. lsasid.hxx
  6. Abstract:
  7. This file provides useful accssors and mutators.
  8. Author:
  9. Larry Zhu (LZhu) May 1, 2001 Created
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. --*/
  14. #ifndef LSA_SID_HXX
  15. #define LSA_SID_HXX
  16. #ifdef __cplusplus
  17. enum ESidConst {
  18. kSidHeaderLen = FIELD_OFFSET(_SID, SubAuthority),
  19. };
  20. class TSID
  21. {
  22. SIGNATURE('tsid');
  23. public:
  24. TSID(void);
  25. TSID(IN ULONG64 baseOffset);
  26. ~TSID(void);
  27. HRESULT IsValid(void) const;
  28. //
  29. // These methods do not query symbols
  30. //
  31. PCSTR toStrDirect(void) const;
  32. PCSTR toStrDirect(IN PCSTR pszFmt) const;
  33. UCHAR GetSubAuthorityCountDirect(void) const;
  34. ULONG GetSizeDirect(void) const;
  35. PCSTR toStr(void) const;
  36. PCSTR toStr(IN PCSTR pszFmt) const;
  37. UCHAR GetSubAuthorityCount(void) const;
  38. ULONG GetSize(void) const;
  39. static PCSTR TSID::ConvertSidToFriendlyName(IN SID* pSid, IN PCSTR pszFmt);
  40. static PCSTR TSID::ConvertSidToFriendlyName(IN PSID pSid, IN PCSTR pszFmt);
  41. static PCSTR TSID::GetSidTypeStr(IN SID_NAME_USE eUse);
  42. PCSTR GetFriendlyNameDirect(IN PCSTR pszFmt) const;
  43. BOOLEAN IsSidValid(void) const;
  44. protected:
  45. HRESULT Initialize(IN ULONG64 baseOffset);
  46. private:
  47. HRESULT Initialize(void);
  48. PCSTR InternalToStr(IN ULONG cbSid, IN PCSTR pszFmt) const;
  49. PCSTR InternalGetFriendlyName(IN ULONG cbSid, IN PCSTR pszFmt) const;
  50. ULONG64 m_baseOffset;
  51. HRESULT m_hr;
  52. };
  53. #endif // #ifdef __cplusplus
  54. #endif // #ifndef LSA_SID_HXX