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.

183 lines
5.7 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1996.
  5. //
  6. // File: ntprov.hxx
  7. //
  8. // Contents: Private header for the NT Marta provider
  9. //
  10. // History: 22-Jul-96 MacM Created
  11. //
  12. //--------------------------------------------------------------------
  13. #ifndef __NTPROV_HXX__
  14. #define __NTPROV_HXX__
  15. //
  16. // Extern definitions
  17. //
  18. extern CSList gWrkrList;
  19. extern "C"
  20. {
  21. extern RTL_RESOURCE gWrkrLock;
  22. extern RTL_RESOURCE gCacheLock;
  23. extern RTL_RESOURCE gLocalSidCacheLock;
  24. extern HINSTANCE ghDll;
  25. }
  26. //
  27. // These are the flags to pass in to the worker threads
  28. //
  29. #define NTMARTA_DELETE_ARGS 0x00000001 // Wrkr should delete its
  30. // argument structure
  31. #define NTMARTA_DELETE_ALIST 0x00000002 // Wrkr should delete the
  32. // class pointer
  33. #define NTMARTA_HANDLE_VALID 0x00000004 // The passed in handle
  34. // should be used
  35. //
  36. // Number entries in the last success access cache.
  37. //
  38. #define MAX_ACCESS_ENTRIES 5
  39. //
  40. // The time to wait before killing a thread
  41. //
  42. #define THREAD_KILL_WAIT 1000
  43. //
  44. // This structure is used to hold info about the last successfully accessed
  45. // paths
  46. //
  47. typedef struct _NTMARTA_ACCESS_CACHE
  48. {
  49. SE_OBJECT_TYPE ObjectType;
  50. ULONG cLen;
  51. WCHAR wszPath[MAX_PATH + 1];
  52. } NTMARTA_ACCESS_CACHE, *PNTMARTA_ACCESS_CACHE;
  53. //
  54. // This structure is used to maintain information about the worker thread
  55. //
  56. typedef struct _NTMARTA_WRKR_INFO
  57. {
  58. PACTRL_OVERLAPPED pOverlapped;
  59. HANDLE hWorker;
  60. ULONG fState; // Non-zero state means STOP!
  61. ULONG cProcessed; // Number of items processed
  62. } NTMARTA_WRKR_INFO, *PNTMARTA_WRKR_INFO;
  63. //
  64. // This structure gets passed in to the SetAccess/GrantAccess worker threads
  65. //
  66. typedef struct _NTMARTA_SET_WRKR_INFO
  67. {
  68. PNTMARTA_WRKR_INFO pWrkrInfo;
  69. PWSTR *ppwszObjectList;
  70. ULONG cObjects;
  71. HANDLE hObject;
  72. SE_OBJECT_TYPE ObjectType;
  73. CAccessList *pAccessList;
  74. ULONG fFlags;
  75. } NTMARTA_SET_WRKR_INFO, *PNTMARTA_SET_WRKR_INFO;
  76. //
  77. // This is used by the Revoke worker threads
  78. //
  79. typedef struct _NTMARTA_RVK_WRKR_INFO
  80. {
  81. PNTMARTA_WRKR_INFO pWrkrInfo;
  82. PWSTR pwszObject;
  83. SE_OBJECT_TYPE ObjectType;
  84. ULONG cTrustees;
  85. PTRUSTEE prgTrustees;
  86. } NTMARTA_RVK_WRKR_INFO, *PNTMARTA_RVK_WRKR_INFO;
  87. //
  88. // Private function prototypes
  89. //
  90. VOID
  91. NtProvFreeWorkerItem(IN PVOID pv);
  92. BOOL
  93. NtProvFindWorkerItem(IN PVOID pv1, // Data passed in
  94. IN PVOID pv2); // Data from list
  95. BOOL
  96. NtProvFindTempPropItem(IN PVOID pv1, // Data passed in
  97. IN PVOID pv2); // Data from list
  98. DWORD
  99. NtProvGetBasePathsForFilePath(IN PWSTR pwszObject,
  100. IN SE_OBJECT_TYPE ObjectType,
  101. OUT PULONG pcPaths,
  102. OUT PWSTR **pppwszBasePaths);
  103. DWORD
  104. NtProvGetAccessListForObject(IN PWSTR pwszObject,
  105. IN SE_OBJECT_TYPE ObjectType,
  106. IN PACTRL_RIGHTS_INFO pRightsInfo,
  107. IN ULONG cProps,
  108. OUT CAccessList **ppAccessList);
  109. DWORD
  110. NtProvGetAccessListForHandle(IN HANDLE hObject,
  111. IN SE_OBJECT_TYPE ObjectType,
  112. IN PACTRL_RIGHTS_INFO pRightsInfo,
  113. IN ULONG cProps,
  114. OUT CAccessList **ppAccessList);
  115. extern "C"
  116. {
  117. BOOL
  118. IsThisADfsPath(IN LPCWSTR pwszPath,
  119. IN DWORD cwPath OPTIONAL);
  120. }
  121. DWORD
  122. NtProvDoSet(IN LPCWSTR pwszObjectPath,
  123. IN SE_OBJECT_TYPE ObjectType,
  124. IN CAccessList *pAccessList,
  125. IN PACTRL_OVERLAPPED pOverlapped,
  126. IN DWORD fSetFlags);
  127. DWORD
  128. NtProvDoHandleSet(IN HANDLE hObject,
  129. IN SE_OBJECT_TYPE ObjectType,
  130. IN CAccessList *pAccessList,
  131. IN PACTRL_OVERLAPPED pOverlapped,
  132. IN DWORD fSetFlags);
  133. DWORD
  134. NtProvSetRightsList(IN OPTIONAL PACTRL_ACCESS pAccessList,
  135. IN OPTIONAL PACTRL_AUDIT pAuditList,
  136. OUT PULONG pcItems,
  137. OUT PACTRL_RIGHTS_INFO *ppRightsList);
  138. DWORD
  139. AccProvpDoTrusteeAccessCalculations(IN CAccessList *pAccList,
  140. IN PTRUSTEE pTrustee,
  141. IN OUT PTRUSTEE_ACCESS pTrusteeAccess);
  142. DWORD
  143. AccProvpDoAccessAuditedCalculations(IN CAccessList *pAccList,
  144. IN LPCWSTR pwszProperty,
  145. IN PTRUSTEE pTrustee,
  146. IN ACCESS_RIGHTS ulAuditRights,
  147. OUT PBOOL pfAuditedSuccess,
  148. OUT PBOOL pfAuditedFailure);
  149. //
  150. // Worker threads
  151. //
  152. DWORD
  153. NtProvSetAccessRightsWorkerThread(IN PVOID pWorkerArgs);
  154. #endif