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.

517 lines
15 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects ;both
  2. ;both
  3. Copyright (c) 1993-1999, Microsoft Corporation ;both
  4. ;both
  5. Module Name: ;both
  6. ;both
  7. aclapi.h
  8. aclapip.h ;internal
  9. ;both
  10. Abstract: ;both
  11. ;both
  12. Public
  13. Private ;internal
  14. Structure/constant definitions and typedefines for the Win32 Access ;both
  15. Control APIs ;both
  16. ;both
  17. --*/ ;both
  18. #ifndef __ACCESS_CONTROL_API__
  19. #define __ACCESS_CONTROL_API__
  20. #ifndef __ACCESS_CONTROL_API_P__ ;internal
  21. #define __ACCESS_CONTROL_API_P__ ;internal
  22. ;both
  23. #include <windows.h>
  24. #include <accctrl.h>
  25. #ifdef __cplusplus ;both
  26. extern "C" { ;both
  27. #endif ;both
  28. //
  29. // Progress Function:
  30. // Caller of tree operation implements this Progress function, then
  31. // passes its function pointer to tree operation.
  32. // Tree operation invokes Progress function to provide progress and error
  33. // information to the caller during the potentially long execution
  34. // of the tree operation. Tree operation provides the name of the object
  35. // last processed and the error status of the operation on that object.
  36. // Tree operation also passes the current InvokeSetting value.
  37. // Caller may change the InvokeSetting value, for example, from "Always"
  38. // to "Only On Error."
  39. //
  40. typedef VOID (*FN_PROGRESS) (
  41. IN LPWSTR pObjectName, // name of object just processed
  42. IN DWORD Status, // status of operation on object
  43. IN OUT PPROG_INVOKE_SETTING pInvokeSetting, // Never, always,
  44. IN PVOID Args, // Caller specific data
  45. IN BOOL SecuritySet // Whether security was set
  46. );
  47. WINADVAPI
  48. DWORD
  49. WINAPI
  50. SetEntriesInAcl%(
  51. IN ULONG cCountOfExplicitEntries,
  52. IN PEXPLICIT_ACCESS_% pListOfExplicitEntries,
  53. IN PACL OldAcl,
  54. OUT PACL * NewAcl
  55. );
  56. WINADVAPI
  57. DWORD
  58. WINAPI
  59. GetExplicitEntriesFromAcl%(
  60. IN PACL pacl,
  61. OUT PULONG pcCountOfExplicitEntries,
  62. OUT PEXPLICIT_ACCESS_% * pListOfExplicitEntries
  63. );
  64. WINADVAPI
  65. DWORD
  66. WINAPI
  67. GetEffectiveRightsFromAcl%(
  68. IN PACL pacl,
  69. IN PTRUSTEE_% pTrustee,
  70. OUT PACCESS_MASK pAccessRights
  71. );
  72. WINADVAPI
  73. DWORD
  74. WINAPI
  75. GetAuditedPermissionsFromAcl%(
  76. IN PACL pacl,
  77. IN PTRUSTEE_% pTrustee,
  78. OUT PACCESS_MASK pSuccessfulAuditedRights,
  79. OUT PACCESS_MASK pFailedAuditRights
  80. );
  81. WINADVAPI
  82. DWORD
  83. WINAPI
  84. GetNamedSecurityInfo%(
  85. IN LPTSTR% pObjectName,
  86. IN SE_OBJECT_TYPE ObjectType,
  87. IN SECURITY_INFORMATION SecurityInfo,
  88. OUT PSID * ppsidOwner,
  89. OUT PSID * ppsidGroup,
  90. OUT PACL * ppDacl,
  91. OUT PACL * ppSacl,
  92. OUT PSECURITY_DESCRIPTOR * ppSecurityDescriptor
  93. );
  94. WINADVAPI
  95. DWORD
  96. WINAPI
  97. GetSecurityInfo(
  98. IN HANDLE handle,
  99. IN SE_OBJECT_TYPE ObjectType,
  100. IN SECURITY_INFORMATION SecurityInfo,
  101. OUT PSID * ppsidOwner,
  102. OUT PSID * ppsidGroup,
  103. OUT PACL * ppDacl,
  104. OUT PACL * ppSacl,
  105. OUT PSECURITY_DESCRIPTOR * ppSecurityDescriptor
  106. );
  107. WINADVAPI
  108. DWORD
  109. WINAPI
  110. SetNamedSecurityInfo%(
  111. IN LPTSTR% pObjectName,
  112. IN SE_OBJECT_TYPE ObjectType,
  113. IN SECURITY_INFORMATION SecurityInfo,
  114. IN PSID psidOwner,
  115. IN PSID psidGroup,
  116. IN PACL pDacl,
  117. IN PACL pSacl
  118. );
  119. WINADVAPI
  120. DWORD
  121. WINAPI
  122. SetSecurityInfo(
  123. IN HANDLE handle,
  124. IN SE_OBJECT_TYPE ObjectType,
  125. IN SECURITY_INFORMATION SecurityInfo,
  126. IN PSID psidOwner,
  127. IN PSID psidGroup,
  128. IN PACL pDacl,
  129. IN PACL pSacl
  130. );
  131. WINADVAPI
  132. DWORD
  133. WINAPI
  134. GetInheritanceSource%(
  135. IN LPTSTR% pObjectName,
  136. IN SE_OBJECT_TYPE ObjectType,
  137. IN SECURITY_INFORMATION SecurityInfo,
  138. IN BOOL Container,
  139. IN GUID ** pObjectClassGuids OPTIONAL,
  140. IN DWORD GuidCount,
  141. IN PACL pAcl,
  142. IN PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
  143. IN PGENERIC_MAPPING pGenericMapping,
  144. OUT PINHERITED_FROM% pInheritArray
  145. );
  146. WINADVAPI
  147. DWORD
  148. WINAPI
  149. FreeInheritedFromArray(
  150. IN PINHERITED_FROMW pInheritArray,
  151. IN USHORT AceCnt,
  152. IN PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL
  153. );
  154. WINADVAPI
  155. DWORD
  156. WINAPI
  157. TreeResetNamedSecurityInfo%(
  158. IN LPTSTR% pObjectName,
  159. IN SE_OBJECT_TYPE ObjectType,
  160. IN SECURITY_INFORMATION SecurityInfo,
  161. IN PSID pOwner,
  162. IN PSID pGroup,
  163. IN PACL pDacl,
  164. IN PACL pSacl,
  165. IN BOOL KeepExplicit,
  166. IN FN_PROGRESS fnProgress,
  167. IN PROG_INVOKE_SETTING ProgressInvokeSetting,
  168. IN PVOID Args
  169. );
  170. //----------------------------------------------------------------------------
  171. // The following API are provided for trusted servers to use to
  172. // implement access control on their own objects.
  173. //----------------------------------------------------------------------------
  174. WINADVAPI
  175. DWORD
  176. WINAPI
  177. BuildSecurityDescriptor%(
  178. IN PTRUSTEE_% pOwner,
  179. IN PTRUSTEE_% pGroup,
  180. IN ULONG cCountOfAccessEntries,
  181. IN PEXPLICIT_ACCESS_% pListOfAccessEntries,
  182. IN ULONG cCountOfAuditEntries,
  183. IN PEXPLICIT_ACCESS_% pListOfAuditEntries,
  184. IN PSECURITY_DESCRIPTOR pOldSD,
  185. OUT PULONG pSizeNewSD,
  186. OUT PSECURITY_DESCRIPTOR * pNewSD
  187. );
  188. WINADVAPI
  189. DWORD
  190. WINAPI
  191. LookupSecurityDescriptorParts%(
  192. OUT PTRUSTEE_% * pOwner,
  193. OUT PTRUSTEE_% * pGroup,
  194. OUT PULONG cCountOfAccessEntries,
  195. OUT PEXPLICIT_ACCESS_% * pListOfAccessEntries,
  196. OUT PULONG cCountOfAuditEntries,
  197. OUT PEXPLICIT_ACCESS_% * pListOfAuditEntries,
  198. IN PSECURITY_DESCRIPTOR pSD
  199. );
  200. //----------------------------------------------------------------------------
  201. // The following helper API are provided for building
  202. // access control structures.
  203. //----------------------------------------------------------------------------
  204. WINADVAPI
  205. VOID
  206. WINAPI
  207. BuildExplicitAccessWithName%(
  208. IN OUT PEXPLICIT_ACCESS_% pExplicitAccess,
  209. IN LPTSTR% pTrusteeName,
  210. IN DWORD AccessPermissions,
  211. IN ACCESS_MODE AccessMode,
  212. IN DWORD Inheritance
  213. );
  214. WINADVAPI
  215. VOID
  216. WINAPI
  217. BuildImpersonateExplicitAccessWithName%(
  218. IN OUT PEXPLICIT_ACCESS_% pExplicitAccess,
  219. IN LPTSTR% pTrusteeName,
  220. IN PTRUSTEE_% pTrustee,
  221. IN DWORD AccessPermissions,
  222. IN ACCESS_MODE AccessMode,
  223. IN DWORD Inheritance
  224. );
  225. WINADVAPI
  226. VOID
  227. WINAPI
  228. BuildTrusteeWithName%(
  229. IN OUT PTRUSTEE_% pTrustee,
  230. IN LPTSTR% pName
  231. );
  232. WINADVAPI
  233. VOID
  234. WINAPI
  235. BuildImpersonateTrustee%(
  236. IN OUT PTRUSTEE_% pTrustee,
  237. IN PTRUSTEE_% pImpersonateTrustee
  238. );
  239. WINADVAPI
  240. VOID
  241. WINAPI
  242. BuildTrusteeWithSid%(
  243. IN OUT PTRUSTEE_% pTrustee,
  244. IN PSID pSid
  245. );
  246. WINADVAPI
  247. VOID
  248. WINAPI
  249. BuildTrusteeWithObjectsAndSid%(
  250. IN OUT PTRUSTEE_% pTrustee,
  251. IN POBJECTS_AND_SID pObjSid,
  252. IN GUID * pObjectGuid,
  253. IN GUID * pInheritedObjectGuid,
  254. IN PSID pSid
  255. );
  256. WINADVAPI
  257. VOID
  258. WINAPI
  259. BuildTrusteeWithObjectsAndName%(
  260. IN OUT PTRUSTEE_% pTrustee,
  261. IN POBJECTS_AND_NAME_% pObjName,
  262. IN SE_OBJECT_TYPE ObjectType,
  263. IN LPTSTR% ObjectTypeName,
  264. IN LPTSTR% InheritedObjectTypeName,
  265. IN LPTSTR% Name
  266. );
  267. WINADVAPI
  268. LPTSTR%
  269. WINAPI
  270. GetTrusteeName%(
  271. IN PTRUSTEE_% pTrustee
  272. );
  273. WINADVAPI
  274. TRUSTEE_TYPE
  275. WINAPI
  276. GetTrusteeType%(
  277. IN PTRUSTEE_% pTrustee
  278. );
  279. WINADVAPI
  280. TRUSTEE_FORM
  281. WINAPI
  282. GetTrusteeForm%(
  283. IN PTRUSTEE_% pTrustee
  284. );
  285. WINADVAPI
  286. MULTIPLE_TRUSTEE_OPERATION
  287. WINAPI
  288. GetMultipleTrusteeOperation%(
  289. IN PTRUSTEE_% pTrustee
  290. );
  291. WINADVAPI
  292. PTRUSTEE_%
  293. WINAPI
  294. GetMultipleTrustee%(
  295. IN PTRUSTEE_% pTrustee
  296. );
  297. ;begin_internal
  298. #if(_WIN32_WINNT >= 0x0500)
  299. WINADVAPI
  300. DWORD
  301. WINAPI
  302. GetNamedSecurityInfoEx%(
  303. IN LPCTSTR% lpObject,
  304. IN SE_OBJECT_TYPE ObjectType,
  305. IN SECURITY_INFORMATION SecurityInfo,
  306. IN LPCTSTR% lpProvider,
  307. IN LPCTSTR% lpProperty,
  308. OUT PACTRL_ACCESS% *ppAccessList,
  309. OUT PACTRL_AUDIT% *ppAuditList,
  310. OUT LPTSTR% *lppOwner,
  311. OUT LPTSTR% *lppGroup
  312. );
  313. WINADVAPI
  314. DWORD
  315. WINAPI
  316. SetNamedSecurityInfoEx%(
  317. IN LPCTSTR% lpObject,
  318. IN SE_OBJECT_TYPE ObjectType,
  319. IN SECURITY_INFORMATION SecurityInfo,
  320. IN LPCTSTR% lpProvider,
  321. IN PACTRL_ACCESS% pAccessList,
  322. IN PACTRL_AUDIT% pAuditList,
  323. IN LPTSTR% lpOwner,
  324. IN LPTSTR% lpGroup,
  325. IN PACTRL_OVERLAPPED pOverlapped
  326. );
  327. WINADVAPI
  328. DWORD
  329. WINAPI
  330. GetSecurityInfoEx%(
  331. IN HANDLE hObject,
  332. IN SE_OBJECT_TYPE ObjectType,
  333. IN SECURITY_INFORMATION SecurityInfo,
  334. IN LPCTSTR% lpProvider,
  335. IN LPCTSTR% lpProperty,
  336. OUT PACTRL_ACCESS% *ppAccessList,
  337. OUT PACTRL_AUDIT% *ppAuditList,
  338. OUT LPTSTR% *lppOwner,
  339. OUT LPTSTR% *lppGroup
  340. );
  341. WINADVAPI
  342. DWORD
  343. WINAPI
  344. SetSecurityInfoEx%(
  345. IN HANDLE hObject,
  346. IN SE_OBJECT_TYPE ObjectType,
  347. IN SECURITY_INFORMATION SecurityInfo,
  348. IN LPCTSTR% lpProvider,
  349. IN PACTRL_ACCESS% pAccessList,
  350. IN PACTRL_AUDIT% pAuditList,
  351. IN LPTSTR% lpOwner,
  352. IN LPTSTR% lpGroup,
  353. OUT PACTRL_OVERLAPPED pOverlapped
  354. );
  355. WINADVAPI
  356. DWORD
  357. WINAPI
  358. ConvertAccessToSecurityDescriptor%(
  359. IN PACTRL_ACCESS% pAccessList,
  360. IN PACTRL_AUDIT% pAuditList,
  361. IN LPCTSTR% lpOwner,
  362. IN LPCTSTR% lpGroup,
  363. OUT PSECURITY_DESCRIPTOR *ppSecDescriptor
  364. );
  365. WINADVAPI
  366. DWORD
  367. WINAPI
  368. ConvertSecurityDescriptorToAccess%(
  369. IN HANDLE hObject,
  370. IN SE_OBJECT_TYPE ObjectType,
  371. IN PSECURITY_DESCRIPTOR pSecDescriptor,
  372. OUT PACTRL_ACCESS% *ppAccessList,
  373. OUT PACTRL_AUDIT% *ppAuditList,
  374. OUT LPTSTR% *lppOwner,
  375. OUT LPTSTR% *lppGroup
  376. );
  377. WINADVAPI
  378. DWORD
  379. WINAPI
  380. ConvertSecurityDescriptorToAccessNamed%(
  381. IN LPCTSTR% lpObject,
  382. IN SE_OBJECT_TYPE ObjectType,
  383. IN PSECURITY_DESCRIPTOR pSecDescriptor,
  384. OUT PACTRL_ACCESS% *ppAccessList,
  385. OUT PACTRL_AUDIT% *ppAuditList,
  386. OUT LPTSTR% *lppOwner,
  387. OUT LPTSTR% *lppGroup
  388. );
  389. WINADVAPI
  390. DWORD
  391. WINAPI
  392. SetEntriesInAccessList%(
  393. IN ULONG cEntries,
  394. IN PACTRL_ACCESS_ENTRY% pAccessEntryList,
  395. IN ACCESS_MODE AccessMode,
  396. IN LPCTSTR% lpProperty,
  397. IN PACTRL_ACCESS% pOldList,
  398. OUT PACTRL_ACCESS% *ppNewList
  399. );
  400. WINADVAPI
  401. DWORD
  402. WINAPI
  403. SetEntriesInAuditList%(
  404. IN ULONG cEntries,
  405. IN PACTRL_ACCESS_ENTRY% pAccessEntryList,
  406. IN ACCESS_MODE AccessMode,
  407. IN LPCTSTR% lpProperty,
  408. IN PACTRL_AUDIT% pOldList,
  409. OUT PACTRL_AUDIT% *ppNewList
  410. );
  411. WINADVAPI
  412. DWORD
  413. WINAPI
  414. TrusteeAccessToObject%(
  415. IN LPCTSTR% lpObject,
  416. IN SE_OBJECT_TYPE ObjectType,
  417. IN LPCTSTR% lpProvider,
  418. IN PTRUSTEE_% pTrustee,
  419. IN ULONG cEntries,
  420. IN OUT PTRUSTEE_ACCESS% pTrusteeAccess
  421. );
  422. WINADVAPI
  423. DWORD
  424. WINAPI
  425. GetOverlappedAccessResults(
  426. IN PACTRL_OVERLAPPED pOverlapped,
  427. IN BOOL fWaitForCompletion,
  428. OUT PDWORD pResult,
  429. OUT PULONG pcItemsProcessed OPTIONAL
  430. );
  431. WINADVAPI
  432. DWORD
  433. WINAPI
  434. CancelOverlappedAccess(
  435. IN PACTRL_OVERLAPPED pOverlapped
  436. );
  437. WINADVAPI
  438. DWORD
  439. WINAPI
  440. GetAccessPermissionsForObject%(
  441. IN LPCTSTR% lpObject,
  442. IN SE_OBJECT_TYPE ObjectType,
  443. IN LPCTSTR% lpObjType,
  444. IN LPCTSTR% lpProvider,
  445. OUT PULONG pcEntries,
  446. OUT PACTRL_ACCESS_INFO% *ppAccessInfoList,
  447. OUT PULONG pcRights,
  448. OUT PACTRL_CONTROL_INFO% *ppRightsList,
  449. OUT PULONG pfAccessFlags
  450. );
  451. #endif /* _WIN32_WINNT >= 0x0500 */
  452. ;end_internal
  453. //
  454. // Temporary requirement for the technology preview, no longer required
  455. //
  456. #define AccProvInit(err)
  457. #ifdef __cplusplus ;both
  458. } ;both
  459. #endif ;both
  460. #endif // endif __ACCESS_CONTROL_API_P__ ;internal
  461. #endif // __ACCESS_CONTROL_API__