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.

57 lines
1.3 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // File: DUMPSEC.hxx
  4. //
  5. // Contents: class encapsulating file security.
  6. //
  7. // Classes: CDumpSecurity
  8. //
  9. // History: Nov-93 Created DaveMont
  10. //
  11. //--------------------------------------------------------------------
  12. #ifndef __DUMPSEC__
  13. #define __DUMPSEC__
  14. #include "t2.hxx"
  15. //+-------------------------------------------------------------------
  16. //
  17. // Class: CDumpSecurity
  18. //
  19. // Purpose: encapsulation of NT File security descriptor with functions
  20. // to get SIDs and iterate through the ACES in the DACL.
  21. //
  22. //--------------------------------------------------------------------
  23. class CDumpSecurity
  24. {
  25. public:
  26. CDumpSecurity(LPWSTR filename);
  27. ~CDumpSecurity();
  28. ULONG Init();
  29. ULONG GetSDOwner(SID **psid);
  30. ULONG GetSDGroup(SID **pgsid);
  31. VOID ResetAce(SID *psid);
  32. LONG GetNextAce(ACE_HEADER **paceh);
  33. BOOL IsDaclNull() const { return _bNullDacl;}
  34. private:
  35. BYTE * _psd ;
  36. LPWSTR _pfilename ;
  37. LPWSTR _pwfilename ;
  38. ACL * _pdacl ;
  39. ACE_HEADER * _pah ;
  40. SID * _psid ;
  41. ULONG _cacethissid; // a dinosaur from the cretaceous
  42. BOOL _bNullDacl;
  43. };
  44. #endif // __DUMPSEC__