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.

384 lines
17 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993-1999.
  5. //
  6. // File: accprov.h
  7. //
  8. // Contents: public provider independent access control header file
  9. //
  10. // History: 8-94 Created DaveMont
  11. //
  12. //--------------------------------------------------------------------
  13. #ifndef __ACCPROV_H__
  14. #define __ACCPROV_H__
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #include <windows.h>
  19. #include <accctrl.h>
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. //
  24. // Flags
  25. //
  26. #define ACTRL_CAP_NONE 0x00000000L // No special capabilities
  27. #define ACTRL_CAP_KNOWS_SIDS 0x00000001L // Understands/handles SIDS
  28. #define ACTRL_CAP_SUPPORTS_HANDLES 0x00000002L // Does handle based calls
  29. #define ACTRL_CLASS_GENERAL 0x00000000L // Capabilities class
  30. //
  31. // interfaces...
  32. //
  33. //
  34. // Capabilities
  35. //
  36. VOID
  37. WINAPI
  38. AccProvGetCapabilities(IN ULONG fClass,
  39. OUT PULONG pulCaps);
  40. typedef VOID (WINAPI *pfAccProvGetCaps) (ULONG fClass,
  41. PULONG pulCaps);
  42. //
  43. // Accessibility
  44. //
  45. DWORD
  46. WINAPI
  47. AccProvIsObjectAccessible(IN LPCWSTR pwszObjectPath,
  48. IN SE_OBJECT_TYPE ObjType);
  49. DWORD
  50. WINAPI
  51. AccProvHandleIsObjectAccessible(IN HANDLE hObject,
  52. IN SE_OBJECT_TYPE ObjType);
  53. typedef DWORD (WINAPI *pfAccProvObjAccess)
  54. (LPCWSTR pwszObjectPath,
  55. SE_OBJECT_TYPE ObjectType);
  56. typedef DWORD (WINAPI *pfAccProvHandleObjAccess)
  57. (HANDLE hObject,
  58. SE_OBJECT_TYPE ObjectType);
  59. //
  60. // Access / auditing requests
  61. //
  62. DWORD
  63. WINAPI
  64. AccProvGrantAccessRights(IN LPCWSTR pwszPath,
  65. IN SE_OBJECT_TYPE ObjectType,
  66. IN PACTRL_ACCESS pAccessList,
  67. IN PACTRL_AUDIT pAuditList,
  68. IN PACTRL_OVERLAPPED pOverlapped);
  69. DWORD
  70. WINAPI
  71. AccProvGrantHandleAccessRights(IN HANDLE hObject,
  72. IN SE_OBJECT_TYPE ObjectType,
  73. IN PACTRL_ACCESS pAccessList,
  74. IN PACTRL_AUDIT pAuditList,
  75. IN PACTRL_OVERLAPPED pOverlapped);
  76. typedef DWORD (WINAPI *pfAccProvAddRights) (LPCWSTR lpObject,
  77. SE_OBJECT_TYPE ObjectType,
  78. PACTRL_ACCESS pAccessList,
  79. PACTRL_AUDIT pAuditList,
  80. PACTRL_OVERLAPPED pOverlapped);
  81. typedef DWORD (WINAPI *pfAccProvHandleAddRights) (
  82. HANDLE hObject,
  83. SE_OBJECT_TYPE ObjectType,
  84. PACTRL_ACCESS pAccessList,
  85. PACTRL_AUDIT pAuditList,
  86. PACTRL_OVERLAPPED pOverlapped);
  87. DWORD
  88. WINAPI
  89. AccProvSetAccessRights(IN LPCWSTR pwszPath,
  90. IN SE_OBJECT_TYPE ObjectType,
  91. IN SECURITY_INFORMATION SecurityInfo,
  92. IN PACTRL_ACCESS pAccessList,
  93. IN PACTRL_AUDIT pAuditList,
  94. IN PTRUSTEE pOwner,
  95. IN PTRUSTEE pGroup,
  96. IN PACTRL_OVERLAPPED pOverlapped);
  97. DWORD
  98. WINAPI
  99. AccProvHandleSetAccessRights(IN HANDLE hObject,
  100. IN SE_OBJECT_TYPE ObjectType,
  101. IN SECURITY_INFORMATION SecurityInfo,
  102. IN PACTRL_ACCESS pAccessList,
  103. IN PACTRL_AUDIT pAuditList,
  104. IN PTRUSTEE pOwner,
  105. IN PTRUSTEE pGroup,
  106. IN PACTRL_OVERLAPPED pOverlapped);
  107. typedef DWORD (WINAPI *pfAccProvSetRights) (LPCWSTR lpObject,
  108. SE_OBJECT_TYPE ObjectType,
  109. SECURITY_INFORMATION SecurityInfo,
  110. PACTRL_ACCESS pAccessList,
  111. PACTRL_AUDIT pAuditList,
  112. PTRUSTEE pOwner,
  113. PTRUSTEE pGroup,
  114. PACTRL_OVERLAPPED pOverlapped);
  115. typedef DWORD (WINAPI *pfAccProvHandleSetRights) (
  116. HANDLE hObject,
  117. SE_OBJECT_TYPE ObjectType,
  118. SECURITY_INFORMATION SecurityInfo,
  119. PACTRL_ACCESS pAccessList,
  120. PACTRL_AUDIT pAuditList,
  121. PTRUSTEE pOwner,
  122. PTRUSTEE pGroup,
  123. PACTRL_OVERLAPPED pOverlapped);
  124. DWORD
  125. WINAPI
  126. AccProvRevokeAccessRights(IN LPCWSTR pwszPath,
  127. IN SE_OBJECT_TYPE ObjectType,
  128. IN LPCWSTR pwszProperty,
  129. IN ULONG cTrustees,
  130. IN PTRUSTEE prgTrustees,
  131. IN PACTRL_OVERLAPPED pOverlapped);
  132. DWORD
  133. WINAPI
  134. AccProvHandleRevokeAccessRights(IN HANDLE hObject,
  135. IN SE_OBJECT_TYPE ObjectType,
  136. IN LPCWSTR pwszProperty,
  137. IN ULONG cTrustees,
  138. IN PTRUSTEE prgTrustees,
  139. IN PACTRL_OVERLAPPED pOverlapped);
  140. DWORD
  141. WINAPI
  142. AccProvRevokeAuditRights(IN LPCWSTR pwszPath,
  143. IN SE_OBJECT_TYPE ObjectType,
  144. IN LPCWSTR pwszProperty,
  145. IN ULONG cTrustees,
  146. IN PTRUSTEE prgTrustees,
  147. IN PACTRL_OVERLAPPED pOverlapped);
  148. DWORD
  149. WINAPI
  150. AccProvHandleRevokeAuditRights(IN HANDLE hObject,
  151. IN SE_OBJECT_TYPE ObjectType,
  152. IN LPCWSTR pwszProperty,
  153. IN ULONG cTrustees,
  154. IN PTRUSTEE prgTrustees,
  155. IN PACTRL_OVERLAPPED pOverlapped);
  156. typedef DWORD (WINAPI *pfAccProvRevoke) (LPCWSTR lpObject,
  157. SE_OBJECT_TYPE ObjectType,
  158. LPCWSTR pwszProperty,
  159. ULONG cTrustees,
  160. PTRUSTEE pTrusteeList,
  161. PACTRL_OVERLAPPED pOverlapped);
  162. typedef DWORD (WINAPI *pfAccProvHandleRevoke) (
  163. HANDLE hObject,
  164. SE_OBJECT_TYPE ObjectType,
  165. LPCWSTR pwszProperty,
  166. ULONG cTrustees,
  167. PTRUSTEE pTrusteeList,
  168. PACTRL_OVERLAPPED pOverlapped);
  169. DWORD
  170. WINAPI
  171. AccProvGetAllRights(IN LPCWSTR pwszPath,
  172. IN SE_OBJECT_TYPE ObjectType,
  173. IN LPCWSTR pwszProperty,
  174. OUT PACTRL_ACCESS *ppAccessList,
  175. OUT PACTRL_AUDIT *ppAuditList,
  176. OUT PTRUSTEE *ppOwner,
  177. OUT PTRUSTEE *ppGroup);
  178. DWORD
  179. WINAPI
  180. AccProvHandleGetAllRights(IN HANDLE hObject,
  181. IN SE_OBJECT_TYPE ObjectType,
  182. IN LPCWSTR pwszProperty,
  183. OUT PACTRL_ACCESS *ppAccessList,
  184. OUT PACTRL_AUDIT *ppAuditList,
  185. OUT PTRUSTEE *ppOwner,
  186. OUT PTRUSTEE *ppGroup);
  187. typedef DWORD (WINAPI *pfAccProvGetRights) (LPCWSTR lpObject,
  188. SE_OBJECT_TYPE ObjectType,
  189. LPCWSTR pwszProperty,
  190. PACTRL_ACCESS *ppAccessList,
  191. PACTRL_AUDIT *ppAuditList,
  192. PTRUSTEE *ppOwner,
  193. PTRUSTEE *ppGroup);
  194. typedef DWORD (WINAPI *pfAccProvHandleGetRights) (
  195. HANDLE hObject,
  196. SE_OBJECT_TYPE ObjectType,
  197. LPCWSTR pwszProperty,
  198. PACTRL_ACCESS *ppAccessList,
  199. PACTRL_AUDIT *ppAuditList,
  200. PTRUSTEE *ppOwner,
  201. PTRUSTEE *ppGroup);
  202. //
  203. // Access/Audit results
  204. //
  205. DWORD
  206. WINAPI
  207. AccProvGetTrusteesAccess(IN LPCWSTR pwszPath,
  208. IN SE_OBJECT_TYPE ObjectType,
  209. IN PTRUSTEE pTrustee,
  210. IN OUT PTRUSTEE_ACCESS pTrusteeAccess);
  211. DWORD
  212. WINAPI
  213. AccProvHandleGetTrusteesAccess(IN HANDLE hObject,
  214. IN SE_OBJECT_TYPE ObjectType,
  215. IN PTRUSTEE pTrustee,
  216. IN OUT PTRUSTEE_ACCESS pTrusteeAccess);
  217. typedef DWORD (WINAPI *pfAccProvTrusteeAccess)
  218. (LPCWSTR pwszPath,
  219. SE_OBJECT_TYPE ObjectType,
  220. PTRUSTEE pTrustee,
  221. PTRUSTEE_ACCESS pTrusteeAccess);
  222. typedef DWORD (WINAPI *pfAccProvHandleTrusteeAccess)
  223. (HANDLE hObject,
  224. SE_OBJECT_TYPE ObjectType,
  225. PTRUSTEE pTrustee,
  226. PTRUSTEE_ACCESS pTrusteeAccess);
  227. DWORD
  228. WINAPI
  229. AccProvIsAccessAudited(IN LPCWSTR pwszPath,
  230. IN SE_OBJECT_TYPE ObjectType,
  231. IN LPCWSTR pwszProperty,
  232. IN PTRUSTEE pTrustee,
  233. IN ACCESS_RIGHTS AuditRights,
  234. OUT PBOOL pfAuditedSuccess,
  235. OUT PBOOL pfAuditedFailure);
  236. DWORD
  237. WINAPI
  238. AccProvHandleIsAccessAudited(IN HANDLE hObject,
  239. IN SE_OBJECT_TYPE ObjectType,
  240. IN LPCWSTR pwszProperty,
  241. IN PTRUSTEE pTrustee,
  242. IN ACCESS_RIGHTS AuditRights,
  243. OUT PBOOL pfAuditedSuccess,
  244. OUT PBOOL pfAuditedFailure);
  245. typedef DWORD (WINAPI *pfAccProvAccessAudit)
  246. (LPCWSTR pwszObjectPath,
  247. SE_OBJECT_TYPE ObjectType,
  248. LPCWSTR pwszProperty,
  249. TRUSTEE Trustee,
  250. ACCESS_RIGHTS ulRequestedRights,
  251. PBOOL pfAuditedSuccess,
  252. PBOOL pfAuditedFailure);
  253. typedef DWORD (WINAPI *pfAccProvHandleAccessAudit)
  254. (HANDLE hObject,
  255. SE_OBJECT_TYPE ObjectType,
  256. LPCWSTR pwszProperty,
  257. TRUSTEE Trustee,
  258. ACCESS_RIGHTS ulRequestedRights,
  259. PBOOL pfAuditedSuccess,
  260. PBOOL pfAuditedFailure);
  261. DWORD
  262. WINAPI
  263. AccProvGetAccessInfoPerObjectType(IN LPCWSTR lpObject,
  264. IN SE_OBJECT_TYPE ObjectType,
  265. IN LPCWSTR lpProperty,
  266. OUT PULONG pcEntries,
  267. OUT PACTRL_ACCESS_INFO *ppAccessInfoList,
  268. OUT PULONG pcRights,
  269. OUT PACTRL_CONTROL_INFOW *ppRightsList,
  270. OUT PULONG pfAccessFlags);
  271. DWORD
  272. WINAPI
  273. AccProvHandleGetAccessInfoPerObjectType(
  274. IN HANDLE hObject,
  275. IN SE_OBJECT_TYPE ObjectType,
  276. IN LPCWSTR lpProperty,
  277. OUT PULONG pcEntries,
  278. OUT PACTRL_ACCESS_INFO *ppAccessInfoList,
  279. OUT PULONG pcRights,
  280. OUT PACTRL_CONTROL_INFOW *ppRightsList,
  281. OUT PULONG pfAccessFlags);
  282. typedef DWORD (WINAPI *pfAccProvGetObjTypeInfo)
  283. (LPCWSTR lpObject,
  284. SE_OBJECT_TYPE ObjectType,
  285. LPCWSTR lpObjType,
  286. PULONG pcEntries,
  287. PACTRL_ACCESS_INFO *ppAccessInfoList,
  288. PULONG pcRights,
  289. PACTRL_CONTROL_INFO *ppRightsList,
  290. PULONG pfAccessFlags);
  291. typedef DWORD (WINAPI *pfAccProvHandleGetObjTypeInfo)
  292. (HANDLE hObject,
  293. SE_OBJECT_TYPE ObjectType,
  294. LPCWSTR lpObjType,
  295. PULONG pcEntries,
  296. PACTRL_ACCESS_INFO *ppAccessInfoList,
  297. PULONG pcRights,
  298. PACTRL_CONTROL_INFO *ppRightsList,
  299. PULONG pfAccessFlags);
  300. //
  301. // Control functions
  302. //
  303. DWORD
  304. WINAPI
  305. AccProvCancelOperation(IN PACTRL_OVERLAPPED pOverlapped);
  306. typedef DWORD (WINAPI *pfAccProvCancelOp) (PACTRL_OVERLAPPED pOverlapped);
  307. DWORD
  308. WINAPI
  309. AccProvGetOperationResults(IN PACTRL_OVERLAPPED pOverlapped,
  310. OUT PDWORD pResults,
  311. OUT PDWORD pcProcessed);
  312. typedef DWORD (WINAPI *pfAccProvGetResults)
  313. (PACTRL_OVERLAPPED pOverlapped,
  314. PDWORD pResults,
  315. PDWORD pcProcessed);
  316. #ifdef __cplusplus
  317. }
  318. #endif
  319. #endif // __ACCPROV_H__