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.

138 lines
4.6 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1992 **/
  4. /**********************************************************************/
  5. /*
  6. NTMasks.hxx
  7. This file contains the Access mask mappings for the Generic ACL Editor
  8. for NT FS.
  9. FILE HISTORY:
  10. Johnl 7-Jan-1992 Broke out from ntfsacl.hxx
  11. */
  12. #ifndef _NTMASKS_HXX_
  13. #define _NTMASKS_HXX_
  14. /* The following manifests are the permission bitfields that represent
  15. * each string above. Note that for the special bits we could have used
  16. * the permission manifest directly (i.e., FILE_READ_DATA instead of
  17. * FILE_PERM_SPEC_READ_DATA), however the special bits can also contain
  18. * multiple flags, so this protects us in case we ever decide to combine
  19. * some manifests.
  20. *
  21. */
  22. /* File Special Permissions
  23. */
  24. #define FILE_PERM_SPEC_READ GENERIC_READ
  25. #define FILE_PERM_SPEC_WRITE GENERIC_WRITE
  26. #define FILE_PERM_SPEC_EXECUTE GENERIC_EXECUTE
  27. #define FILE_PERM_SPEC_ALL GENERIC_ALL
  28. #define FILE_PERM_SPEC_DELETE DELETE
  29. #define FILE_PERM_SPEC_CHANGE_PERM WRITE_DAC
  30. #define FILE_PERM_SPEC_CHANGE_OWNER WRITE_OWNER
  31. /* File General Permissions
  32. */
  33. #define FILE_PERM_GEN_NO_ACCESS (0)
  34. #define FILE_PERM_GEN_READ (GENERIC_READ |\
  35. GENERIC_EXECUTE)
  36. #define FILE_PERM_GEN_MODIFY (GENERIC_READ |\
  37. GENERIC_EXECUTE |\
  38. GENERIC_WRITE |\
  39. DELETE )
  40. #define FILE_PERM_GEN_ALL (GENERIC_ALL)
  41. /* Directory Special Permissions
  42. */
  43. #define DIR_PERM_SPEC_READ GENERIC_READ
  44. #define DIR_PERM_SPEC_WRITE GENERIC_WRITE
  45. #define DIR_PERM_SPEC_EXECUTE GENERIC_EXECUTE
  46. #define DIR_PERM_SPEC_ALL GENERIC_ALL
  47. #define DIR_PERM_SPEC_DELETE DELETE
  48. #define DIR_PERM_SPEC_CHANGE_PERM WRITE_DAC
  49. #define DIR_PERM_SPEC_CHANGE_OWNER WRITE_OWNER
  50. /* Directory General Permissions
  51. */
  52. #define DIR_PERM_GEN_NO_ACCESS (0)
  53. #define DIR_PERM_GEN_LIST (GENERIC_READ |\
  54. GENERIC_EXECUTE)
  55. #define DIR_PERM_GEN_READ (GENERIC_READ |\
  56. GENERIC_EXECUTE)
  57. #define DIR_PERM_GEN_DEPOSIT (GENERIC_WRITE |\
  58. GENERIC_EXECUTE)
  59. #define DIR_PERM_GEN_PUBLISH (GENERIC_READ |\
  60. GENERIC_WRITE |\
  61. GENERIC_EXECUTE)
  62. #define DIR_PERM_GEN_MODIFY (GENERIC_READ |\
  63. GENERIC_WRITE |\
  64. GENERIC_EXECUTE |\
  65. DELETE )
  66. #define DIR_PERM_GEN_ALL (GENERIC_ALL)
  67. /* New file Special Permissions
  68. */
  69. #define NEWFILE_PERM_SPEC_READ GENERIC_READ
  70. #define NEWFILE_PERM_SPEC_WRITE GENERIC_WRITE
  71. #define NEWFILE_PERM_SPEC_EXECUTE GENERIC_EXECUTE
  72. #define NEWFILE_PERM_SPEC_ALL GENERIC_ALL
  73. #define NEWFILE_PERM_SPEC_DELETE DELETE
  74. #define NEWFILE_PERM_SPEC_CHANGE_PERM WRITE_DAC
  75. #define NEWFILE_PERM_SPEC_CHANGE_OWNER WRITE_OWNER
  76. /* New File General permissions - Note that these correspond to the Directory
  77. * general permissions.
  78. */
  79. #define NEWFILE_PERM_GEN_NO_ACCESS (0)
  80. #define NEWFILE_PERM_GEN_LIST (ACCESS_MASK_NEW_OBJ_NOT_SPECIFIED)
  81. #define NEWFILE_PERM_GEN_READ (GENERIC_READ |\
  82. GENERIC_EXECUTE)
  83. #define NEWFILE_PERM_GEN_DEPOSIT (ACCESS_MASK_NEW_OBJ_NOT_SPECIFIED)
  84. #define NEWFILE_PERM_GEN_PUBLISH (GENERIC_READ |\
  85. GENERIC_EXECUTE)
  86. #define NEWFILE_PERM_GEN_MODIFY (GENERIC_READ |\
  87. GENERIC_WRITE |\
  88. GENERIC_EXECUTE |\
  89. DELETE )
  90. #define NEWFILE_PERM_GEN_ALL (GENERIC_ALL)
  91. //
  92. // Audit access masks
  93. //
  94. // Note that ACCESS_SYSTEM_SECURITY is ored with both Generic Read and
  95. // Generic Write. Access to the SACL is a privilege and if you have that
  96. // privilege, then you can both read and write the SACL.
  97. //
  98. #define FILE_AUDIT_READ (GENERIC_READ |\
  99. ACCESS_SYSTEM_SECURITY)
  100. #define FILE_AUDIT_WRITE (GENERIC_WRITE |\
  101. ACCESS_SYSTEM_SECURITY)
  102. #define FILE_AUDIT_EXECUTE GENERIC_EXECUTE
  103. #define FILE_AUDIT_DELETE DELETE
  104. #define FILE_AUDIT_CHANGE_PERM WRITE_DAC
  105. #define FILE_AUDIT_CHANGE_OWNER WRITE_OWNER
  106. #define DIR_AUDIT_READ (GENERIC_READ |\
  107. ACCESS_SYSTEM_SECURITY)
  108. #define DIR_AUDIT_WRITE (GENERIC_WRITE |\
  109. ACCESS_SYSTEM_SECURITY)
  110. #define DIR_AUDIT_EXECUTE GENERIC_EXECUTE
  111. #define DIR_AUDIT_DELETE DELETE
  112. #define DIR_AUDIT_CHANGE_PERM WRITE_DAC
  113. #define DIR_AUDIT_CHANGE_OWNER WRITE_OWNER
  114. /* The valid access masks for NTFS
  115. */
  116. #define NTFS_VALID_ACCESS_MASK (0xffffffff)
  117. #endif //_NTMASKS_HXX_