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.

1058 lines
22 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. Revision History:
  10. 20-Aug-2001 chaitu
  11. Added critical section serialization for LDAP
  12. 6-Oct-2001
  13. Added private variables to AzApplication and AzScope
  14. to temporarily store GUIDized CN for AD store
  15. --*/
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /////////////////////////////////////////////////////////////////////////////
  20. //
  21. // Structure definitions
  22. //
  23. /////////////////////////////////////////////////////////////////////////////
  24. //
  25. // An Authorization Store
  26. //
  27. typedef struct _AZP_AZSTORE {
  28. //
  29. // All objects are a generic objects
  30. //
  31. GENERIC_OBJECT GenericObject;
  32. //
  33. // Define objects that can be children of this AuthorizationStore
  34. //
  35. GENERIC_OBJECT_HEAD Applications;
  36. GENERIC_OBJECT_HEAD Groups;
  37. //
  38. // Identifies the persistence provider
  39. //
  40. PAZPE_PROVIDER_INFO ProviderInfo;
  41. //
  42. // This context identifies the instance of the persistence provider.
  43. //
  44. AZPE_PERSIST_CONTEXT PersistContext;
  45. HMODULE ProviderDll;
  46. //
  47. // Policy type/URL
  48. //
  49. AZP_STRING PolicyUrl;
  50. //
  51. // target machine name for the policy URL
  52. //
  53. AZP_STRING TargetMachine;
  54. //
  55. // Persistence engine operations are serialized by PersistCritSect
  56. //
  57. SAFE_CRITICAL_SECTION PersistCritSect;
  58. BOOLEAN PersistCritSectInitialized;
  59. //
  60. // List of NEW_OBJECT_NAME structs.
  61. // (See the comment on NEW_OBJECT_NAME)
  62. //
  63. LIST_ENTRY NewNames;
  64. //
  65. // Domain Timeout.
  66. // These variables represent our ability to cache the fact that a DC is down in a domain.
  67. // Access to all variables are serialized by DomainCritSect.
  68. //
  69. SAFE_CRITICAL_SECTION DomainCritSect;
  70. BOOLEAN DomainCritSectInitialized;
  71. //
  72. // Time (in milliseconds) after a domain is detected to be unreachable before we'll attempt
  73. // to contact a DC again.
  74. //
  75. LONG DomainTimeout;
  76. //
  77. // List of domains we've used.
  78. //
  79. LIST_ENTRY Domains;
  80. //
  81. // List of Free scripts in LRU order
  82. // Access serialized by FreeScriptCritSect
  83. LIST_ENTRY LruFreeScriptHead;
  84. LONG LruFreeScriptCount;
  85. SAFE_CRITICAL_SECTION FreeScriptCritSect;
  86. BOOLEAN FreeScriptCritSectInitialized;
  87. //
  88. // Maximum number of script engines that can be cached at one time
  89. //
  90. LONG MaxScriptEngines;
  91. //
  92. // Time (in milliseconds) that a script is allowed to run before being automatically
  93. // terminated.
  94. //
  95. LONG ScriptEngineTimeout;
  96. HANDLE ScriptEngineTimerQueue;
  97. //
  98. // Count of the number of times group evaluation has been flushed
  99. //
  100. ULONG GroupEvalSerialNumber;
  101. //
  102. // Count of the number of times the operation cache has been flushed
  103. //
  104. ULONG OpCacheSerialNumber;
  105. //
  106. // Audit related structures.
  107. //
  108. //
  109. // TRUE if a user has SE_SECURITY_PRIVILEGE
  110. //
  111. BOOLEAN HasSecurityPrivilege;
  112. // Audit handles for different audit types.
  113. AUTHZ_AUDIT_EVENT_TYPE_HANDLE hClientContextCreateAuditEventType;
  114. AUTHZ_AUDIT_EVENT_TYPE_HANDLE hClientContextDeleteAuditEventType;
  115. AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAccessCheckAuditEventType;
  116. AUTHZ_AUDIT_EVENT_TYPE_HANDLE hApplicationInitializationAuditEventType;
  117. AUTHZ_AUDIT_EVENT_TYPE_HANDLE hClientContextCreateNameAuditEventType;
  118. AUTHZ_AUDIT_EVENT_TYPE_HANDLE hClientContextDeleteNameAuditEventType;
  119. AUTHZ_AUDIT_EVENT_TYPE_HANDLE hAccessCheckNameAuditEventType;
  120. //
  121. // Version numbers
  122. //
  123. ULONG MajorVersion;
  124. ULONG MinorVersion;
  125. //
  126. // Initialize flag
  127. //
  128. ULONG InitializeFlag;
  129. //
  130. // TRUE if the provider supports lazy load for children
  131. //
  132. BOOLEAN ChildLazyLoadSupported;
  133. } AZP_AZSTORE, *PAZP_AZSTORE;
  134. //
  135. // An Application
  136. //
  137. typedef struct _AZP_APPLICATION {
  138. //
  139. // All objects are a generic objects
  140. //
  141. GENERIC_OBJECT GenericObject;
  142. //
  143. // Attributes from the external definition of the object
  144. //
  145. AZP_STRING AuthzInterfaceClsid;
  146. AZP_STRING AppVersion;
  147. //
  148. // Define objects that can be children of this application
  149. //
  150. GENERIC_OBJECT_HEAD Operations;
  151. GENERIC_OBJECT_HEAD Tasks;
  152. GENERIC_OBJECT_HEAD Scopes;
  153. GENERIC_OBJECT_HEAD Groups;
  154. GENERIC_OBJECT_HEAD Roles;
  155. GENERIC_OBJECT_HEAD ClientContexts;
  156. //
  157. // An application is known as a resource manager to the authz code
  158. //
  159. AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager;
  160. //
  161. // Application instace Luid.
  162. //
  163. LUID InstanceId;
  164. //
  165. // Boolean to indicate if the application object needs to be unloaded
  166. // from the cache, i.e., its children removed from cache. The application
  167. // object will continue to reside in the cache for enumeration purposes
  168. //
  169. BOOLEAN UnloadApplicationObject;
  170. //
  171. // A sequence number needed to check if a COM handle to this object is
  172. // valid after the application object has been closed
  173. //
  174. DWORD AppSequenceNumber;
  175. } AZP_APPLICATION, *PAZP_APPLICATION;
  176. //
  177. // An Operation
  178. //
  179. typedef struct _AZP_OPERATION {
  180. //
  181. // All objects are generic objects
  182. //
  183. GENERIC_OBJECT GenericObject;
  184. //
  185. // Attributes from the external definition of the object
  186. //
  187. LONG OperationId;
  188. //
  189. // An Operation object is referenced by Tasks objects and Role objects
  190. //
  191. GENERIC_OBJECT_LIST backTasks;
  192. GENERIC_OBJECT_LIST backRoles;
  193. } AZP_OPERATION, *PAZP_OPERATION;
  194. //
  195. // A Task
  196. //
  197. typedef struct _AZP_TASK {
  198. //
  199. // All objects are generic objects
  200. //
  201. GENERIC_OBJECT GenericObject;
  202. //
  203. // Attributes from the external definition of the object
  204. //
  205. AZP_STRING BizRule; // Modification serialized by RunningScriptCritSect
  206. AZP_STRING BizRuleLanguage;
  207. CLSID BizRuleLanguageClsid; //The CLSID corresponding to BizRuleLanguage
  208. AZP_STRING BizRuleImportedPath;
  209. LONG IsRoleDefinition;
  210. //
  211. // A Task object references a list of Operation objects
  212. //
  213. GENERIC_OBJECT_LIST Operations;
  214. //
  215. // An Task object is referenced by Role objects
  216. //
  217. GENERIC_OBJECT_LIST backRoles;
  218. //
  219. // An Task object references other task objects
  220. //
  221. GENERIC_OBJECT_LIST Tasks;
  222. GENERIC_OBJECT_LIST backTasks;
  223. //
  224. // Maintain a list of free script engines for running the bizrule
  225. // Access serialized by AzAuthorizationStore->FreeScriptCritSect
  226. //
  227. LIST_ENTRY FreeScriptHead;
  228. //
  229. // Maintain a cache of running script engines
  230. //
  231. SAFE_CRITICAL_SECTION RunningScriptCritSect;
  232. BOOLEAN RunningScriptCritSectInitialized;
  233. LIST_ENTRY RunningScriptHead;
  234. ULONG BizRuleSerialNumber; // Access serialized by RunningScriptCritSect
  235. } AZP_TASK, *PAZP_TASK;
  236. //
  237. // A Scope
  238. //
  239. typedef struct _AZP_SCOPE {
  240. //
  241. // All objects are generic objects
  242. //
  243. GENERIC_OBJECT GenericObject;
  244. //
  245. // Attributes from the external definition of the object
  246. //
  247. //
  248. // Roles defined for this scope
  249. //
  250. GENERIC_OBJECT_HEAD Tasks;
  251. GENERIC_OBJECT_HEAD Groups;
  252. GENERIC_OBJECT_HEAD Roles;
  253. } AZP_SCOPE, *PAZP_SCOPE;
  254. //
  255. // A Group
  256. //
  257. typedef struct _AZP_GROUP {
  258. //
  259. // All objects are generic objects
  260. //
  261. GENERIC_OBJECT GenericObject;
  262. //
  263. // Attributes from the external definition of the object
  264. //
  265. LONG GroupType;
  266. AZP_STRING LdapQuery;
  267. //
  268. // A Group object references a list of Group objects as members and non members
  269. //
  270. GENERIC_OBJECT_LIST AppMembers;
  271. GENERIC_OBJECT_LIST AppNonMembers;
  272. GENERIC_OBJECT_LIST backAppMembers;
  273. GENERIC_OBJECT_LIST backAppNonMembers;
  274. //
  275. // A Group object is referenced by Role objects
  276. //
  277. GENERIC_OBJECT_LIST backRoles;
  278. //
  279. // A Group object references a list of Sid objects as members and non members
  280. //
  281. GENERIC_OBJECT_LIST SidMembers;
  282. GENERIC_OBJECT_LIST SidNonMembers;
  283. } AZP_GROUP, *PAZP_GROUP;
  284. //
  285. // A Role
  286. //
  287. typedef struct _AZP_ROLE {
  288. //
  289. // All objects are generic objects
  290. //
  291. GENERIC_OBJECT GenericObject;
  292. //
  293. // Attributes from the external definition of the object
  294. //
  295. //
  296. // A Role object references a list of Group objects, a list of operation objects,
  297. // and a list of task objects.
  298. //
  299. //
  300. GENERIC_OBJECT_LIST AppMembers;
  301. GENERIC_OBJECT_LIST Operations;
  302. GENERIC_OBJECT_LIST Tasks;
  303. //
  304. // A Role object references a list of Sid objects as members
  305. //
  306. GENERIC_OBJECT_LIST SidMembers;
  307. } AZP_ROLE, *PAZP_ROLE;
  308. //
  309. // A Sid.
  310. //
  311. // A Sid object is a pseudo-object. It really doesn't exist from any external
  312. // interface. It exists simply as a holder of back-references to real objects
  313. // that contain lists of sids
  314. //
  315. typedef struct _AZP_SID {
  316. //
  317. // All objects are generic objects
  318. //
  319. // Note that the "ObjectName" of the generic object is really a binary SID.
  320. //
  321. GENERIC_OBJECT GenericObject;
  322. //
  323. // A Sid is referenced by Group objects and Role Objects
  324. //
  325. GENERIC_OBJECT_LIST backGroupMembers;
  326. GENERIC_OBJECT_LIST backGroupNonMembers;
  327. GENERIC_OBJECT_LIST backRoles;
  328. GENERIC_OBJECT_LIST backAdmins;
  329. GENERIC_OBJECT_LIST backReaders;
  330. GENERIC_OBJECT_LIST backDelegatedPolicyUsers;
  331. } AZP_SID, *PAZP_SID;
  332. //
  333. // A Client Context
  334. //
  335. // A client context object is a pseudo-object. It is not persisted.
  336. //
  337. typedef struct _AZP_CLIENT_CONTEXT {
  338. //
  339. // All objects are generic objects
  340. //
  341. // Note that the "ObjectName" of the generic object is empty
  342. //
  343. GENERIC_OBJECT GenericObject;
  344. //
  345. // A ClientContext is referenced by Application objects
  346. //
  347. GENERIC_OBJECT_LIST backApplications;
  348. //
  349. // The client context is typically accessed with the AzGlResource locked shared.
  350. // That allows multiple access check operations to be performed simultaneously.
  351. // This crit sect protects the field of the client context.
  352. //
  353. SAFE_CRITICAL_SECTION CritSect;
  354. BOOLEAN CritSectInitialized;
  355. //
  356. // A client context has an underlying authz context
  357. //
  358. // This field is only modified during ClientContext creation and deletion. Both
  359. // of which happen with AzGlResource locked exclusively. So, references to this field
  360. // are allowed anytime the GenericObject.ReferenceCount is incremented.
  361. //
  362. AUTHZ_CLIENT_CONTEXT_HANDLE AuthzClientContext;
  363. //
  364. // Creation routine for the client context.
  365. // We only have two creation routines right now.
  366. // FromToken
  367. // FromName
  368. //
  369. #define AZP_CONTEXT_CREATED_FROM_TOKEN 0x1
  370. #define AZP_CONTEXT_CREATED_FROM_NAME 0x2
  371. #define AZP_CONTEXT_CREATED_FROM_SID 0x4
  372. DWORD CreationType;
  373. //
  374. // The token handle of the client.
  375. // If the client has no token, this value is INVALID_TOKEN_HANDLE.
  376. //
  377. // This field is only modified during ClientContext creation and deletion. Both
  378. // of which happen with AzGlResource locked exclusively. So, references to this field
  379. // are allowed anytime the GenericObject.ReferenceCount is incremented.
  380. // This has a valid handle if the CreationType is AZP_CONTEXT_CREATED_FROM_TOKEN.
  381. //
  382. HANDLE TokenHandle;
  383. //
  384. // The (Domain, Client) pair to represent the client.
  385. // This has valid strings if CreationType is AZP_CONTEXT_CREATED_FROM_NAME.
  386. //
  387. LPWSTR DomainName;
  388. LPWSTR ClientName;
  389. UCHAR SidBuffer[SECURITY_MAX_SID_SIZE];
  390. //
  391. // The DN of the account representing the user sid
  392. // Access to this field is serialized by ClientContext->CritSect.
  393. //
  394. LPWSTR AccountDn;
  395. //
  396. // The Domain handle of the account domain for the user account.
  397. // If the Domain is NULL, either the domain isn't known or the domain doesn't
  398. // support LDAP (because either the domain is an NT 4.0 (or older) domain or the account
  399. // is a local account). Check the LdapNotSupported boolean to differentiate.
  400. //
  401. // Access to these fields are serialized by ClientContext->CritSect.
  402. //
  403. PVOID Domain;
  404. BOOLEAN LdapNotSupported;
  405. //
  406. // List of our status' for evaluating membership in app groups
  407. // Access to this field is serialized by ClientContext->CritSect.
  408. //
  409. LIST_ENTRY MemEval;
  410. //
  411. // Count of the number of times group evaluation has been flushed
  412. //
  413. ULONG GroupEvalSerialNumber;
  414. //
  415. // Count of the number of times the operation cache has been flushed
  416. //
  417. ULONG OpCacheSerialNumber;
  418. //
  419. // Cache of operations that have already been Access Checked
  420. //
  421. RTL_GENERIC_TABLE OperationCacheAvlTree;
  422. //
  423. // Parameters to pass to Bizrules
  424. // See AzContextAccessCheck parameters for descriptions
  425. //
  426. // This copy of the parameters was captured from the most recent AccessCheck.
  427. // It is used on the next AccessCheck to determine whether cached results
  428. // can be used. Currently it is only used for the OperationCacheAvlTree.
  429. // In the future, it may be used for the MemEval cache when ldap query groups
  430. // become parameterized.
  431. //
  432. // These arrays are sparse. The UsedParameterNames type is VT_EMPTY for unused parameters
  433. //
  434. VARIANT *UsedParameterNames;
  435. VARIANT *UsedParameterValues;
  436. ULONG UsedParameterCount;
  437. //
  438. // Logon Id of the client token. This is needed for generating audits.
  439. //
  440. LUID LogonId;
  441. //
  442. // role name (if specified by client) for access check
  443. //
  444. AZP_STRING RoleName;
  445. } AZP_CLIENT_CONTEXT, *PAZP_CLIENT_CONTEXT;
  446. /////////////////////////////////////////////////////////////////////////////
  447. //
  448. // Global definitions
  449. //
  450. /////////////////////////////////////////////////////////////////////////////
  451. extern SAFE_RESOURCE AzGlCloseApplication;
  452. extern SAFE_RESOURCE AzGlResource;
  453. extern GUID AzGlZeroGuid;
  454. /////////////////////////////////////////////////////////////////////////////
  455. //
  456. // Procedure definitions
  457. //
  458. /////////////////////////////////////////////////////////////////////////////
  459. //
  460. // Init functions for the various specific objects
  461. //
  462. DWORD
  463. AzpAzStoreInit(
  464. IN PGENERIC_OBJECT ParentGenericObject,
  465. IN PGENERIC_OBJECT ChildGenericObject
  466. );
  467. DWORD
  468. AzpApplicationInit(
  469. IN PGENERIC_OBJECT ParentGenericObject,
  470. IN PGENERIC_OBJECT ChildGenericObject
  471. );
  472. DWORD
  473. AzpOperationInit(
  474. IN PGENERIC_OBJECT ParentGenericObject,
  475. IN PGENERIC_OBJECT ChildGenericObject
  476. );
  477. DWORD
  478. AzpTaskInit(
  479. IN PGENERIC_OBJECT ParentGenericObject,
  480. IN PGENERIC_OBJECT ChildGenericObject
  481. );
  482. DWORD
  483. AzpScopeInit(
  484. IN PGENERIC_OBJECT ParentGenericObject,
  485. IN PGENERIC_OBJECT ChildGenericObject
  486. );
  487. DWORD
  488. AzpGroupInit(
  489. IN PGENERIC_OBJECT ParentGenericObject,
  490. IN PGENERIC_OBJECT ChildGenericObject
  491. );
  492. DWORD
  493. AzpRoleInit(
  494. IN PGENERIC_OBJECT ParentGenericObject,
  495. IN PGENERIC_OBJECT ChildGenericObject
  496. );
  497. DWORD
  498. AzpSidInit(
  499. IN PGENERIC_OBJECT ParentGenericObject,
  500. IN PGENERIC_OBJECT ChildGenericObject
  501. );
  502. DWORD
  503. AzpClientContextInit(
  504. IN PGENERIC_OBJECT ParentGenericObject,
  505. IN PGENERIC_OBJECT ChildGenericObject
  506. );
  507. //
  508. // NameConflict routines for the specific objects
  509. //
  510. DWORD
  511. AzpOperationNameConflict(
  512. IN PGENERIC_OBJECT ParentGenericObject,
  513. IN PAZP_STRING ChildObjectNameString
  514. );
  515. DWORD
  516. AzpTaskNameConflict(
  517. IN PGENERIC_OBJECT ParentGenericObject,
  518. IN PAZP_STRING ChildObjectNameString
  519. );
  520. DWORD
  521. AzpGroupNameConflict(
  522. IN PGENERIC_OBJECT ParentGenericObject,
  523. IN PAZP_STRING ChildObjectNameString
  524. );
  525. DWORD
  526. AzpRoleNameConflict(
  527. IN PGENERIC_OBJECT ParentGenericObject,
  528. IN PAZP_STRING ChildObjectNameString
  529. );
  530. //
  531. // Get/Set property functions for the specific objects
  532. //
  533. DWORD
  534. AzpAzStoreGetProperty(
  535. IN PGENERIC_OBJECT GenericObject,
  536. IN ULONG Flags,
  537. IN ULONG PropertyId,
  538. OUT PVOID *PropertyValue
  539. );
  540. DWORD
  541. AzpAzStoreSetProperty(
  542. IN PGENERIC_OBJECT GenericObject,
  543. IN ULONG Flags,
  544. IN ULONG PropertyId,
  545. IN PVOID PropertyValue
  546. );
  547. DWORD
  548. AzpApplicationGetProperty(
  549. IN PGENERIC_OBJECT GenericObject,
  550. IN ULONG Flags,
  551. IN ULONG PropertyId,
  552. OUT PVOID *PropertyValue
  553. );
  554. DWORD
  555. AzpApplicationSetProperty(
  556. IN PGENERIC_OBJECT GenericObject,
  557. IN ULONG Flags,
  558. IN ULONG PropertyId,
  559. IN PVOID PropertyValue
  560. );
  561. DWORD
  562. AzpOperationGetProperty(
  563. IN PGENERIC_OBJECT GenericObject,
  564. IN ULONG Flags,
  565. IN ULONG PropertyId,
  566. OUT PVOID *PropertyValue
  567. );
  568. DWORD
  569. AzpOperationSetProperty(
  570. IN PGENERIC_OBJECT GenericObject,
  571. IN ULONG Flags,
  572. IN ULONG PropertyId,
  573. IN PVOID PropertyValue
  574. );
  575. DWORD
  576. AzpTaskGetProperty(
  577. IN PGENERIC_OBJECT GenericObject,
  578. IN ULONG Flags,
  579. IN ULONG PropertyId,
  580. OUT PVOID *PropertyValue
  581. );
  582. DWORD
  583. AzpTaskSetProperty(
  584. IN PGENERIC_OBJECT GenericObject,
  585. IN ULONG Flags,
  586. IN ULONG PropertyId,
  587. IN PVOID PropertyValue
  588. );
  589. DWORD
  590. AzpGroupGetProperty(
  591. IN PGENERIC_OBJECT GenericObject,
  592. IN ULONG Flags,
  593. IN ULONG PropertyId,
  594. OUT PVOID *PropertyValue
  595. );
  596. DWORD
  597. AzpScopeGetProperty(
  598. IN PGENERIC_OBJECT GenericObject,
  599. IN ULONG Flags,
  600. IN ULONG PropertyId,
  601. OUT PVOID *PropertyValue
  602. );
  603. DWORD
  604. AzpGroupSetProperty(
  605. IN PGENERIC_OBJECT GenericObject,
  606. IN ULONG Flags,
  607. IN ULONG PropertyId,
  608. IN PVOID PropertyValue
  609. );
  610. DWORD
  611. AzpClientContextSetProperty(
  612. IN PGENERIC_OBJECT GenericObject,
  613. IN ULONG Flags,
  614. IN ULONG PropertyId,
  615. IN PVOID PropertyValue
  616. );
  617. DWORD
  618. AzpTaskAddPropertyItem(
  619. IN PGENERIC_OBJECT GenericObject,
  620. IN PGENERIC_OBJECT_LIST GenericObjectList,
  621. IN PGENERIC_OBJECT LinkedToObject
  622. );
  623. DWORD
  624. AzpGroupAddPropertyItem(
  625. IN PGENERIC_OBJECT GenericObject,
  626. IN PGENERIC_OBJECT_LIST GenericObjectList,
  627. IN PGENERIC_OBJECT LinkedToObject
  628. );
  629. DWORD
  630. AzpRoleGetProperty(
  631. IN PGENERIC_OBJECT GenericObject,
  632. IN ULONG Flags,
  633. IN ULONG PropertyId,
  634. OUT PVOID *PropertyValue
  635. );
  636. DWORD
  637. AzpRoleAddPropertyItem(
  638. IN PGENERIC_OBJECT GenericObject,
  639. IN ULONG PropertyId,
  640. IN PGENERIC_OBJECT_LIST GenericObjectList,
  641. IN AZP_STRING ObjectName
  642. );
  643. DWORD
  644. AzpClientContextGetProperty(
  645. IN PGENERIC_OBJECT GenericObject,
  646. IN ULONG Flags,
  647. IN ULONG PropertyId,
  648. OUT PVOID *PropertyValue
  649. );
  650. //
  651. // Free routines for the various object types
  652. //
  653. VOID
  654. AzpAzStoreFree(
  655. IN PGENERIC_OBJECT GenericObject
  656. );
  657. VOID
  658. AzpApplicationFree(
  659. IN PGENERIC_OBJECT GenericObject
  660. );
  661. VOID
  662. AzpOperationFree(
  663. IN PGENERIC_OBJECT GenericObject
  664. );
  665. VOID
  666. AzpTaskFree(
  667. IN PGENERIC_OBJECT GenericObject
  668. );
  669. VOID
  670. AzpScopeFree(
  671. IN PGENERIC_OBJECT GenericObject
  672. );
  673. VOID
  674. AzpGroupFree(
  675. IN PGENERIC_OBJECT GenericObject
  676. );
  677. VOID
  678. AzpRoleFree(
  679. IN PGENERIC_OBJECT GenericObject
  680. );
  681. VOID
  682. AzpSidFree(
  683. IN PGENERIC_OBJECT GenericObject
  684. );
  685. VOID
  686. AzpClientContextFree(
  687. IN PGENERIC_OBJECT GenericObject
  688. );
  689. //
  690. // Other object specific functions
  691. //
  692. DWORD
  693. AzpReferenceOperationByOpId(
  694. IN PAZP_APPLICATION Application,
  695. IN LONG OperationId,
  696. IN BOOLEAN RefreshCache,
  697. OUT PAZP_OPERATION *RetOperation
  698. );
  699. BOOL
  700. AzpOpenToManageStore (
  701. IN PAZP_AZSTORE pAzStore
  702. );
  703. //
  704. // Object specific default value arrays
  705. //
  706. extern AZP_DEFAULT_VALUE AzGlAzStoreDefaultValues[];
  707. extern AZP_DEFAULT_VALUE AzGlApplicationDefaultValues[];
  708. extern AZP_DEFAULT_VALUE AzGlOperationDefaultValues[];
  709. extern AZP_DEFAULT_VALUE AzGlTaskDefaultValues[];
  710. extern AZP_DEFAULT_VALUE AzGlGroupDefaultValues[];
  711. //
  712. // Procedures from domain.cxx
  713. //
  714. typedef struct _AZP_DC {
  715. //
  716. // Reference count for this structure
  717. //
  718. LONG ReferenceCount;
  719. //
  720. // Name of the DC
  721. //
  722. AZP_STRING DcName;
  723. //
  724. // Ldap Handle to the DC
  725. //
  726. LDAP *LdapHandle;
  727. } AZP_DC, *PAZP_DC;
  728. PVOID
  729. AzpReferenceDomain(
  730. IN PAZP_AZSTORE AzAuthorizationStore,
  731. IN LPWSTR DomainName,
  732. IN BOOLEAN IsDnsDomainName
  733. );
  734. VOID
  735. AzpDereferenceDomain(
  736. IN PVOID DomainHandle
  737. );
  738. VOID
  739. AzpUnlinkDomains(
  740. IN PAZP_AZSTORE AzAuthorizationStore
  741. );
  742. DWORD
  743. AzpLdapErrorToWin32Error(
  744. IN ULONG LdapStatus
  745. );
  746. DWORD
  747. AzpGetDc(
  748. IN PAZP_AZSTORE AzAuthorizationStore,
  749. IN PVOID DomainHandle,
  750. IN OUT PULONG Context,
  751. OUT PAZP_DC *RetDc
  752. );
  753. VOID
  754. AzpDereferenceDc(
  755. IN PAZP_DC Dc
  756. );
  757. //
  758. // These are the current major and minor versions for authorization store
  759. //
  760. extern ULONG AzGlCurrAzRolesMajorVersion;
  761. extern ULONG AzGlCurrAzRolesMinorVersion;
  762. //
  763. // version control routine. Here are the rules:
  764. // MajorVersion (DWORD) - Specifies the major version of the azroles.dll
  765. // that wrote this policy. An azroles.dll with an older major version
  766. // number cannot read nor write a database with a newer major version number.
  767. // The version 1 value of this DWORD is 1. We hope to never have to
  768. // change this value in future releases.
  769. //
  770. // MinorVersion (DWORD) - Specifies the minor version of the azroles.dll
  771. // that wrote this policy. An azroles.dll with an older minor version
  772. // number can read but cannot write a database with a newer minor version number.
  773. // The version 1 value of this DWORD is 0.
  774. //
  775. BOOL AzpAzStoreVersionAllowWrite(
  776. IN PAZP_AZSTORE AzAuthorizationStore
  777. );
  778. DWORD AzpScopeCanBeDelegated(
  779. IN PGENERIC_OBJECT GenericObject,
  780. IN BOOL bLockedShared
  781. );
  782. #ifdef __cplusplus
  783. }
  784. #endif