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.

335 lines
11 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1992 **/
  4. /**********************************************************************/
  5. /*
  6. NTFSAcl.hxx
  7. This file contains the manifests for the NTFS front to the Generic
  8. ACL Editor.
  9. FILE HISTORY:
  10. Johnl 03-Jan-1992 Created
  11. beng 06-Apr-1992 Unicode fix
  12. */
  13. #ifndef _NTFSACL_HXX_
  14. #define _NTFSACL_HXX_
  15. #ifndef RC_INVOKED
  16. #include <cncltask.hxx>
  17. APIERR EditNTFSAcl( HWND hwndParent,
  18. const TCHAR * pszServer,
  19. const TCHAR * pszResource,
  20. enum SED_PERM_TYPE sedpermtype,
  21. BOOL fIsFile ) ;
  22. /* This function determines if the drive pointed at by pszResource is an
  23. * NTFS drive
  24. */
  25. APIERR IsNTFS( const TCHAR * pszResource, BOOL * pfIsNTFS ) ;
  26. APIERR CheckFileSecurity( const TCHAR * pszFileName,
  27. ACCESS_MASK DesiredAccess,
  28. BOOL * pfAccessGranted ) ;
  29. //
  30. // These are the different states the time sliced tree apply code maybe
  31. // in.
  32. //
  33. enum TREE_APPLY_STATE
  34. {
  35. APPLY_SEC_FMX_SELECTION, // Apply to the next FMX selection, start enum
  36. // if necessary
  37. APPLY_SEC_IN_FS_ENUM, // Haven't finished enumeration yet
  38. APPLY_SEC_FMX_POST_FS_ENUM // We've finished the enum and we may need
  39. // to put the perms. on the container
  40. } ;
  41. /*************************************************************************
  42. NAME: TREE_APPLY_CONTEXT
  43. SYNOPSIS: The TREE_APPLY_CONTEXT class is simply a container class
  44. that stores the current context for the task slicing used
  45. in the CANCEL_TASK_DIALOG.
  46. CAVEATS: Note that nlsSelItem is a reference.
  47. Nothing should be added to this class which can fail
  48. construction (this is really just an open structure).
  49. NOTES: pfsenum will be deleted if it isn't NULL.
  50. HISTORY:
  51. Johnl 21-Oct-1992 Created
  52. **************************************************************************/
  53. class TREE_APPLY_CONTEXT
  54. {
  55. public:
  56. enum TREE_APPLY_STATE State ; // In FS enum or fmx selection
  57. HWND hwndFMXWindow ; // FMX Hwnd
  58. UINT iCurrent ; // Currently selected item
  59. UINT uiCount ; // Total number of selected items in Winfile
  60. BOOL fDepthFirstTraversal ; // Do a depth first tree apply
  61. BOOL fApplyToDirContents ; // Apply to contents w/o doing the tree
  62. NLS_STR & nlsSelItem ; // Currently selected FMX item
  63. BOOL fIsSelFile ; // Is the selected item a file?
  64. enum SED_PERM_TYPE sedpermtype ; // SED_AUDITS, SED_OWNER, SED_ACCESSES
  65. LPDWORD StatusReturn ; // Status passed by ACL editor
  66. BOOL fApplyToSubContainers ;// "
  67. BOOLEAN fApplyToSubObjects ; // "
  68. W32_FS_ENUM * pfsenum ;
  69. TREE_APPLY_CONTEXT( NLS_STR & nlsSel )
  70. : nlsSelItem( nlsSel ),
  71. pfsenum ( NULL )
  72. { /* nothing to do */ }
  73. ~TREE_APPLY_CONTEXT()
  74. { delete pfsenum ; }
  75. } ;
  76. /*************************************************************************
  77. NAME: NTFS_TREE_APPLY_CONTEXT
  78. SYNOPSIS: Supplies NTFS specific data for the NTFS_CANCEL_TREE_APPLY
  79. class
  80. PARENT: TREE_APPLY_CONTEXT
  81. HISTORY:
  82. Johnl 22-Oct-1992 Created
  83. **************************************************************************/
  84. class NTFS_TREE_APPLY_CONTEXT : public TREE_APPLY_CONTEXT
  85. {
  86. public:
  87. OS_SECURITY_INFORMATION & osSecInfo ; // What's being set
  88. PSECURITY_DESCRIPTOR psecdesc ; // Container permissions
  89. PSECURITY_DESCRIPTOR psecdescNewObjects ; // Object permissions
  90. BOOL fBlowAwayDACLOnCont ; // Replace DACL granting the
  91. // current user full access on
  92. // containers
  93. NTFS_TREE_APPLY_CONTEXT( NLS_STR & nlsSel,
  94. OS_SECURITY_INFORMATION & osSec )
  95. : TREE_APPLY_CONTEXT( nlsSel ),
  96. osSecInfo ( osSec )
  97. { /* nothing to do */ }
  98. } ;
  99. /*************************************************************************
  100. NAME: LM_TREE_APPLY_CONTEXT
  101. SYNOPSIS: Simple derivation for Lanman
  102. PARENT: TREE_APPLY_CONTEXT
  103. NOTES:
  104. HISTORY:
  105. Johnl 23-Oct-1992 Created
  106. **************************************************************************/
  107. class LM_TREE_APPLY_CONTEXT : public TREE_APPLY_CONTEXT
  108. {
  109. public:
  110. NET_ACCESS_1 * plmobjNetAccess1 ;
  111. LM_TREE_APPLY_CONTEXT( NLS_STR & nlsSel )
  112. : TREE_APPLY_CONTEXT( nlsSel )
  113. { /* nothing to do */ }
  114. } ;
  115. /*************************************************************************
  116. NAME: CANCEL_TREE_APPLY
  117. SYNOPSIS: Simply derivation of the CANCEL_TASK_DIALOG
  118. PARENT: CANCEL_TASK_DIALOG
  119. NOTES:
  120. HISTORY:
  121. Johnl 21-Oct-1992 Created
  122. **************************************************************************/
  123. class CANCEL_TREE_APPLY : public CANCEL_TASK_DIALOG
  124. {
  125. public:
  126. CANCEL_TREE_APPLY( HWND hwndParent,
  127. TREE_APPLY_CONTEXT * pContext,
  128. const TCHAR * pszDlgTitle )
  129. : CANCEL_TASK_DIALOG( (UINT) PtrToUlong(CANCEL_TASK_DIALOG_NAME),
  130. hwndParent,
  131. pszDlgTitle,
  132. (ULONG_PTR) pContext,
  133. (MSGID) IDS_CANCEL_TASK_ON_ERROR_MSG )
  134. {
  135. /* Nothing to do
  136. */
  137. }
  138. protected:
  139. virtual APIERR DoOneItem( ULONG_PTR ulContext,
  140. BOOL *pfContinue,
  141. BOOL *pfDisplayErrors,
  142. MSGID *msgidAlternateMessage ) ;
  143. virtual APIERR WriteSecurity( ULONG_PTR ulContext,
  144. const TCHAR * pszFileName,
  145. BOOL fIsFile,
  146. BOOL * pfContinue ) = 0 ;
  147. } ;
  148. /*************************************************************************
  149. NAME: NTFS_CANCEL_TREE_APPLY
  150. SYNOPSIS: Simple derivation that redefines WriteSecurity for NTFS
  151. PARENT: CANCEL_TREE_APPLY
  152. NOTES: Parameters for WriteSecurity are contained in the context
  153. structure
  154. HISTORY:
  155. Johnl 23-Oct-1992 Created
  156. **************************************************************************/
  157. class NTFS_CANCEL_TREE_APPLY : public CANCEL_TREE_APPLY
  158. {
  159. public:
  160. NTFS_CANCEL_TREE_APPLY( HWND hwndParent,
  161. NTFS_TREE_APPLY_CONTEXT * pContext,
  162. const TCHAR * pszDlgTitle )
  163. : CANCEL_TREE_APPLY( hwndParent,
  164. pContext,
  165. pszDlgTitle )
  166. {
  167. /* Nothing to do
  168. */
  169. }
  170. protected:
  171. virtual APIERR WriteSecurity( ULONG_PTR ulContext,
  172. const TCHAR * pszFileName,
  173. BOOL fIsFile,
  174. BOOL * pfContinue ) ;
  175. } ;
  176. /*************************************************************************
  177. NAME: LM_CANCEL_TREE_APPLY
  178. SYNOPSIS: Simple derivation that redefines WriteSecurity for Lanman
  179. PARENT: CANCEL_TREE_APPLY
  180. NOTES: Parameters for WriteSecurity are contained in the context
  181. structure
  182. HISTORY:
  183. Johnl 23-Oct-1992 Created
  184. **************************************************************************/
  185. class LM_CANCEL_TREE_APPLY : public CANCEL_TREE_APPLY
  186. {
  187. public:
  188. LM_CANCEL_TREE_APPLY( HWND hwndParent,
  189. LM_TREE_APPLY_CONTEXT * pContext,
  190. const TCHAR * pszDlgTitle )
  191. : CANCEL_TREE_APPLY( hwndParent,
  192. pContext,
  193. pszDlgTitle )
  194. {
  195. /* Nothing to do
  196. */
  197. }
  198. protected:
  199. virtual APIERR WriteSecurity( ULONG_PTR ulContext,
  200. const TCHAR * pszFileName,
  201. BOOL fIsFile,
  202. BOOL * pfContinue ) ;
  203. } ;
  204. #endif // RC_INVOKED
  205. #define IDS_NT_PERM_NAMES_BASE (IDS_UI_ACLEDIT_BASE+200)
  206. /* The following manifests are the resource IDs for the permission name
  207. * strings.
  208. */
  209. #define IDS_FILE_PERM_SPEC_READ (IDS_NT_PERM_NAMES_BASE+1)
  210. #define IDS_FILE_PERM_SPEC_WRITE (IDS_NT_PERM_NAMES_BASE+2)
  211. #define IDS_FILE_PERM_SPEC_EXECUTE (IDS_NT_PERM_NAMES_BASE+3)
  212. #define IDS_FILE_PERM_SPEC_ALL (IDS_NT_PERM_NAMES_BASE+4)
  213. #define IDS_FILE_PERM_SPEC_DELETE (IDS_NT_PERM_NAMES_BASE+5)
  214. #define IDS_FILE_PERM_SPEC_READ_PERM (IDS_NT_PERM_NAMES_BASE+6)
  215. #define IDS_FILE_PERM_SPEC_CHANGE_PERM (IDS_NT_PERM_NAMES_BASE+7)
  216. #define IDS_FILE_PERM_SPEC_CHANGE_OWNER (IDS_NT_PERM_NAMES_BASE+8)
  217. #define IDS_FILE_PERM_GEN_NO_ACCESS (IDS_NT_PERM_NAMES_BASE+10)
  218. #define IDS_FILE_PERM_GEN_READ (IDS_NT_PERM_NAMES_BASE+11)
  219. #define IDS_FILE_PERM_GEN_MODIFY (IDS_NT_PERM_NAMES_BASE+12)
  220. #define IDS_FILE_PERM_GEN_ALL (IDS_NT_PERM_NAMES_BASE+13)
  221. #define IDS_DIR_PERM_SPEC_READ (IDS_NT_PERM_NAMES_BASE+16)
  222. #define IDS_DIR_PERM_SPEC_WRITE (IDS_NT_PERM_NAMES_BASE+17)
  223. #define IDS_DIR_PERM_SPEC_EXECUTE (IDS_NT_PERM_NAMES_BASE+18)
  224. #define IDS_DIR_PERM_SPEC_ALL (IDS_NT_PERM_NAMES_BASE+19)
  225. #define IDS_DIR_PERM_SPEC_DELETE (IDS_NT_PERM_NAMES_BASE+20)
  226. #define IDS_DIR_PERM_SPEC_READ_PERM (IDS_NT_PERM_NAMES_BASE+21)
  227. #define IDS_DIR_PERM_SPEC_CHANGE_PERM (IDS_NT_PERM_NAMES_BASE+22)
  228. #define IDS_DIR_PERM_SPEC_CHANGE_OWNER (IDS_NT_PERM_NAMES_BASE+23)
  229. #define IDS_DIR_PERM_GEN_NO_ACCESS (IDS_NT_PERM_NAMES_BASE+30)
  230. #define IDS_DIR_PERM_GEN_LIST (IDS_NT_PERM_NAMES_BASE+31)
  231. #define IDS_DIR_PERM_GEN_READ (IDS_NT_PERM_NAMES_BASE+32)
  232. #define IDS_DIR_PERM_GEN_DEPOSIT (IDS_NT_PERM_NAMES_BASE+33)
  233. #define IDS_DIR_PERM_GEN_PUBLISH (IDS_NT_PERM_NAMES_BASE+34)
  234. #define IDS_DIR_PERM_GEN_MODIFY (IDS_NT_PERM_NAMES_BASE+35)
  235. #define IDS_DIR_PERM_GEN_ALL (IDS_NT_PERM_NAMES_BASE+36)
  236. #define IDS_NEWFILE_PERM_SPEC_READ (IDS_NT_PERM_NAMES_BASE+41)
  237. #define IDS_NEWFILE_PERM_SPEC_WRITE (IDS_NT_PERM_NAMES_BASE+42)
  238. #define IDS_NEWFILE_PERM_SPEC_EXECUTE (IDS_NT_PERM_NAMES_BASE+43)
  239. #define IDS_NEWFILE_PERM_SPEC_ALL (IDS_NT_PERM_NAMES_BASE+44)
  240. #define IDS_NEWFILE_PERM_SPEC_DELETE (IDS_NT_PERM_NAMES_BASE+45)
  241. #define IDS_NEWFILE_PERM_SPEC_READ_PERM (IDS_NT_PERM_NAMES_BASE+46)
  242. #define IDS_NEWFILE_PERM_SPEC_CHANGE_PERM (IDS_NT_PERM_NAMES_BASE+47)
  243. #define IDS_NEWFILE_PERM_SPEC_CHANGE_OWNER (IDS_NT_PERM_NAMES_BASE+48)
  244. #define IDS_FILE_AUDIT_READ (IDS_NT_PERM_NAMES_BASE+60)
  245. #define IDS_FILE_AUDIT_WRITE (IDS_NT_PERM_NAMES_BASE+61)
  246. #define IDS_FILE_AUDIT_EXECUTE (IDS_NT_PERM_NAMES_BASE+62)
  247. #define IDS_FILE_AUDIT_DELETE (IDS_NT_PERM_NAMES_BASE+63)
  248. #define IDS_FILE_AUDIT_CHANGE_PERM (IDS_NT_PERM_NAMES_BASE+64)
  249. #define IDS_FILE_AUDIT_CHANGE_OWNER (IDS_NT_PERM_NAMES_BASE+65)
  250. #define IDS_DIR_AUDIT_READ (IDS_NT_PERM_NAMES_BASE+66)
  251. #define IDS_DIR_AUDIT_WRITE (IDS_NT_PERM_NAMES_BASE+67)
  252. #define IDS_DIR_AUDIT_EXECUTE (IDS_NT_PERM_NAMES_BASE+68)
  253. #define IDS_DIR_AUDIT_DELETE (IDS_NT_PERM_NAMES_BASE+69)
  254. #define IDS_DIR_AUDIT_CHANGE_PERM (IDS_NT_PERM_NAMES_BASE+70)
  255. #define IDS_DIR_AUDIT_CHANGE_OWNER (IDS_NT_PERM_NAMES_BASE+71)
  256. #endif // _NTFSACL_HXX_