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.

739 lines
12 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. azrolesp.h
  5. Abstract:
  6. Definitions of C interfaces.
  7. One day all of these interfaces will be in the public SDK. Only such
  8. interfaces exist in this file.
  9. Author:
  10. Cliff Van Dyke (cliffv) 11-Apr-2001
  11. --*/
  12. #ifndef _AZROLESP_H_
  13. #define _AZROLESP_H_
  14. #if !defined(_AZROLESAPI_)
  15. #define WINAZROLES DECLSPEC_IMPORT
  16. #else
  17. #define WINAZROLES
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. /////////////////////////////////////////////////////////////////////////////
  23. //
  24. // Value definitions
  25. //
  26. /////////////////////////////////////////////////////////////////////////////
  27. //
  28. // Common Property IDs
  29. //
  30. // This list of property IDs are common to all objects.
  31. // Each object should pick specific property ids after AZ_PROP_FIRST_SPECIFIC
  32. //
  33. #define AZ_PROP_NAME 1
  34. #define AZ_PROP_DESCRIPTION 2
  35. #define AZ_PROP_FIRST_SPECIFIC 100
  36. //
  37. // Object specific property IDs
  38. //
  39. #define AZ_PROP_OPERATION_ID 200
  40. #define AZ_PROP_TASK_OPERATIONS 300
  41. #define AZ_PROP_TASK_BIZRULE 301
  42. #define AZ_PROP_TASK_BIZRULE_LANGUAGE 302
  43. #define AZ_PROP_GROUP_TYPE 400
  44. #define AZ_GROUPTYPE_LDAP_QUERY 1
  45. #define AZ_GROUPTYPE_MEMBERSHIP 2
  46. #define AZ_PROP_GROUP_APP_MEMBERS 401
  47. #define AZ_PROP_GROUP_APP_NON_MEMBERS 402
  48. #define AZ_PROP_GROUP_LDAP_QUERY 403
  49. #define AZ_PROP_GROUP_MEMBERS 404
  50. #define AZ_PROP_GROUP_NON_MEMBERS 405
  51. #define AZ_PROP_ROLE_APP_MEMBERS 500
  52. #define AZ_PROP_ROLE_MEMBERS 501
  53. #define AZ_PROP_ROLE_OPERATIONS 502
  54. #define AZ_PROP_ROLE_SCOPES 503
  55. #define AZ_PROP_JUNCTION_POINT_APPLICATION 600
  56. //
  57. // Maximum length (in characters) of the object name
  58. //
  59. #define AZ_MAX_APPLICATION_NAME_LENGTH 512
  60. #define AZ_MAX_OPERATION_NAME_LENGTH 64
  61. #define AZ_MAX_TASK_NAME_LENGTH 64
  62. #define AZ_MAX_SCOPE_NAME_LENGTH 65536
  63. #define AZ_MAX_GROUP_NAME_LENGTH 64
  64. #define AZ_MAX_ROLE_NAME_LENGTH 64
  65. #define AZ_MAX_JUNCTION_POINT_NAME_LENGTH 65536
  66. #define AZ_MAX_NAME_LENGTH 65536 // Max of the above
  67. //
  68. // Maximum length (in characters) of the description of an object
  69. //
  70. #define AZ_MAX_DESCRIPTION_LENGTH 256
  71. //
  72. // Maximum length (in characters) of various object strings
  73. //
  74. #define AZ_MAX_POLICY_URL_LENGTH 65536
  75. #define AZ_MAX_TASK_BIZRULE_LENGTH 65536
  76. #define AZ_MAX_TASK_BIZRULE_LANGUAGE_LENGTH 64
  77. #define AZ_MAX_GROUP_LDAP_QUERY_LENGTH 4096
  78. /////////////////////////////////////////////////////////////////////////////
  79. //
  80. // Structure definitions
  81. //
  82. /////////////////////////////////////////////////////////////////////////////
  83. //
  84. // Handle to various objects returned to caller
  85. //
  86. typedef PVOID AZ_HANDLE;
  87. typedef AZ_HANDLE *PAZ_HANDLE;
  88. //
  89. // Array of strings returned from various "GetProperty" procedures
  90. //
  91. typedef struct _AZ_STRING_ARRAY {
  92. //
  93. // Number of strings
  94. //
  95. ULONG StringCount;
  96. //
  97. // An array of StringCount pointers to strings.
  98. //
  99. LPWSTR *Strings;
  100. } AZ_STRING_ARRAY, *PAZ_STRING_ARRAY;
  101. //
  102. // Array of SIDs returned from various "GetProperty" procedures
  103. //
  104. typedef struct _AZ_SID_ARRAY {
  105. //
  106. // Number of SIDs
  107. //
  108. ULONG SidCount;
  109. //
  110. // An array of SidCount pointers to SIDs.
  111. //
  112. PSID *Sids;
  113. } AZ_SID_ARRAY, *PAZ_SID_ARRAY;
  114. /////////////////////////////////////////////////////////////////////////////
  115. //
  116. // Procedure definitions
  117. //
  118. /////////////////////////////////////////////////////////////////////////////
  119. WINAZROLES
  120. DWORD
  121. WINAPI
  122. AzInitialize(
  123. IN DWORD StoreType,
  124. IN LPCWSTR PolicyUrl,
  125. IN DWORD Flags,
  126. IN DWORD Reserved,
  127. OUT PAZ_HANDLE AdminManagerHandle
  128. );
  129. //
  130. // Flags to Admin Manager routines
  131. //
  132. #define AZ_ADMIN_FLAG_CREATE 0x0001 // Create the policy instead of opening it
  133. #define AZ_ADMIN_FLAG_VALID 0x0001 // Mask of all valid flags
  134. //
  135. // Valid Store types
  136. //
  137. #define AZ_ADMIN_STORE_UNKNOWN 0x00 // Use the Policy URL to determine store type
  138. #define AZ_ADMIN_STORE_AD 0x01 // Active Directory
  139. #define AZ_ADMIN_STORE_XML 0x02 // XML file
  140. #define AZ_ADMIN_STORE_SAMPLE 0x03 // Temporary sample provider
  141. //
  142. // Application routines
  143. //
  144. WINAZROLES
  145. DWORD
  146. WINAPI
  147. AzApplicationCreate(
  148. IN AZ_HANDLE AdminManagerHandle,
  149. IN LPCWSTR ApplicationName,
  150. IN DWORD Reserved,
  151. OUT PAZ_HANDLE ApplicationHandle
  152. );
  153. WINAZROLES
  154. DWORD
  155. WINAPI
  156. AzApplicationOpen(
  157. IN AZ_HANDLE AdminManagerHandle,
  158. IN LPCWSTR ApplicationName,
  159. IN DWORD Reserved,
  160. OUT PAZ_HANDLE ApplicationHandle
  161. );
  162. WINAZROLES
  163. DWORD
  164. WINAPI
  165. AzApplicationEnum(
  166. IN AZ_HANDLE AdminManagerHandle,
  167. IN DWORD Reserved,
  168. IN OUT PULONG EnumerationContext,
  169. OUT PAZ_HANDLE ApplicationHandle
  170. );
  171. WINAZROLES
  172. DWORD
  173. WINAPI
  174. AzApplicationGetProperty(
  175. IN AZ_HANDLE ApplicationHandle,
  176. IN ULONG PropertyId,
  177. IN DWORD Reserved,
  178. OUT PVOID *PropertyValue
  179. );
  180. WINAZROLES
  181. DWORD
  182. WINAPI
  183. AzApplicationSetProperty(
  184. IN AZ_HANDLE ApplicationHandle,
  185. IN ULONG PropertyId,
  186. IN DWORD Reserved,
  187. IN PVOID PropertyValue
  188. );
  189. WINAZROLES
  190. DWORD
  191. WINAPI
  192. AzApplicationDelete(
  193. IN AZ_HANDLE AdminManagerHandle,
  194. IN LPCWSTR ApplicationName,
  195. IN DWORD Reserved
  196. );
  197. //
  198. // Operation routines
  199. //
  200. WINAZROLES
  201. DWORD
  202. WINAPI
  203. AzOperationCreate(
  204. IN AZ_HANDLE ApplicationHandle,
  205. IN LPCWSTR OperationName,
  206. IN DWORD Reserved,
  207. OUT PAZ_HANDLE OperationHandle
  208. );
  209. WINAZROLES
  210. DWORD
  211. WINAPI
  212. AzOperationOpen(
  213. IN AZ_HANDLE ApplicationHandle,
  214. IN LPCWSTR OperationName,
  215. IN DWORD Reserved,
  216. OUT PAZ_HANDLE OperationHandle
  217. );
  218. WINAZROLES
  219. DWORD
  220. WINAPI
  221. AzOperationEnum(
  222. IN AZ_HANDLE ApplicationHandle,
  223. IN DWORD Reserved,
  224. IN OUT PULONG EnumerationContext,
  225. OUT PAZ_HANDLE OperationHandle
  226. );
  227. WINAZROLES
  228. DWORD
  229. WINAPI
  230. AzOperationGetProperty(
  231. IN AZ_HANDLE OperationHandle,
  232. IN ULONG PropertyId,
  233. IN DWORD Reserved,
  234. OUT PVOID *PropertyValue
  235. );
  236. WINAZROLES
  237. DWORD
  238. WINAPI
  239. AzOperationSetProperty(
  240. IN AZ_HANDLE OperationHandle,
  241. IN ULONG PropertyId,
  242. IN DWORD Reserved,
  243. IN PVOID PropertyValue
  244. );
  245. WINAZROLES
  246. DWORD
  247. WINAPI
  248. AzOperationDelete(
  249. IN AZ_HANDLE ApplicationHandle,
  250. IN LPCWSTR OperationName,
  251. IN DWORD Reserved
  252. );
  253. //
  254. // Task routines
  255. //
  256. WINAZROLES
  257. DWORD
  258. WINAPI
  259. AzTaskCreate(
  260. IN AZ_HANDLE ApplicationHandle,
  261. IN LPCWSTR TaskName,
  262. IN DWORD Reserved,
  263. OUT PAZ_HANDLE TaskHandle
  264. );
  265. WINAZROLES
  266. DWORD
  267. WINAPI
  268. AzTaskOpen(
  269. IN AZ_HANDLE ApplicationHandle,
  270. IN LPCWSTR TaskName,
  271. IN DWORD Reserved,
  272. OUT PAZ_HANDLE TaskHandle
  273. );
  274. WINAZROLES
  275. DWORD
  276. WINAPI
  277. AzTaskEnum(
  278. IN AZ_HANDLE ApplicationHandle,
  279. IN DWORD Reserved,
  280. IN OUT PULONG EnumerationContext,
  281. OUT PAZ_HANDLE TaskHandle
  282. );
  283. WINAZROLES
  284. DWORD
  285. WINAPI
  286. AzTaskGetProperty(
  287. IN AZ_HANDLE TaskHandle,
  288. IN ULONG PropertyId,
  289. IN DWORD Reserved,
  290. OUT PVOID *PropertyValue
  291. );
  292. WINAZROLES
  293. DWORD
  294. WINAPI
  295. AzTaskSetProperty(
  296. IN AZ_HANDLE TaskHandle,
  297. IN ULONG PropertyId,
  298. IN DWORD Reserved,
  299. IN PVOID PropertyValue
  300. );
  301. WINAZROLES
  302. DWORD
  303. WINAPI
  304. AzTaskAddPropertyItem(
  305. IN AZ_HANDLE TaskHandle,
  306. IN ULONG PropertyId,
  307. IN DWORD Reserved,
  308. IN PVOID PropertyValue
  309. );
  310. WINAZROLES
  311. DWORD
  312. WINAPI
  313. AzTaskRemovePropertyItem(
  314. IN AZ_HANDLE TaskHandle,
  315. IN ULONG PropertyId,
  316. IN DWORD Reserved,
  317. IN PVOID PropertyValue
  318. );
  319. WINAZROLES
  320. DWORD
  321. WINAPI
  322. AzTaskDelete(
  323. IN AZ_HANDLE ApplicationHandle,
  324. IN LPCWSTR TaskName,
  325. IN DWORD Reserved
  326. );
  327. //
  328. // Scope routines
  329. //
  330. WINAZROLES
  331. DWORD
  332. WINAPI
  333. AzScopeCreate(
  334. IN AZ_HANDLE ApplicationHandle,
  335. IN LPCWSTR ScopeName,
  336. IN DWORD Reserved,
  337. OUT PAZ_HANDLE ScopeHandle
  338. );
  339. WINAZROLES
  340. DWORD
  341. WINAPI
  342. AzScopeOpen(
  343. IN AZ_HANDLE ApplicationHandle,
  344. IN LPCWSTR ScopeName,
  345. IN DWORD Reserved,
  346. OUT PAZ_HANDLE ScopeHandle
  347. );
  348. WINAZROLES
  349. DWORD
  350. WINAPI
  351. AzScopeEnum(
  352. IN AZ_HANDLE ApplicationHandle,
  353. IN DWORD Reserved,
  354. IN OUT PULONG EnumerationContext,
  355. OUT PAZ_HANDLE ScopeHandle
  356. );
  357. WINAZROLES
  358. DWORD
  359. WINAPI
  360. AzScopeGetProperty(
  361. IN AZ_HANDLE ScopeHandle,
  362. IN ULONG PropertyId,
  363. IN DWORD Reserved,
  364. OUT PVOID *PropertyValue
  365. );
  366. WINAZROLES
  367. DWORD
  368. WINAPI
  369. AzScopeSetProperty(
  370. IN AZ_HANDLE ScopeHandle,
  371. IN ULONG PropertyId,
  372. IN DWORD Reserved,
  373. IN PVOID PropertyValue
  374. );
  375. WINAZROLES
  376. DWORD
  377. WINAPI
  378. AzScopeDelete(
  379. IN AZ_HANDLE ApplicationHandle,
  380. IN LPCWSTR ScopeName,
  381. IN DWORD Reserved
  382. );
  383. //
  384. // JunctionPoint routines
  385. //
  386. WINAZROLES
  387. DWORD
  388. WINAPI
  389. AzJunctionPointCreate(
  390. IN AZ_HANDLE ApplicationHandle,
  391. IN LPCWSTR JunctionPointName,
  392. IN DWORD Reserved,
  393. OUT PAZ_HANDLE JunctionPointHandle
  394. );
  395. WINAZROLES
  396. DWORD
  397. WINAPI
  398. AzJunctionPointOpen(
  399. IN AZ_HANDLE ApplicationHandle,
  400. IN LPCWSTR JunctionPointName,
  401. IN DWORD Reserved,
  402. OUT PAZ_HANDLE JunctionPointHandle
  403. );
  404. WINAZROLES
  405. DWORD
  406. WINAPI
  407. AzJunctionPointEnum(
  408. IN AZ_HANDLE ApplicationHandle,
  409. IN DWORD Reserved,
  410. IN OUT PULONG EnumerationContext,
  411. OUT PAZ_HANDLE JunctionPointHandle
  412. );
  413. WINAZROLES
  414. DWORD
  415. WINAPI
  416. AzJunctionPointGetProperty(
  417. IN AZ_HANDLE JunctionPointHandle,
  418. IN ULONG PropertyId,
  419. IN DWORD Reserved,
  420. OUT PVOID *PropertyValue
  421. );
  422. WINAZROLES
  423. DWORD
  424. WINAPI
  425. AzJunctionPointSetProperty(
  426. IN AZ_HANDLE JunctionPointHandle,
  427. IN ULONG PropertyId,
  428. IN DWORD Reserved,
  429. IN PVOID PropertyValue
  430. );
  431. WINAZROLES
  432. DWORD
  433. WINAPI
  434. AzJunctionPointDelete(
  435. IN AZ_HANDLE ApplicationHandle,
  436. IN LPCWSTR JunctionPointName,
  437. IN DWORD Reserved
  438. );
  439. //
  440. // Group routines
  441. //
  442. WINAZROLES
  443. DWORD
  444. WINAPI
  445. AzGroupCreate(
  446. IN AZ_HANDLE ParentHandle,
  447. IN LPCWSTR GroupName,
  448. IN DWORD Reserved,
  449. OUT PAZ_HANDLE GroupHandle
  450. );
  451. WINAZROLES
  452. DWORD
  453. WINAPI
  454. AzGroupOpen(
  455. IN AZ_HANDLE ParentHandle,
  456. IN LPCWSTR GroupName,
  457. IN DWORD Reserved,
  458. OUT PAZ_HANDLE GroupHandle
  459. );
  460. WINAZROLES
  461. DWORD
  462. WINAPI
  463. AzGroupEnum(
  464. IN AZ_HANDLE ParentHandle,
  465. IN DWORD Reserved,
  466. IN OUT PULONG EnumerationContext,
  467. OUT PAZ_HANDLE GroupHandle
  468. );
  469. WINAZROLES
  470. DWORD
  471. WINAPI
  472. AzGroupGetProperty(
  473. IN AZ_HANDLE GroupHandle,
  474. IN ULONG PropertyId,
  475. IN DWORD Reserved,
  476. OUT PVOID *PropertyValue
  477. );
  478. WINAZROLES
  479. DWORD
  480. WINAPI
  481. AzGroupSetProperty(
  482. IN AZ_HANDLE GroupHandle,
  483. IN ULONG PropertyId,
  484. IN DWORD Reserved,
  485. IN PVOID PropertyValue
  486. );
  487. WINAZROLES
  488. DWORD
  489. WINAPI
  490. AzGroupAddPropertyItem(
  491. IN AZ_HANDLE GroupHandle,
  492. IN ULONG PropertyId,
  493. IN DWORD Reserved,
  494. IN PVOID PropertyValue
  495. );
  496. WINAZROLES
  497. DWORD
  498. WINAPI
  499. AzGroupRemovePropertyItem(
  500. IN AZ_HANDLE GroupHandle,
  501. IN ULONG PropertyId,
  502. IN DWORD Reserved,
  503. IN PVOID PropertyValue
  504. );
  505. WINAZROLES
  506. DWORD
  507. WINAPI
  508. AzGroupDelete(
  509. IN AZ_HANDLE ParentHandle,
  510. IN LPCWSTR GroupName,
  511. IN DWORD Reserved
  512. );
  513. //
  514. // Role routines
  515. //
  516. WINAZROLES
  517. DWORD
  518. WINAPI
  519. AzRoleCreate(
  520. IN AZ_HANDLE ParentHandle,
  521. IN LPCWSTR RoleName,
  522. IN DWORD Reserved,
  523. OUT PAZ_HANDLE RoleHandle
  524. );
  525. WINAZROLES
  526. DWORD
  527. WINAPI
  528. AzRoleOpen(
  529. IN AZ_HANDLE ParentHandle,
  530. IN LPCWSTR RoleName,
  531. IN DWORD Reserved,
  532. OUT PAZ_HANDLE RoleHandle
  533. );
  534. WINAZROLES
  535. DWORD
  536. WINAPI
  537. AzRoleEnum(
  538. IN AZ_HANDLE ParentHandle,
  539. IN DWORD Reserved,
  540. IN OUT PULONG EnumerationContext,
  541. OUT PAZ_HANDLE RoleHandle
  542. );
  543. WINAZROLES
  544. DWORD
  545. WINAPI
  546. AzRoleGetProperty(
  547. IN AZ_HANDLE RoleHandle,
  548. IN ULONG PropertyId,
  549. IN DWORD Reserved,
  550. OUT PVOID *PropertyValue
  551. );
  552. WINAZROLES
  553. DWORD
  554. WINAPI
  555. AzRoleSetProperty(
  556. IN AZ_HANDLE RoleHandle,
  557. IN ULONG PropertyId,
  558. IN DWORD Reserved,
  559. IN PVOID PropertyValue
  560. );
  561. WINAZROLES
  562. DWORD
  563. WINAPI
  564. AzRoleAddPropertyItem(
  565. IN AZ_HANDLE RoleHandle,
  566. IN ULONG PropertyId,
  567. IN DWORD Reserved,
  568. IN PVOID PropertyValue
  569. );
  570. WINAZROLES
  571. DWORD
  572. WINAPI
  573. AzRoleRemovePropertyItem(
  574. IN AZ_HANDLE RoleHandle,
  575. IN ULONG PropertyId,
  576. IN DWORD Reserved,
  577. IN PVOID PropertyValue
  578. );
  579. WINAZROLES
  580. DWORD
  581. WINAPI
  582. AzRoleDelete(
  583. IN AZ_HANDLE ParentHandle,
  584. IN LPCWSTR RoleName,
  585. IN DWORD Reserved
  586. );
  587. //
  588. // Routines common to all objects
  589. //
  590. WINAZROLES
  591. DWORD
  592. WINAPI
  593. AzCloseHandle(
  594. IN AZ_HANDLE AzHandle,
  595. IN DWORD Reserved
  596. );
  597. WINAZROLES
  598. DWORD
  599. WINAPI
  600. AzSubmit(
  601. IN AZ_HANDLE AzHandle,
  602. IN DWORD Reserved
  603. );
  604. WINAZROLES
  605. VOID
  606. WINAPI
  607. AzFreeMemory(
  608. IN PVOID Buffer
  609. );
  610. //
  611. // Private routine
  612. //
  613. WINAZROLES
  614. VOID
  615. WINAPI
  616. AzpUnload(
  617. VOID
  618. );
  619. #ifdef __cplusplus
  620. }
  621. #endif
  622. #endif // _AZROLESP_H_