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.

66 lines
2.0 KiB

  1. /*****************************************************************************/
  2. /* Copyright (c) 1999-2001 Microsoft Corporation, All Rights Reserved /
  3. /*****************************************************************************/
  4. /*
  5. * CSecureFile.h - header file for CSecureFile class.
  6. *
  7. * Created: 12-14-1997 by Sanjeev Surati
  8. * (based on classes from Windows NT Security by Nik Okuntseff)
  9. */
  10. #if !defined __CSECUREFILE_H__
  11. #define __CSECUREFILE_H__
  12. ////////////////////////////////////////////////////////////////
  13. //
  14. // Class: CSecureFile
  15. //
  16. // This class is intended to encapsulate the security of an
  17. // NT File or Directory. It inherits off of CSecurityDescriptor
  18. // and it is that class to which it passes Security Descriptors
  19. // it obtains, and from which it receives previously built
  20. // security descriptors to apply. It supplies implementations
  21. // for AllAccessMask(), WriteOwner() and WriteAcls().
  22. //
  23. ////////////////////////////////////////////////////////////////
  24. class CSecureFile : public CSecurityDescriptor
  25. {
  26. // Constructors and destructor
  27. public:
  28. CSecureFile();
  29. CSecureFile( LPCTSTR pszFileName, BOOL fGetSACL = TRUE );
  30. CSecureFile
  31. (
  32. LPCTSTR a_pszFileName,
  33. CSid* a_psidOwner,
  34. bool a_fOwnerDefaulted,
  35. CSid* a_psidGroup,
  36. bool a_fGroupDefaulted,
  37. CDACL* a_pDacl,
  38. bool a_fDaclDefaulted,
  39. bool a_fDaclAutoInherited,
  40. CSACL* a_pSacl,
  41. bool a_fSaclDefaulted,
  42. bool a_fSaclAutoInherited
  43. );
  44. CSecureFile( LPCTSTR pszFileName, PSECURITY_DESCRIPTOR pSD ) ;
  45. ~CSecureFile();
  46. DWORD SetFileName( LPCTSTR pszFileName, BOOL fGetSACL = TRUE );
  47. virtual DWORD AllAccessMask( void );
  48. virtual DWORD WriteOwner( PSECURITY_DESCRIPTOR pAbsoluteSD );
  49. virtual DWORD WriteAcls( PSECURITY_DESCRIPTOR pAbsoluteSD , SECURITY_INFORMATION securityinfo );
  50. private:
  51. CHString m_strFileName;
  52. };
  53. #endif // __CSecureFile_H__