Source code of Windows XP (NT5)
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.

71 lines
1.8 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1995, Microsoft Corporation.
  4. //
  5. // File: daclwrap.hxx
  6. //
  7. // Contents: class encapsulating file security.
  8. //
  9. // Classes: CDaclWrap
  10. //
  11. // History: Nov-93 Created DaveMont
  12. //
  13. //--------------------------------------------------------------------
  14. #ifndef __DACLWRAP__
  15. #define __DACLWRAP__
  16. #include <t2.hxx>
  17. #include <accacc.hxx>
  18. //+-------------------------------------------------------------------
  19. //
  20. // Class: CDaclWrap
  21. //
  22. // Purpose: encapsulation of File security (ie. a wrapper around a
  23. // DACL) This class provides methods to build a new acl,
  24. // with intent to merge it with an existing DACL on a file.
  25. //
  26. //--------------------------------------------------------------------
  27. typedef struct
  28. {
  29. CAccountAccess *pcaa;
  30. ULONG option;
  31. } SACCOUNTANDOPTIONS;
  32. class CDaclWrap
  33. {
  34. public:
  35. CDaclWrap();
  36. ~CDaclWrap();
  37. // building the new dacl, based on previous SetAccess inputs and
  38. // the input DACL
  39. ULONG BuildAcl(ACL **pnewdacl, ACL *poldacl, UCHAR revision, BOOL fdir);
  40. // adding, replacing and removing aces
  41. ULONG SetAccess(ULONG option, WCHAR *Name, WCHAR *System, ULONG access);
  42. private:
  43. ULONG _GetNewAclSize(ULONG *caclsize, ACL *poldacl, BOOL fdir);
  44. ULONG _SetDeniedAce(ACL *dacl, ACCESS_MASK mask, SID *psid, BOOL fdir);
  45. ULONG _SetAllowedAce(ACL *dacl, ACCESS_MASK mask, SID *psid, BOOL fdir);
  46. ULONG _FillNewAcl(ACL *pnewdacl, ACL *poldacl, BOOL fdir);
  47. ULONG _AllocateNewAcl(ACL **pnewdacl, ULONG caclsize, ULONG revision);
  48. ULONG _acessize ;
  49. ULONG _ccaa ;
  50. SACCOUNTANDOPTIONS _aaa[CMAXACES] ;
  51. };
  52. #endif // __DACLWRAP__