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.

589 lines
10 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. objects.h
  5. Abstract:
  6. Definitions for the sundry objects implemented by azroles
  7. Author:
  8. Cliff Van Dyke (cliffv) 11-Apr-2001
  9. --*/
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. //
  15. // Structure definitions
  16. //
  17. /////////////////////////////////////////////////////////////////////////////
  18. //
  19. // An Admin Manager
  20. //
  21. typedef struct _AZP_ADMIN_MANAGER {
  22. //
  23. // All objects are a generic objects
  24. //
  25. GENERIC_OBJECT GenericObject;
  26. //
  27. // Define objects that can be children of this admin manager
  28. //
  29. GENERIC_OBJECT_HEAD Applications;
  30. GENERIC_OBJECT_HEAD Groups;
  31. GENERIC_OBJECT_HEAD AzpSids;
  32. //
  33. // Count of all handles referenced for the entire tree of objects
  34. //
  35. LONG TotalHandleReferenceCount;
  36. //
  37. // The peristence provider may store any value it needs to here between
  38. // the call to AzpPersistOpen and AzpPersistClose.
  39. //
  40. PVOID PersistContext;
  41. //
  42. // Policy type/URL
  43. //
  44. ULONG StoreType;
  45. AZP_STRING PolicyUrl;
  46. } AZP_ADMIN_MANAGER, *PAZP_ADMIN_MANAGER;
  47. //
  48. // An Application
  49. //
  50. typedef struct _AZP_APPLICATION {
  51. //
  52. // All objects are a generic objects
  53. //
  54. GENERIC_OBJECT GenericObject;
  55. //
  56. // Attributes from the external definition of the object
  57. //
  58. //
  59. // Define objects that can be children of this application
  60. //
  61. GENERIC_OBJECT_HEAD Operations;
  62. GENERIC_OBJECT_HEAD Tasks;
  63. GENERIC_OBJECT_HEAD Scopes;
  64. GENERIC_OBJECT_HEAD Groups;
  65. GENERIC_OBJECT_HEAD Roles;
  66. GENERIC_OBJECT_HEAD JunctionPoints;
  67. GENERIC_OBJECT_HEAD AzpSids;
  68. GENERIC_OBJECT_HEAD ClientContexts;
  69. //
  70. // An application object is referenced by JunctionPoint objects
  71. //
  72. GENERIC_OBJECT_LIST backJunctionPoints;
  73. //
  74. // An application is known as a resource manager to the authz code
  75. //
  76. AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager;
  77. } AZP_APPLICATION, *PAZP_APPLICATION;
  78. //
  79. // An Operation
  80. //
  81. typedef struct _AZP_OPERATION {
  82. //
  83. // All objects are generic objects
  84. //
  85. GENERIC_OBJECT GenericObject;
  86. //
  87. // Attributes from the external definition of the object
  88. //
  89. ULONG OperationId;
  90. //
  91. // An Operation object is referenced by Tasks objects and Role objects
  92. //
  93. GENERIC_OBJECT_LIST backTasks;
  94. GENERIC_OBJECT_LIST backRoles;
  95. } AZP_OPERATION, *PAZP_OPERATION;
  96. //
  97. // A Task
  98. //
  99. typedef struct _AZP_TASK {
  100. //
  101. // All objects are generic objects
  102. //
  103. GENERIC_OBJECT GenericObject;
  104. //
  105. // Attributes from the external definition of the object
  106. //
  107. AZP_STRING BizRule;
  108. AZP_STRING BizRuleLanguage;
  109. //
  110. // A Task object references a list of Operation objects
  111. //
  112. GENERIC_OBJECT_LIST Operations;
  113. } AZP_TASK, *PAZP_TASK;
  114. //
  115. // A Scope
  116. //
  117. typedef struct _AZP_SCOPE {
  118. //
  119. // All objects are generic objects
  120. //
  121. GENERIC_OBJECT GenericObject;
  122. //
  123. // Attributes from the external definition of the object
  124. //
  125. //
  126. // Roles defined for this scope
  127. //
  128. GENERIC_OBJECT_HEAD Groups;
  129. GENERIC_OBJECT_HEAD Roles;
  130. GENERIC_OBJECT_HEAD AzpSids;
  131. //
  132. // A Scope object is referenced by Role objects
  133. //
  134. GENERIC_OBJECT_LIST backRoles;
  135. } AZP_SCOPE, *PAZP_SCOPE;
  136. //
  137. // A Group
  138. //
  139. typedef struct _AZP_GROUP {
  140. //
  141. // All objects are generic objects
  142. //
  143. GENERIC_OBJECT GenericObject;
  144. //
  145. // Attributes from the external definition of the object
  146. //
  147. ULONG GroupType;
  148. AZP_STRING LdapQuery;
  149. //
  150. // A Group object references a list of Group objects as members and non members
  151. //
  152. GENERIC_OBJECT_LIST AppMembers;
  153. GENERIC_OBJECT_LIST AppNonMembers;
  154. GENERIC_OBJECT_LIST backAppMembers;
  155. GENERIC_OBJECT_LIST backAppNonMembers;
  156. //
  157. // A Group object is referenced by Role objects
  158. //
  159. GENERIC_OBJECT_LIST backRoles;
  160. //
  161. // A Group object references a list of Sid objects as members and non members
  162. //
  163. GENERIC_OBJECT_LIST SidMembers;
  164. GENERIC_OBJECT_LIST SidNonMembers;
  165. } AZP_GROUP, *PAZP_GROUP;
  166. //
  167. // A Role
  168. //
  169. typedef struct _AZP_ROLE {
  170. //
  171. // All objects are generic objects
  172. //
  173. GENERIC_OBJECT GenericObject;
  174. //
  175. // Attributes from the external definition of the object
  176. //
  177. //
  178. // A Role object references a list of Group objects, a list of operation object,
  179. // and a list of Scope objects.
  180. //
  181. //
  182. GENERIC_OBJECT_LIST AppMembers;
  183. GENERIC_OBJECT_LIST Operations;
  184. GENERIC_OBJECT_LIST Scopes;
  185. //
  186. // A Role object references a list of Sid objects as members
  187. //
  188. GENERIC_OBJECT_LIST SidMembers;
  189. } AZP_ROLE, *PAZP_ROLE;
  190. //
  191. // A JunctionPoint
  192. //
  193. typedef struct _AZP_JUNCTION_POINT {
  194. //
  195. // All objects are generic objects
  196. //
  197. GENERIC_OBJECT GenericObject;
  198. //
  199. // Attributes from the external definition of the object
  200. //
  201. //
  202. // A JunctionPoint object references a list of Application objects
  203. // Actually, there can be at most one entry on this list.
  204. //
  205. GENERIC_OBJECT_LIST Applications;
  206. } AZP_JUNCTION_POINT, *PAZP_JUNCTION_POINT;
  207. //
  208. // A Sid.
  209. //
  210. // A Sid object is a pseudo-object. It really doesn't exist from any external
  211. // interface. It exists simply as a holder of back-references to real objects
  212. // that contain lists of sids
  213. //
  214. typedef struct _AZP_SID {
  215. //
  216. // All objects are generic objects
  217. //
  218. // Note that the "ObjectName" of the generic object is really a binary SID.
  219. //
  220. GENERIC_OBJECT GenericObject;
  221. //
  222. // A Sid is referenced by Group objects and Role Objects
  223. //
  224. GENERIC_OBJECT_LIST backGroupMembers;
  225. GENERIC_OBJECT_LIST backGroupNonMembers;
  226. GENERIC_OBJECT_LIST backRoles;
  227. } AZP_SID, *PAZP_SID;
  228. //
  229. // A Client Context
  230. //
  231. // A client context object is a pseudo-object. It is not persisted.
  232. //
  233. typedef struct _AZP_CLIENT_CONTEXT {
  234. //
  235. // All objects are generic objects
  236. //
  237. // Note that the "ObjectName" of the generic object is empty
  238. //
  239. GENERIC_OBJECT GenericObject;
  240. //
  241. // A ClientContext is referenced by Application objects
  242. //
  243. GENERIC_OBJECT_LIST backApplications;
  244. //
  245. // A client context has an underlying authz context
  246. //
  247. AUTHZ_CLIENT_CONTEXT_HANDLE AuthzClientContext;
  248. } AZP_CLIENT_CONTEXT, *PAZP_CLIENT_CONTEXT;
  249. /////////////////////////////////////////////////////////////////////////////
  250. //
  251. // Global definitions
  252. //
  253. /////////////////////////////////////////////////////////////////////////////
  254. extern RTL_RESOURCE AzGlResource;
  255. extern GUID AzGlZeroGuid;
  256. /////////////////////////////////////////////////////////////////////////////
  257. //
  258. // Procedure definitions
  259. //
  260. /////////////////////////////////////////////////////////////////////////////
  261. DWORD
  262. AzpAdminManagerInit(
  263. IN PGENERIC_OBJECT ParentGenericObject,
  264. IN PGENERIC_OBJECT ChildGenericObject
  265. );
  266. DWORD
  267. AzpApplicationInit(
  268. IN PGENERIC_OBJECT ParentGenericObject,
  269. IN PGENERIC_OBJECT ChildGenericObject
  270. );
  271. DWORD
  272. AzpOperationInit(
  273. IN PGENERIC_OBJECT ParentGenericObject,
  274. IN PGENERIC_OBJECT ChildGenericObject
  275. );
  276. DWORD
  277. AzpTaskInit(
  278. IN PGENERIC_OBJECT ParentGenericObject,
  279. IN PGENERIC_OBJECT ChildGenericObject
  280. );
  281. DWORD
  282. AzpScopeInit(
  283. IN PGENERIC_OBJECT ParentGenericObject,
  284. IN PGENERIC_OBJECT ChildGenericObject
  285. );
  286. DWORD
  287. AzpGroupInit(
  288. IN PGENERIC_OBJECT ParentGenericObject,
  289. IN PGENERIC_OBJECT ChildGenericObject
  290. );
  291. DWORD
  292. AzpRoleInit(
  293. IN PGENERIC_OBJECT ParentGenericObject,
  294. IN PGENERIC_OBJECT ChildGenericObject
  295. );
  296. DWORD
  297. AzpJunctionPointInit(
  298. IN PGENERIC_OBJECT ParentGenericObject,
  299. IN PGENERIC_OBJECT ChildGenericObject
  300. );
  301. DWORD
  302. AzpSidInit(
  303. IN PGENERIC_OBJECT ParentGenericObject,
  304. IN PGENERIC_OBJECT ChildGenericObject
  305. );
  306. DWORD
  307. AzpClientContextInit(
  308. IN PGENERIC_OBJECT ParentGenericObject,
  309. IN PGENERIC_OBJECT ChildGenericObject
  310. );
  311. DWORD
  312. AzpOperationGetProperty(
  313. IN PGENERIC_OBJECT GenericObject,
  314. IN ULONG PropertyId,
  315. OUT PVOID *PropertyValue
  316. );
  317. DWORD
  318. AzpOperationSetProperty(
  319. IN PGENERIC_OBJECT GenericObject,
  320. IN ULONG PropertyId,
  321. IN PVOID PropertyValue
  322. );
  323. DWORD
  324. AzpTaskGetProperty(
  325. IN PGENERIC_OBJECT GenericObject,
  326. IN ULONG PropertyId,
  327. OUT PVOID *PropertyValue
  328. );
  329. DWORD
  330. AzpTaskSetProperty(
  331. IN PGENERIC_OBJECT GenericObject,
  332. IN ULONG PropertyId,
  333. IN PVOID PropertyValue
  334. );
  335. DWORD
  336. AzpGroupGetProperty(
  337. IN PGENERIC_OBJECT GenericObject,
  338. IN ULONG PropertyId,
  339. OUT PVOID *PropertyValue
  340. );
  341. DWORD
  342. AzpGroupSetProperty(
  343. IN PGENERIC_OBJECT GenericObject,
  344. IN ULONG PropertyId,
  345. IN PVOID PropertyValue
  346. );
  347. DWORD
  348. AzpJunctionPointSetProperty(
  349. IN PGENERIC_OBJECT GenericObject,
  350. IN ULONG PropertyId,
  351. IN PVOID PropertyValue
  352. );
  353. DWORD
  354. AzpGroupAddPropertyItem(
  355. IN PGENERIC_OBJECT GenericObject,
  356. IN PGENERIC_OBJECT_LIST GenericObjectList,
  357. IN PGENERIC_OBJECT LinkedToObject
  358. );
  359. DWORD
  360. AzpJunctionPointAddPropertyItem(
  361. IN PGENERIC_OBJECT GenericObject,
  362. IN PGENERIC_OBJECT_LIST GenericObjectList,
  363. IN PGENERIC_OBJECT LinkedToObject
  364. );
  365. DWORD
  366. AzpRoleGetProperty(
  367. IN PGENERIC_OBJECT GenericObject,
  368. IN ULONG PropertyId,
  369. OUT PVOID *PropertyValue
  370. );
  371. DWORD
  372. AzpJunctionPointGetProperty(
  373. IN PGENERIC_OBJECT GenericObject,
  374. IN ULONG PropertyId,
  375. OUT PVOID *PropertyValue
  376. );
  377. DWORD
  378. AzpRoleAddPropertyItem(
  379. IN PGENERIC_OBJECT GenericObject,
  380. IN ULONG PropertyId,
  381. IN PGENERIC_OBJECT_LIST GenericObjectList,
  382. IN AZP_STRING ObjectName
  383. );
  384. // ??? ditch functions that are no-ops
  385. VOID
  386. AzpAdminManagerFree(
  387. IN PGENERIC_OBJECT GenericObject
  388. );
  389. VOID
  390. AzpApplicationFree(
  391. IN PGENERIC_OBJECT GenericObject
  392. );
  393. VOID
  394. AzpOperationFree(
  395. IN PGENERIC_OBJECT GenericObject
  396. );
  397. VOID
  398. AzpTaskFree(
  399. IN PGENERIC_OBJECT GenericObject
  400. );
  401. VOID
  402. AzpScopeFree(
  403. IN PGENERIC_OBJECT GenericObject
  404. );
  405. VOID
  406. AzpGroupFree(
  407. IN PGENERIC_OBJECT GenericObject
  408. );
  409. VOID
  410. AzpRoleFree(
  411. IN PGENERIC_OBJECT GenericObject
  412. );
  413. VOID
  414. AzpJunctionPointFree(
  415. IN PGENERIC_OBJECT GenericObject
  416. );
  417. VOID
  418. AzpSidFree(
  419. IN PGENERIC_OBJECT GenericObject
  420. );
  421. VOID
  422. AzpClientContextFree(
  423. IN PGENERIC_OBJECT GenericObject
  424. );
  425. #ifdef __cplusplus
  426. }
  427. #endif