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.

1797 lines
52 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. azdisp.h
  5. Abstract:
  6. Declaration of CAz* dispatch interfaces
  7. Author:
  8. Xiaoxi Tan (xtan) 11-May-2001
  9. --*/
  10. #ifndef __AZDISP_H_
  11. #define __AZDISP_H_
  12. #include "resource.h"
  13. #include "azrolesp.h"
  14. #pragma warning ( push )
  15. #pragma warning ( disable : 4100 ) // unreferenced formal parameter
  16. #include "copyitem.h"
  17. #pragma warning ( pop )
  18. // macro defines
  19. // defines
  20. #define AZ_HR_FROM_WIN32(e) ( ( (e) == ERROR_OUTOFMEMORY || (e) == ERROR_NOT_ENOUGH_MEMORY || (e) == NTE_NO_MEMORY ) ? E_OUTOFMEMORY : HRESULT_FROM_WIN32(e) )
  21. #define AZ_HRESULT(e) (((e) >= 0x80000000) ? (e) : AZ_HR_FROM_WIN32((e)))
  22. #define AZ_HRESULT_LASTERROR(phr) \
  23. { \
  24. DWORD _dwLastError; \
  25. _dwLastError = GetLastError(); \
  26. *(phr) = AZ_HRESULT(_dwLastError); \
  27. }
  28. #if DBG
  29. #define AZASSERT(exp) ASSERT((exp))
  30. #else
  31. #define AZASSERT(exp)
  32. #endif //DBG
  33. //
  34. //chk has debug print for error jumps
  35. //Note: the component should define AZD_COMPONENT to be one of
  36. // AZD_* before calling any of the following dbg macros
  37. //
  38. #if DBG
  39. #define _JumpError(hr, label, pszMessage) \
  40. { \
  41. AzPrint((AZD_COMPONENT, "%s error occured: 0x%lx\n", (pszMessage), (hr))); \
  42. goto label; \
  43. }
  44. #define _PrintError(hr, pszMessage) \
  45. {\
  46. AzPrint((AZD_COMPONENT, "%s error ignored: 0x%lx\n", (pszMessage), (hr))); \
  47. }
  48. #define _PrintIfError(hr, pszMessage) \
  49. {\
  50. if (S_OK != hr) \
  51. { \
  52. _PrintError(hr, pszMessage); \
  53. } \
  54. }
  55. #else
  56. #define _JumpError(hr, label, pszMessage) goto label;
  57. #define _PrintError(hr, pszMessage)
  58. #define _PrintIfError(hr, pszMessage)
  59. #endif //DBG
  60. #define _JumpErrorQuiet(hr, label, pszMessage) goto label;
  61. //check hr err, goto error
  62. #define _JumpIfError(hr, label, pszMessage) \
  63. { \
  64. if (S_OK != hr) \
  65. { \
  66. _JumpError((hr), label, (pszMessage)) \
  67. } \
  68. }
  69. //check win err, goto error and return hr
  70. #define _JumpIfWinError(dwErr, phr, label, pszMessage) \
  71. { \
  72. if (ERROR_SUCCESS != dwErr) \
  73. { \
  74. *(phr) = AZ_HRESULT(dwErr); \
  75. _JumpError((*(phr)), label, (pszMessage)) \
  76. } \
  77. }
  78. //note hr is hidden from macro
  79. #define _JumpIfOutOfMemory(phr, label, pMem, msg) \
  80. { \
  81. if (NULL == (pMem)) \
  82. { \
  83. *(phr) = E_OUTOFMEMORY; \
  84. _JumpError((*(phr)), label, "Out of Memory: " msg); \
  85. } \
  86. }
  87. // defines
  88. typedef DWORD (*PFUNCAzGetProperty)(
  89. IN AZ_HANDLE hHandle,
  90. IN ULONG PropertyId,
  91. IN DWORD Reserved,
  92. OUT PVOID *PropertyValue);
  93. typedef DWORD (*PFUNCAzAddPropertyItem)(
  94. IN AZ_HANDLE hHandle,
  95. IN ULONG PropertyId,
  96. IN DWORD Reserved,
  97. IN PVOID PropertyValue);
  98. //return type IDs
  99. enum ENUM_AZ_DATATYPE
  100. {
  101. ENUM_AZ_BSTR = 0,
  102. ENUM_AZ_LONG,
  103. ENUM_AZ_BSTR_ARRAY,
  104. ENUM_AZ_SID_ARRAY,
  105. ENUM_AZ_BOOL,
  106. ENUM_AZ_GUID_ARRAY,
  107. ENUM_AZ_GROUP_TYPE,
  108. };
  109. //
  110. // some complicated atl collection class defines
  111. //
  112. // each collection class needs T(Obj)Collection define by using
  113. // T_AZ_MAP, T_AZ_ENUM, and T_AZ_COLL macros. Here is an example for
  114. // IAzApplication collection class
  115. //typedef std::map<CComBSTR, CComPtr<IAzApplication> > TApplicationMap;
  116. //typedef CComEnumOnSTL<IEnumVARIANT, &IID_IEnumVARIANT, VARIANT, _CopyMapItem<IAzApplication>, TApplicationMap> TApplicationEnum;
  117. //typedef ICollectionOnSTLImpl<IAzApplications, TApplicationMap, VARIANT, _CopyMapItem<IAzApplication>, TApplicationEnum> TApplicationsCollection;
  118. #define T_AZ_MAP(_obj) std::map<CComBSTR, CComPtr<_obj> >
  119. #define T_AZ_ENUM(_obj, _map) CComEnumOnSTL<IEnumVARIANT, &IID_IEnumVARIANT, VARIANT, _CopyMapItem<_obj>, _map>
  120. #define T_AZ_COLL(_obj, _objs, _map, _enum) ICollectionOnSTLImpl<_objs, _map, VARIANT, _CopyMapItem<_obj>, _enum>
  121. typedef T_AZ_MAP(IAzApplication) TApplicationMap;
  122. typedef T_AZ_ENUM(IAzApplication, TApplicationMap) TApplicationEnum;
  123. typedef T_AZ_COLL(IAzApplication, IAzApplications,
  124. TApplicationMap, TApplicationEnum) TApplicationsCollection;
  125. typedef T_AZ_MAP(IAzApplicationGroup) TApplicationGroupMap;
  126. typedef T_AZ_ENUM(IAzApplicationGroup,
  127. TApplicationGroupMap) TApplicationGroupEnum;
  128. typedef T_AZ_COLL(IAzApplicationGroup,
  129. IAzApplicationGroups,
  130. TApplicationGroupMap,
  131. TApplicationGroupEnum) TApplicationGroupsCollection;
  132. typedef T_AZ_MAP(IAzOperation) TOperationMap;
  133. typedef T_AZ_ENUM(IAzOperation, TOperationMap) TOperationEnum;
  134. typedef T_AZ_COLL(IAzOperation, IAzOperations,
  135. TOperationMap, TOperationEnum) TOperationsCollection;
  136. typedef T_AZ_MAP(IAzTask) TTaskMap;
  137. typedef T_AZ_ENUM(IAzTask, TTaskMap) TTaskEnum;
  138. typedef T_AZ_COLL(IAzTask, IAzTasks,
  139. TTaskMap, TTaskEnum) TTasksCollection;
  140. typedef T_AZ_MAP(IAzScope) TScopeMap;
  141. typedef T_AZ_ENUM(IAzScope, TScopeMap) TScopeEnum;
  142. typedef T_AZ_COLL(IAzScope, IAzScopes,
  143. TScopeMap, TScopeEnum) TScopesCollection;
  144. typedef T_AZ_MAP(IAzRole) TRoleMap;
  145. typedef T_AZ_ENUM(IAzRole, TRoleMap) TRoleEnum;
  146. typedef T_AZ_COLL(IAzRole, IAzRoles,
  147. TRoleMap, TRoleEnum) TRolesCollection;
  148. ///////////////////////
  149. //CAzAuthorizationStore
  150. class ATL_NO_VTABLE CAzAuthorizationStore :
  151. public CComObjectRootEx<CComMultiThreadModel>,
  152. public CComCoClass<CAzAuthorizationStore, &CLSID_AzAuthorizationStore>,
  153. public IDispatchImpl<IAzAuthorizationStore, &IID_IAzAuthorizationStore, &LIBID_AZROLESLib>
  154. {
  155. public:
  156. DECLARE_REGISTRY_RESOURCEID(IDR_AZSTORE)
  157. BEGIN_COM_MAP(CAzAuthorizationStore)
  158. COM_INTERFACE_ENTRY(IAzAuthorizationStore)
  159. COM_INTERFACE_ENTRY(IDispatch)
  160. END_COM_MAP()
  161. //IAzAuthorizationStore
  162. public:
  163. CAzAuthorizationStore();
  164. ~CAzAuthorizationStore();
  165. virtual HRESULT STDMETHODCALLTYPE put_Description(
  166. IN BSTR bstrDescription);
  167. virtual HRESULT STDMETHODCALLTYPE get_Description(
  168. OUT BSTR __RPC_FAR *pbstrDescription);
  169. virtual HRESULT STDMETHODCALLTYPE put_ApplicationData(
  170. IN BSTR bstrApplicationData);
  171. virtual HRESULT STDMETHODCALLTYPE get_ApplicationData(
  172. OUT BSTR __RPC_FAR *pbstrApplicationData);
  173. virtual HRESULT STDMETHODCALLTYPE
  174. get_DomainTimeout(
  175. OUT LONG *plProp
  176. );
  177. virtual HRESULT STDMETHODCALLTYPE
  178. put_DomainTimeout(
  179. IN LONG lProp
  180. );
  181. virtual HRESULT STDMETHODCALLTYPE
  182. get_ScriptEngineTimeout(
  183. OUT LONG *plProp
  184. );
  185. virtual HRESULT STDMETHODCALLTYPE
  186. put_ScriptEngineTimeout(
  187. IN LONG lProp
  188. );
  189. virtual HRESULT STDMETHODCALLTYPE
  190. get_MaxScriptEngines(
  191. OUT LONG *plProp
  192. );
  193. virtual HRESULT STDMETHODCALLTYPE
  194. put_MaxScriptEngines(
  195. IN LONG lProp
  196. );
  197. virtual HRESULT STDMETHODCALLTYPE
  198. get_GenerateAudits(
  199. OUT BOOL *pbProp
  200. );
  201. virtual HRESULT STDMETHODCALLTYPE
  202. put_GenerateAudits(
  203. IN BOOL bProp
  204. );
  205. virtual HRESULT STDMETHODCALLTYPE get_Writable(
  206. OUT BOOL *pfProp);
  207. virtual HRESULT STDMETHODCALLTYPE GetProperty(
  208. IN LONG lPropId,
  209. IN VARIANT varReserved,
  210. OUT VARIANT *pvarProp);
  211. virtual HRESULT STDMETHODCALLTYPE SetProperty(
  212. IN LONG lPropId,
  213. IN VARIANT varProp,
  214. IN VARIANT varReserved );
  215. virtual HRESULT STDMETHODCALLTYPE AddPropertyItem(
  216. IN LONG lPropId,
  217. IN VARIANT varProp,
  218. IN VARIANT varReserved );
  219. virtual HRESULT STDMETHODCALLTYPE DeletePropertyItem(
  220. IN LONG lPropId,
  221. IN VARIANT varProp,
  222. IN VARIANT varReserved );
  223. virtual HRESULT STDMETHODCALLTYPE get_PolicyAdministrators(
  224. OUT VARIANT *pvarAdmins);
  225. virtual HRESULT STDMETHODCALLTYPE get_PolicyReaders(
  226. OUT VARIANT *pvarReaders);
  227. virtual HRESULT STDMETHODCALLTYPE AddPolicyAdministrator(
  228. IN BSTR bstrReader,
  229. IN VARIANT varReserved);
  230. virtual HRESULT STDMETHODCALLTYPE DeletePolicyAdministrator(
  231. IN BSTR bstrReader,
  232. IN VARIANT varReserved);
  233. virtual HRESULT STDMETHODCALLTYPE AddPolicyReader(
  234. IN BSTR bstrReader,
  235. IN VARIANT varReserved);
  236. virtual HRESULT STDMETHODCALLTYPE DeletePolicyReader(
  237. IN BSTR bstrReader,
  238. IN VARIANT varReserved);
  239. virtual HRESULT STDMETHODCALLTYPE Initialize(
  240. IN LONG lFlags,
  241. IN BSTR bstrPolicyURL,
  242. IN VARIANT varReserved );
  243. virtual HRESULT STDMETHODCALLTYPE UpdateCache(
  244. IN VARIANT varReserved );
  245. virtual HRESULT STDMETHODCALLTYPE Delete(
  246. IN VARIANT varReserved );
  247. virtual HRESULT STDMETHODCALLTYPE get_Applications(
  248. OUT IAzApplications __RPC_FAR **ppApplications);
  249. virtual HRESULT STDMETHODCALLTYPE OpenApplication(
  250. IN BSTR bstrApplicationName,
  251. IN VARIANT varReserved,
  252. OUT IAzApplication __RPC_FAR **ppApplication);
  253. virtual HRESULT STDMETHODCALLTYPE CreateApplication(
  254. IN BSTR bstrApplicationName,
  255. IN VARIANT varReserved,
  256. OUT IAzApplication __RPC_FAR **ppApplication);
  257. virtual HRESULT STDMETHODCALLTYPE DeleteApplication(
  258. IN BSTR bstrApplicationName,
  259. IN VARIANT varReserved );
  260. virtual HRESULT STDMETHODCALLTYPE get_ApplicationGroups(
  261. OUT IAzApplicationGroups __RPC_FAR **ppApplicationGroups);
  262. virtual HRESULT STDMETHODCALLTYPE CreateApplicationGroup(
  263. IN BSTR bstrGroupName,
  264. IN VARIANT varReserved,
  265. OUT IAzApplicationGroup __RPC_FAR **ppApplicationGroup);
  266. virtual HRESULT STDMETHODCALLTYPE OpenApplicationGroup(
  267. IN BSTR bstrGroupName,
  268. IN VARIANT varReserved,
  269. OUT IAzApplicationGroup __RPC_FAR **ppApplicationGroup);
  270. virtual HRESULT STDMETHODCALLTYPE DeleteApplicationGroup(
  271. IN BSTR bstrGroupName,
  272. IN VARIANT varReserved );
  273. virtual HRESULT STDMETHODCALLTYPE Submit(
  274. IN LONG lFlags,
  275. IN VARIANT varReserved);
  276. virtual HRESULT STDMETHODCALLTYPE get_DelegatedPolicyUsers(
  277. OUT VARIANT *pvarProp);
  278. virtual HRESULT STDMETHODCALLTYPE AddDelegatedPolicyUser(
  279. IN BSTR bstrDelegatedPolicyUser,
  280. IN VARIANT varReserved);
  281. virtual HRESULT STDMETHODCALLTYPE DeleteDelegatedPolicyUser(
  282. IN BSTR bstrDelegatedPolicyUser,
  283. IN VARIANT varReserved);
  284. virtual HRESULT STDMETHODCALLTYPE get_TargetMachine(
  285. OUT BSTR __RPC_FAR *pbstrTargetMachine);
  286. virtual HRESULT STDMETHODCALLTYPE put_ApplyStoreSacl(
  287. IN BOOL bApplyStoreSacl);
  288. virtual HRESULT STDMETHODCALLTYPE get_ApplyStoreSacl(
  289. OUT BOOL * pbApplyStoreSacl);
  290. virtual HRESULT STDMETHODCALLTYPE get_PolicyAdministratorsName(
  291. OUT VARIANT * pvarAdminsName
  292. );
  293. virtual HRESULT STDMETHODCALLTYPE get_PolicyReadersName(
  294. OUT VARIANT * pvarReadersName
  295. );
  296. virtual HRESULT STDMETHODCALLTYPE AddPolicyAdministratorName(
  297. IN BSTR bstrAdminName,
  298. IN VARIANT varReserved
  299. );
  300. virtual HRESULT STDMETHODCALLTYPE DeletePolicyAdministratorName(
  301. IN BSTR bstrAdminName,
  302. IN VARIANT varReserved
  303. );
  304. virtual HRESULT STDMETHODCALLTYPE AddPolicyReaderName(
  305. IN BSTR bstrReaderName,
  306. IN VARIANT varReserved
  307. );
  308. virtual HRESULT STDMETHODCALLTYPE DeletePolicyReaderName(
  309. IN BSTR bstrReaderName,
  310. IN VARIANT varReserved
  311. );
  312. virtual HRESULT STDMETHODCALLTYPE get_DelegatedPolicyUsersName(
  313. IN VARIANT * pvarDelegatedPolicyUsersName
  314. );
  315. virtual HRESULT STDMETHODCALLTYPE AddDelegatedPolicyUserName(
  316. IN BSTR bstrDelegatedPolicyUserName,
  317. IN VARIANT varReserved
  318. );
  319. virtual HRESULT STDMETHODCALLTYPE DeleteDelegatedPolicyUserName(
  320. IN BSTR bstrDelegatedPolicyUserName,
  321. IN VARIANT varReserved
  322. );
  323. virtual HRESULT STDMETHODCALLTYPE CloseApplication(
  324. IN BSTR bstrApplicationName,
  325. IN LONG lFlags
  326. );
  327. private:
  328. CRITICAL_SECTION m_cs;
  329. AZ_HANDLE m_hAuthorizationStore;
  330. };
  331. ///////////////////////
  332. //CAzApplication
  333. class ATL_NO_VTABLE CAzApplication :
  334. public CComObjectRootEx<CComMultiThreadModel>,
  335. public IDispatchImpl<IAzApplication, &IID_IAzApplication, &LIBID_AZROLESLib>
  336. {
  337. public:
  338. DECLARE_NO_REGISTRY()
  339. BEGIN_COM_MAP(CAzApplication)
  340. COM_INTERFACE_ENTRY(IAzApplication)
  341. COM_INTERFACE_ENTRY(IDispatch)
  342. END_COM_MAP()
  343. //IAzApplication
  344. public:
  345. CAzApplication();
  346. ~CAzApplication();
  347. virtual HRESULT STDMETHODCALLTYPE put_Name(
  348. IN BSTR bstrName);
  349. virtual HRESULT STDMETHODCALLTYPE get_Name(
  350. OUT BSTR __RPC_FAR *pbstrName);
  351. virtual HRESULT STDMETHODCALLTYPE put_Description(
  352. IN BSTR bstrDescription);
  353. virtual HRESULT STDMETHODCALLTYPE get_Description(
  354. OUT BSTR __RPC_FAR *pbstrDescription);
  355. virtual HRESULT STDMETHODCALLTYPE put_ApplicationData(
  356. IN BSTR bstrApplicationData);
  357. virtual HRESULT STDMETHODCALLTYPE get_ApplicationData(
  358. OUT BSTR __RPC_FAR *pbstrApplicationData);
  359. virtual HRESULT STDMETHODCALLTYPE
  360. get_AuthzInterfaceClsid(
  361. OUT BSTR *pbstrProp);
  362. virtual HRESULT STDMETHODCALLTYPE
  363. put_AuthzInterfaceClsid(
  364. IN BSTR bstrProp);
  365. virtual HRESULT STDMETHODCALLTYPE
  366. get_Version(
  367. OUT BSTR *pbstrProp);
  368. virtual HRESULT STDMETHODCALLTYPE
  369. put_Version(
  370. IN BSTR bstrProp);
  371. virtual HRESULT STDMETHODCALLTYPE
  372. get_GenerateAudits(
  373. OUT BOOL *pbProp);
  374. virtual HRESULT STDMETHODCALLTYPE
  375. put_GenerateAudits(
  376. IN BOOL bProp);
  377. virtual HRESULT STDMETHODCALLTYPE
  378. get_ApplyStoreSacl(
  379. OUT BOOL *pbProp);
  380. virtual HRESULT STDMETHODCALLTYPE
  381. put_ApplyStoreSacl(
  382. IN BOOL bProp);
  383. virtual HRESULT STDMETHODCALLTYPE get_Writable(
  384. OUT BOOL *pfProp);
  385. virtual HRESULT STDMETHODCALLTYPE GetProperty(
  386. IN LONG lPropId,
  387. IN VARIANT varReserved,
  388. OUT VARIANT *pvarProp);
  389. virtual HRESULT STDMETHODCALLTYPE SetProperty(
  390. IN LONG lPropId,
  391. IN VARIANT varProp,
  392. IN VARIANT varReserved );
  393. virtual HRESULT STDMETHODCALLTYPE get_PolicyAdministrators(
  394. OUT VARIANT *pvarAdmins);
  395. virtual HRESULT STDMETHODCALLTYPE get_PolicyReaders(
  396. OUT VARIANT *pvarReaders);
  397. virtual HRESULT STDMETHODCALLTYPE AddPolicyAdministrator(
  398. IN BSTR bstrReader,
  399. IN VARIANT varReserved);
  400. virtual HRESULT STDMETHODCALLTYPE DeletePolicyAdministrator(
  401. IN BSTR bstrReader,
  402. IN VARIANT varReserved);
  403. virtual HRESULT STDMETHODCALLTYPE AddPolicyReader(
  404. IN BSTR bstrReader,
  405. IN VARIANT varReserved);
  406. virtual HRESULT STDMETHODCALLTYPE DeletePolicyReader(
  407. IN BSTR bstrReader,
  408. IN VARIANT varReserved);
  409. virtual HRESULT STDMETHODCALLTYPE get_Scopes(
  410. OUT IAzScopes **ppScopes);
  411. virtual HRESULT STDMETHODCALLTYPE OpenScope(
  412. IN BSTR bstrScopeName,
  413. IN VARIANT varReserved,
  414. OUT IAzScope **ppScope);
  415. virtual HRESULT STDMETHODCALLTYPE CreateScope(
  416. IN BSTR bstrScopeName,
  417. IN VARIANT varReserved,
  418. OUT IAzScope **ppScope);
  419. virtual HRESULT STDMETHODCALLTYPE DeleteScope(
  420. IN BSTR bstrScopeName,
  421. IN VARIANT varReserved );
  422. virtual HRESULT STDMETHODCALLTYPE get_Operations(
  423. OUT IAzOperations **ppOperations);
  424. virtual HRESULT STDMETHODCALLTYPE OpenOperation(
  425. IN BSTR bstrOperationName,
  426. IN VARIANT varReserved,
  427. OUT IAzOperation **ppOperation);
  428. virtual HRESULT STDMETHODCALLTYPE CreateOperation(
  429. IN BSTR bstrOperationName,
  430. IN VARIANT varReserved,
  431. OUT IAzOperation **ppOperation);
  432. virtual HRESULT STDMETHODCALLTYPE DeleteOperation(
  433. IN BSTR bstrOperationName,
  434. IN VARIANT varReserved );
  435. virtual HRESULT STDMETHODCALLTYPE get_Tasks(
  436. OUT IAzTasks **ppTasks);
  437. virtual HRESULT STDMETHODCALLTYPE OpenTask(
  438. IN BSTR bstrTaskName,
  439. IN VARIANT varReserved,
  440. OUT IAzTask **ppTask);
  441. virtual HRESULT STDMETHODCALLTYPE CreateTask(
  442. IN BSTR bstrTaskName,
  443. IN VARIANT varReserved,
  444. OUT IAzTask **ppTask);
  445. virtual HRESULT STDMETHODCALLTYPE DeleteTask(
  446. IN BSTR bstrTaskName,
  447. IN VARIANT varReserved );
  448. virtual HRESULT STDMETHODCALLTYPE get_ApplicationGroups(
  449. OUT IAzApplicationGroups **ppGroups);
  450. virtual HRESULT STDMETHODCALLTYPE OpenApplicationGroup(
  451. IN BSTR bstrGroupName,
  452. IN VARIANT varReserved,
  453. OUT IAzApplicationGroup **ppGroup);
  454. virtual HRESULT STDMETHODCALLTYPE CreateApplicationGroup(
  455. IN BSTR bstrGroupName,
  456. IN VARIANT varReserved,
  457. OUT IAzApplicationGroup **ppGroup);
  458. virtual HRESULT STDMETHODCALLTYPE DeleteApplicationGroup(
  459. IN BSTR bstrGroupName,
  460. IN VARIANT varReserved );
  461. virtual HRESULT STDMETHODCALLTYPE get_Roles(
  462. OUT IAzRoles **ppRoles);
  463. virtual HRESULT STDMETHODCALLTYPE OpenRole(
  464. IN BSTR bstrRoleName,
  465. IN VARIANT varReserved,
  466. OUT IAzRole **ppRole);
  467. virtual HRESULT STDMETHODCALLTYPE CreateRole(
  468. IN BSTR bstrRoleName,
  469. IN VARIANT varReserved,
  470. OUT IAzRole **ppRole);
  471. virtual HRESULT STDMETHODCALLTYPE DeleteRole(
  472. IN BSTR bstrRoleName,
  473. IN VARIANT varReserved );
  474. virtual HRESULT STDMETHODCALLTYPE InitializeClientContextFromToken(
  475. IN ULONGLONG ullTokenHandle,
  476. IN VARIANT varReserved,
  477. OUT IAzClientContext **ppClientContext);
  478. virtual HRESULT STDMETHODCALLTYPE AddPropertyItem(
  479. IN LONG lPropId,
  480. IN VARIANT varProp,
  481. IN VARIANT varReserved );
  482. virtual HRESULT STDMETHODCALLTYPE DeletePropertyItem(
  483. IN LONG lPropId,
  484. IN VARIANT varProp,
  485. IN VARIANT varReserved );
  486. virtual HRESULT STDMETHODCALLTYPE Submit(
  487. IN LONG lFlags,
  488. IN VARIANT varReserved);
  489. virtual HRESULT STDMETHODCALLTYPE InitializeClientContextFromName(
  490. IN BSTR ClientName,
  491. IN BSTR DomainName,
  492. IN VARIANT varReserved,
  493. OUT IAzClientContext **ppClientContext);
  494. virtual HRESULT STDMETHODCALLTYPE get_DelegatedPolicyUsers(
  495. OUT VARIANT *pvarProp);
  496. virtual HRESULT STDMETHODCALLTYPE AddDelegatedPolicyUser(
  497. IN BSTR bstrDelegatedPolicyUser,
  498. IN VARIANT varReserved);
  499. virtual HRESULT STDMETHODCALLTYPE DeleteDelegatedPolicyUser(
  500. IN BSTR bstrDelegatedPolicyUser,
  501. IN VARIANT varReserved);
  502. virtual HRESULT STDMETHODCALLTYPE InitializeClientContextFromStringSid(
  503. IN BSTR SidString,
  504. IN LONG lOptions,
  505. IN VARIANT varReserved,
  506. OUT IAzClientContext **ppClientContext);
  507. virtual HRESULT STDMETHODCALLTYPE get_PolicyAdministratorsName(
  508. OUT VARIANT * pvarAdminsName
  509. );
  510. virtual HRESULT STDMETHODCALLTYPE get_PolicyReadersName(
  511. OUT VARIANT * pvarReadersName
  512. );
  513. virtual HRESULT STDMETHODCALLTYPE AddPolicyAdministratorName(
  514. IN BSTR bstrAdmin,
  515. IN VARIANT varReserved
  516. );
  517. virtual HRESULT STDMETHODCALLTYPE DeletePolicyAdministratorName(
  518. IN BSTR bstrAdmin,
  519. IN VARIANT varReserved
  520. );
  521. virtual HRESULT STDMETHODCALLTYPE AddPolicyReaderName(
  522. IN BSTR bstrReader,
  523. IN VARIANT varReserved
  524. );
  525. virtual HRESULT STDMETHODCALLTYPE DeletePolicyReaderName(
  526. IN BSTR bstrReader,
  527. IN VARIANT varReserved
  528. );
  529. virtual HRESULT STDMETHODCALLTYPE get_DelegatedPolicyUsersName(
  530. OUT VARIANT * pvarDelegatedPolicyUsers
  531. );
  532. virtual HRESULT STDMETHODCALLTYPE AddDelegatedPolicyUserName(
  533. IN BSTR bstrDelegatedPolicyUser,
  534. IN VARIANT varReserved
  535. );
  536. virtual HRESULT STDMETHODCALLTYPE DeleteDelegatedPolicyUserName(
  537. IN BSTR bstrDelegatedPolicyUser,
  538. IN VARIANT varReserved
  539. );
  540. //internal methods
  541. HRESULT _Init(
  542. IN AZ_HANDLE hHandle);
  543. private:
  544. CRITICAL_SECTION m_cs;
  545. AZ_HANDLE m_hApplication;
  546. DWORD m_dwSN;
  547. };
  548. ///////////////////////
  549. //CAzApplications
  550. class ATL_NO_VTABLE CAzApplications :
  551. public CComObjectRootEx<CComMultiThreadModel>,
  552. public IDispatchImpl<TApplicationsCollection, &IID_IAzApplications, &LIBID_AZROLESLib>
  553. {
  554. public:
  555. DECLARE_NO_REGISTRY()
  556. BEGIN_COM_MAP(CAzApplications)
  557. COM_INTERFACE_ENTRY(IAzApplications)
  558. COM_INTERFACE_ENTRY(IDispatch)
  559. END_COM_MAP()
  560. //IAzApplications
  561. public:
  562. //internal methods
  563. HRESULT _Init(
  564. IN VARIANT *pvarReserved,
  565. IN AZ_HANDLE hHandle);
  566. };
  567. ///////////////////////
  568. //CAzOperation
  569. class ATL_NO_VTABLE CAzOperation :
  570. public CComObjectRootEx<CComMultiThreadModel>,
  571. public IDispatchImpl<IAzOperation, &IID_IAzOperation, &LIBID_AZROLESLib>
  572. {
  573. public:
  574. DECLARE_NO_REGISTRY()
  575. BEGIN_COM_MAP(CAzOperation)
  576. COM_INTERFACE_ENTRY(IAzOperation)
  577. COM_INTERFACE_ENTRY(IDispatch)
  578. END_COM_MAP()
  579. //IAzOperation
  580. public:
  581. CAzOperation();
  582. ~CAzOperation();
  583. virtual HRESULT STDMETHODCALLTYPE put_Name(
  584. IN BSTR bstrName);
  585. virtual HRESULT STDMETHODCALLTYPE get_Name(
  586. OUT BSTR __RPC_FAR *pbstrName);
  587. virtual HRESULT STDMETHODCALLTYPE put_Description(
  588. OUT BSTR bstrDescription);
  589. virtual HRESULT STDMETHODCALLTYPE get_Description(
  590. IN BSTR __RPC_FAR *pbstrDescription);
  591. virtual HRESULT STDMETHODCALLTYPE put_ApplicationData(
  592. OUT BSTR bstrApplicationData);
  593. virtual HRESULT STDMETHODCALLTYPE get_ApplicationData(
  594. IN BSTR __RPC_FAR *pbstrApplicationData);
  595. virtual HRESULT STDMETHODCALLTYPE get_OperationID(
  596. OUT LONG *plProp);
  597. virtual HRESULT STDMETHODCALLTYPE put_OperationID(
  598. IN LONG lProp);
  599. virtual HRESULT STDMETHODCALLTYPE get_Writable(
  600. OUT BOOL *pfProp);
  601. virtual HRESULT STDMETHODCALLTYPE GetProperty(
  602. IN LONG lPropId,
  603. IN VARIANT varReserved,
  604. OUT VARIANT *pvarProp);
  605. virtual HRESULT STDMETHODCALLTYPE SetProperty(
  606. IN LONG lPropId,
  607. IN VARIANT varProp,
  608. IN VARIANT varReserved );
  609. virtual HRESULT STDMETHODCALLTYPE Submit(
  610. IN LONG lFlags,
  611. IN VARIANT varReserved);
  612. //internal methods
  613. HRESULT _Init(
  614. IN AZ_HANDLE hOwnerApp,
  615. IN AZ_HANDLE hHandle);
  616. private:
  617. CRITICAL_SECTION m_cs;
  618. AZ_HANDLE m_hOperation;
  619. AZ_HANDLE m_hOwnerApp;
  620. DWORD m_dwOwnerAppSN;
  621. };
  622. ///////////////////////
  623. //CAzOperations
  624. class ATL_NO_VTABLE CAzOperations :
  625. public CComObjectRootEx<CComMultiThreadModel>,
  626. public IDispatchImpl<TOperationsCollection, &IID_IAzOperations, &LIBID_AZROLESLib>
  627. {
  628. public:
  629. DECLARE_NO_REGISTRY()
  630. BEGIN_COM_MAP(CAzOperations)
  631. COM_INTERFACE_ENTRY(IAzOperations)
  632. COM_INTERFACE_ENTRY(IDispatch)
  633. END_COM_MAP()
  634. //IAzOperations
  635. public:
  636. //internal methods
  637. HRESULT _Init(
  638. IN AZ_HANDLE hOwnerApp,
  639. IN VARIANT *pvarReserved,
  640. IN AZ_HANDLE hHandle);
  641. private:
  642. AZ_HANDLE m_hOwnerApp;
  643. DWORD m_dwOwnerAppSN;
  644. };
  645. ///////////////////////
  646. //CAzTask
  647. class ATL_NO_VTABLE CAzTask :
  648. public CComObjectRootEx<CComMultiThreadModel>,
  649. public IDispatchImpl<IAzTask, &IID_IAzTask, &LIBID_AZROLESLib>
  650. {
  651. public:
  652. DECLARE_NO_REGISTRY()
  653. BEGIN_COM_MAP(CAzTask)
  654. COM_INTERFACE_ENTRY(IAzTask)
  655. COM_INTERFACE_ENTRY(IDispatch)
  656. END_COM_MAP()
  657. //IAzTask
  658. public:
  659. CAzTask();
  660. ~CAzTask();
  661. virtual HRESULT STDMETHODCALLTYPE put_Name(
  662. IN BSTR bstrName);
  663. virtual HRESULT STDMETHODCALLTYPE get_Name(
  664. IN BSTR __RPC_FAR *pbstrName);
  665. virtual HRESULT STDMETHODCALLTYPE put_Description(
  666. IN BSTR bstrDescription);
  667. virtual HRESULT STDMETHODCALLTYPE get_Description(
  668. IN BSTR __RPC_FAR *pbstrDescription);
  669. virtual HRESULT STDMETHODCALLTYPE put_ApplicationData(
  670. IN BSTR bstrApplicationData);
  671. virtual HRESULT STDMETHODCALLTYPE get_ApplicationData(
  672. IN BSTR __RPC_FAR *pbstrApplicationData);
  673. virtual HRESULT STDMETHODCALLTYPE
  674. get_BizRule(
  675. OUT BSTR *pbstrProp);
  676. virtual HRESULT STDMETHODCALLTYPE
  677. put_BizRule(
  678. IN BSTR bstrProp);
  679. virtual HRESULT STDMETHODCALLTYPE
  680. get_BizRuleLanguage(
  681. OUT BSTR *pbstrProp);
  682. virtual HRESULT STDMETHODCALLTYPE
  683. put_BizRuleLanguage(
  684. IN BSTR bstrProp);
  685. virtual HRESULT STDMETHODCALLTYPE
  686. get_BizRuleImportedPath(
  687. OUT BSTR *pbstrProp);
  688. virtual HRESULT STDMETHODCALLTYPE
  689. put_BizRuleImportedPath(
  690. IN BSTR bstrProp);
  691. virtual HRESULT STDMETHODCALLTYPE
  692. get_IsRoleDefinition(
  693. OUT BOOL *pfProp);
  694. virtual HRESULT STDMETHODCALLTYPE
  695. put_IsRoleDefinition(
  696. IN BOOL fProp);
  697. virtual HRESULT STDMETHODCALLTYPE
  698. get_Operations(
  699. OUT VARIANT *pvarProp);
  700. virtual HRESULT STDMETHODCALLTYPE
  701. get_Tasks(
  702. OUT VARIANT *pvarProp);
  703. HRESULT STDMETHODCALLTYPE AddOperation(
  704. IN BSTR bstrOp,
  705. IN VARIANT varReserved
  706. );
  707. HRESULT STDMETHODCALLTYPE DeleteOperation(
  708. IN BSTR bstrOp,
  709. IN VARIANT varReserved
  710. );
  711. HRESULT STDMETHODCALLTYPE AddTask(
  712. IN BSTR bstrTask,
  713. IN VARIANT varReserved
  714. );
  715. HRESULT STDMETHODCALLTYPE DeleteTask(
  716. IN BSTR bstrTask,
  717. IN VARIANT varReserved
  718. );
  719. virtual HRESULT STDMETHODCALLTYPE get_Writable(
  720. OUT BOOL *pfProp);
  721. virtual HRESULT STDMETHODCALLTYPE GetProperty(
  722. IN LONG lPropId,
  723. IN VARIANT varReserved,
  724. OUT VARIANT *pvarProp);
  725. virtual HRESULT STDMETHODCALLTYPE SetProperty(
  726. IN LONG lPropId,
  727. IN VARIANT varProp,
  728. IN VARIANT varReserved );
  729. virtual HRESULT STDMETHODCALLTYPE AddPropertyItem(
  730. IN LONG lPropId,
  731. IN VARIANT varProp,
  732. IN VARIANT varReserved );
  733. virtual HRESULT STDMETHODCALLTYPE DeletePropertyItem(
  734. IN LONG lPropId,
  735. IN VARIANT varProp,
  736. IN VARIANT varReserved );
  737. virtual HRESULT STDMETHODCALLTYPE Submit(
  738. IN LONG lFlags,
  739. IN VARIANT varReserved);
  740. //internal methods
  741. HRESULT _Init(
  742. IN AZ_HANDLE hOwnerApp,
  743. IN AZ_HANDLE hHandle);
  744. private:
  745. CRITICAL_SECTION m_cs;
  746. AZ_HANDLE m_hTask;
  747. AZ_HANDLE m_hOwnerApp;
  748. DWORD m_dwOwnerAppSN;
  749. };
  750. ///////////////////////
  751. //CAzTasks
  752. class ATL_NO_VTABLE CAzTasks :
  753. public CComObjectRootEx<CComMultiThreadModel>,
  754. public IDispatchImpl<TTasksCollection, &IID_IAzTasks, &LIBID_AZROLESLib>
  755. {
  756. public:
  757. DECLARE_NO_REGISTRY()
  758. BEGIN_COM_MAP(CAzTasks)
  759. COM_INTERFACE_ENTRY(IAzTasks)
  760. COM_INTERFACE_ENTRY(IDispatch)
  761. END_COM_MAP()
  762. //IAzTasks
  763. public:
  764. //internal methods
  765. HRESULT _Init(
  766. IN AZ_HANDLE hOwnerApp,
  767. IN VARIANT *pvarReserved,
  768. IN AZ_HANDLE hHandle);
  769. private:
  770. AZ_HANDLE m_hOwnerApp;
  771. DWORD m_dwOwnerAppSN;
  772. };
  773. ///////////////////////
  774. //CAzScope
  775. class ATL_NO_VTABLE CAzScope :
  776. public CComObjectRootEx<CComMultiThreadModel>,
  777. public IDispatchImpl<IAzScope, &IID_IAzScope, &LIBID_AZROLESLib>
  778. {
  779. public:
  780. DECLARE_NO_REGISTRY()
  781. BEGIN_COM_MAP(CAzScope)
  782. COM_INTERFACE_ENTRY(IAzScope)
  783. COM_INTERFACE_ENTRY(IDispatch)
  784. END_COM_MAP()
  785. //IAzScope
  786. public:
  787. CAzScope();
  788. ~CAzScope();
  789. virtual HRESULT STDMETHODCALLTYPE put_Name(
  790. IN BSTR bstrName);
  791. virtual HRESULT STDMETHODCALLTYPE get_Name(
  792. IN BSTR __RPC_FAR *pbstrName);
  793. virtual HRESULT STDMETHODCALLTYPE put_Description(
  794. IN BSTR bstrDescription);
  795. virtual HRESULT STDMETHODCALLTYPE get_Description(
  796. IN BSTR __RPC_FAR *pbstrDescription);
  797. virtual HRESULT STDMETHODCALLTYPE put_ApplicationData(
  798. IN BSTR bstrApplicationData);
  799. virtual HRESULT STDMETHODCALLTYPE get_ApplicationData(
  800. IN BSTR __RPC_FAR *pbstrApplicationData);
  801. virtual HRESULT STDMETHODCALLTYPE get_Writable(
  802. OUT BOOL *pfProp);
  803. virtual HRESULT STDMETHODCALLTYPE GetProperty(
  804. IN LONG lPropId,
  805. IN VARIANT varReserved,
  806. OUT VARIANT *pvarProp);
  807. virtual HRESULT STDMETHODCALLTYPE SetProperty(
  808. IN LONG lPropId,
  809. IN VARIANT varProp,
  810. IN VARIANT varReserved );
  811. virtual HRESULT STDMETHODCALLTYPE AddPropertyItem(
  812. IN LONG lPropId,
  813. IN VARIANT varProp,
  814. IN VARIANT varReserved );
  815. virtual HRESULT STDMETHODCALLTYPE DeletePropertyItem(
  816. IN LONG lPropId,
  817. IN VARIANT varProp,
  818. IN VARIANT varReserved );
  819. virtual HRESULT STDMETHODCALLTYPE get_PolicyAdministrators(
  820. OUT VARIANT *pvarAdmins);
  821. virtual HRESULT STDMETHODCALLTYPE get_PolicyReaders(
  822. OUT VARIANT *pvarReaders);
  823. virtual HRESULT STDMETHODCALLTYPE AddPolicyAdministrator(
  824. IN BSTR bstrReader,
  825. IN VARIANT varReserved);
  826. virtual HRESULT STDMETHODCALLTYPE DeletePolicyAdministrator(
  827. IN BSTR bstrReader,
  828. IN VARIANT varReserved);
  829. virtual HRESULT STDMETHODCALLTYPE AddPolicyReader(
  830. IN BSTR bstrReader,
  831. IN VARIANT varReserved);
  832. virtual HRESULT STDMETHODCALLTYPE DeletePolicyReader(
  833. IN BSTR bstrReader,
  834. IN VARIANT varReserved);
  835. virtual HRESULT STDMETHODCALLTYPE get_ApplicationGroups(
  836. OUT IAzApplicationGroups **ppGroups);
  837. virtual HRESULT STDMETHODCALLTYPE OpenApplicationGroup(
  838. IN BSTR bstrGroupName,
  839. IN VARIANT varReserved,
  840. OUT IAzApplicationGroup **ppGroup);
  841. virtual HRESULT STDMETHODCALLTYPE CreateApplicationGroup(
  842. IN BSTR bstrGroupName,
  843. IN VARIANT varReserved,
  844. OUT IAzApplicationGroup **ppGroup);
  845. virtual HRESULT STDMETHODCALLTYPE DeleteApplicationGroup(
  846. IN BSTR bstrGroupName,
  847. IN VARIANT varReserved );
  848. virtual HRESULT STDMETHODCALLTYPE get_Roles(
  849. OUT IAzRoles **ppRoles);
  850. virtual HRESULT STDMETHODCALLTYPE OpenRole(
  851. IN BSTR bstrRoleName,
  852. IN VARIANT varReserved,
  853. OUT IAzRole **ppRole);
  854. virtual HRESULT STDMETHODCALLTYPE CreateRole(
  855. IN BSTR bstrRoleName,
  856. IN VARIANT varReserved,
  857. OUT IAzRole **ppRole);
  858. virtual HRESULT STDMETHODCALLTYPE DeleteRole(
  859. IN BSTR bstrRoleName,
  860. IN VARIANT varReserved );
  861. virtual HRESULT STDMETHODCALLTYPE get_Tasks(
  862. OUT IAzTasks **ppTasks);
  863. virtual HRESULT STDMETHODCALLTYPE OpenTask(
  864. IN BSTR bstrTaskName,
  865. IN VARIANT varReserved,
  866. OUT IAzTask **ppTask);
  867. virtual HRESULT STDMETHODCALLTYPE CreateTask(
  868. IN BSTR bstrTaskName,
  869. IN VARIANT varReserved,
  870. OUT IAzTask **ppTask);
  871. virtual HRESULT STDMETHODCALLTYPE DeleteTask(
  872. IN BSTR bstrTaskName,
  873. IN VARIANT varReserved );
  874. virtual HRESULT STDMETHODCALLTYPE Submit(
  875. IN LONG lFlags,
  876. IN VARIANT varReserved);
  877. virtual HRESULT STDMETHODCALLTYPE get_CanBeDelegated(
  878. OUT BOOL *pfProp);
  879. virtual HRESULT STDMETHODCALLTYPE get_BizrulesWritable(
  880. OUT BOOL *pfProp);
  881. virtual HRESULT STDMETHODCALLTYPE get_PolicyAdministratorsName(
  882. OUT VARIANT* pvarAdmins
  883. );
  884. virtual HRESULT STDMETHODCALLTYPE get_PolicyReadersName(
  885. OUT VARIANT* pvarReaders
  886. );
  887. virtual HRESULT STDMETHODCALLTYPE AddPolicyAdministratorName(
  888. IN BSTR bstrAdmin,
  889. IN VARIANT varReserved
  890. );
  891. virtual HRESULT STDMETHODCALLTYPE DeletePolicyAdministratorName(
  892. IN BSTR bstrAdmin,
  893. IN VARIANT varReserved
  894. );
  895. virtual HRESULT STDMETHODCALLTYPE AddPolicyReaderName(
  896. IN BSTR bstrReader,
  897. IN VARIANT varReserved
  898. );
  899. virtual HRESULT STDMETHODCALLTYPE DeletePolicyReaderName(
  900. IN BSTR bstrReader,
  901. IN VARIANT varReserved
  902. );
  903. //internal methods
  904. HRESULT _Init(
  905. IN AZ_HANDLE hOwnerApp,
  906. IN AZ_HANDLE hHandle);
  907. private:
  908. CRITICAL_SECTION m_cs;
  909. AZ_HANDLE m_hScope;
  910. AZ_HANDLE m_hOwnerApp;
  911. DWORD m_dwOwnerAppSN;
  912. };
  913. ///////////////////////
  914. //CAzScopes
  915. class ATL_NO_VTABLE CAzScopes :
  916. public CComObjectRootEx<CComMultiThreadModel>,
  917. public IDispatchImpl<TScopesCollection, &IID_IAzScopes, &LIBID_AZROLESLib>
  918. {
  919. public:
  920. DECLARE_NO_REGISTRY()
  921. BEGIN_COM_MAP(CAzScopes)
  922. COM_INTERFACE_ENTRY(IAzScopes)
  923. COM_INTERFACE_ENTRY(IDispatch)
  924. END_COM_MAP()
  925. //IAzScopes
  926. public:
  927. //internal methods
  928. HRESULT _Init(
  929. IN AZ_HANDLE hOwnerApp,
  930. IN VARIANT *pvarReserved,
  931. IN AZ_HANDLE hHandle);
  932. private:
  933. AZ_HANDLE m_hOwnerApp;
  934. DWORD m_dwOwnerAppSN;
  935. };
  936. ///////////////////////
  937. //CAzApplicationGroup
  938. class ATL_NO_VTABLE CAzApplicationGroup :
  939. public CComObjectRootEx<CComMultiThreadModel>,
  940. public IDispatchImpl<IAzApplicationGroup, &IID_IAzApplicationGroup, &LIBID_AZROLESLib>
  941. {
  942. public:
  943. DECLARE_NO_REGISTRY()
  944. BEGIN_COM_MAP(CAzApplicationGroup)
  945. COM_INTERFACE_ENTRY(IAzApplicationGroup)
  946. COM_INTERFACE_ENTRY(IDispatch)
  947. END_COM_MAP()
  948. //IAzApplicationGroup
  949. public:
  950. CAzApplicationGroup();
  951. ~CAzApplicationGroup();
  952. virtual HRESULT STDMETHODCALLTYPE put_Name(
  953. IN BSTR bstrName);
  954. virtual HRESULT STDMETHODCALLTYPE get_Name(
  955. IN BSTR __RPC_FAR *pbstrName);
  956. virtual HRESULT STDMETHODCALLTYPE put_Description(
  957. IN BSTR bstrDescription);
  958. virtual HRESULT STDMETHODCALLTYPE get_Description(
  959. IN BSTR __RPC_FAR *pbstrDescription);
  960. virtual HRESULT STDMETHODCALLTYPE
  961. get_Type(
  962. OUT LONG *plProp
  963. );
  964. virtual HRESULT STDMETHODCALLTYPE
  965. put_Type(
  966. IN LONG lProp
  967. );
  968. virtual HRESULT STDMETHODCALLTYPE
  969. get_LdapQuery(
  970. OUT BSTR *pbstrProp
  971. );
  972. virtual HRESULT STDMETHODCALLTYPE
  973. put_LdapQuery(
  974. IN BSTR bstrProp
  975. );
  976. virtual HRESULT STDMETHODCALLTYPE
  977. get_AppMembers(
  978. OUT VARIANT *pvarProp
  979. );
  980. virtual HRESULT STDMETHODCALLTYPE
  981. get_AppNonMembers(
  982. OUT VARIANT *pvarProp
  983. );
  984. virtual HRESULT STDMETHODCALLTYPE
  985. get_Members(
  986. OUT VARIANT *pvarProp
  987. );
  988. virtual HRESULT STDMETHODCALLTYPE
  989. get_NonMembers(
  990. OUT VARIANT *pvarProp
  991. );
  992. virtual HRESULT STDMETHODCALLTYPE AddAppMember(
  993. IN BSTR bstrOp,
  994. IN VARIANT varReserved
  995. );
  996. virtual HRESULT STDMETHODCALLTYPE DeleteAppMember(
  997. IN BSTR bstrOp,
  998. IN VARIANT varReserved
  999. );
  1000. virtual HRESULT STDMETHODCALLTYPE AddAppNonMember(
  1001. IN BSTR bstrOp,
  1002. IN VARIANT varReserved
  1003. );
  1004. virtual HRESULT STDMETHODCALLTYPE DeleteAppNonMember(
  1005. IN BSTR bstrOp,
  1006. IN VARIANT varReserved
  1007. );
  1008. virtual HRESULT STDMETHODCALLTYPE AddMember(
  1009. IN BSTR bstrProp,
  1010. IN VARIANT varReserved);
  1011. virtual HRESULT STDMETHODCALLTYPE DeleteMember(
  1012. IN BSTR bstrProp,
  1013. IN VARIANT varReserved);
  1014. virtual HRESULT STDMETHODCALLTYPE AddNonMember(
  1015. IN BSTR bstrProp,
  1016. IN VARIANT varReserved);
  1017. virtual HRESULT STDMETHODCALLTYPE DeleteNonMember(
  1018. IN BSTR bstrProp,
  1019. IN VARIANT varReserved);
  1020. virtual HRESULT STDMETHODCALLTYPE get_Writable(
  1021. OUT BOOL *pfProp);
  1022. virtual HRESULT STDMETHODCALLTYPE GetProperty(
  1023. IN LONG lPropId,
  1024. IN VARIANT varReserved,
  1025. OUT VARIANT *pvarProp);
  1026. virtual HRESULT STDMETHODCALLTYPE SetProperty(
  1027. IN LONG lPropId,
  1028. IN VARIANT varProp,
  1029. IN VARIANT varReserved );
  1030. virtual HRESULT STDMETHODCALLTYPE AddPropertyItem(
  1031. IN LONG lPropId,
  1032. IN VARIANT varProp,
  1033. IN VARIANT varReserved );
  1034. virtual HRESULT STDMETHODCALLTYPE DeletePropertyItem(
  1035. IN LONG lPropId,
  1036. IN VARIANT varProp,
  1037. IN VARIANT varReserved );
  1038. virtual HRESULT STDMETHODCALLTYPE Submit(
  1039. IN LONG lFlags,
  1040. IN VARIANT varReserved);
  1041. virtual HRESULT STDMETHODCALLTYPE AddMemberName(
  1042. IN BSTR bstrProp,
  1043. IN VARIANT varReserved
  1044. );
  1045. virtual HRESULT STDMETHODCALLTYPE DeleteMemberName(
  1046. IN BSTR bstrProp,
  1047. IN VARIANT varReserved
  1048. );
  1049. virtual HRESULT STDMETHODCALLTYPE AddNonMemberName(
  1050. IN BSTR bstrProp,
  1051. IN VARIANT varReserved
  1052. );
  1053. virtual HRESULT STDMETHODCALLTYPE DeleteNonMemberName(
  1054. IN BSTR bstrProp,
  1055. IN VARIANT varReserved
  1056. );
  1057. virtual HRESULT STDMETHODCALLTYPE get_MembersName(
  1058. OUT VARIANT * pvarProp
  1059. );
  1060. virtual HRESULT STDMETHODCALLTYPE get_NonMembersName(
  1061. OUT VARIANT * pvarProp
  1062. );
  1063. //internal methods
  1064. HRESULT _Init(
  1065. IN AZ_HANDLE hOwnerApp,
  1066. IN AZ_HANDLE hHandle);
  1067. private:
  1068. CRITICAL_SECTION m_cs;
  1069. AZ_HANDLE m_hGroup;
  1070. AZ_HANDLE m_hOwnerApp;
  1071. DWORD m_dwOwnerAppSN;
  1072. };
  1073. ///////////////////////
  1074. //CAzApplicationGroups
  1075. class ATL_NO_VTABLE CAzApplicationGroups :
  1076. public CComObjectRootEx<CComMultiThreadModel>,
  1077. public IDispatchImpl<TApplicationGroupsCollection, &IID_IAzApplicationGroups, &LIBID_AZROLESLib>
  1078. {
  1079. public:
  1080. DECLARE_NO_REGISTRY()
  1081. BEGIN_COM_MAP(CAzApplicationGroups)
  1082. COM_INTERFACE_ENTRY(IAzApplicationGroups)
  1083. COM_INTERFACE_ENTRY(IDispatch)
  1084. END_COM_MAP()
  1085. //IAzApplicationGroups
  1086. public:
  1087. //internal methods
  1088. HRESULT _Init(
  1089. IN AZ_HANDLE hOwnerApp,
  1090. IN VARIANT *pvarReserved,
  1091. IN AZ_HANDLE hHandle);
  1092. private:
  1093. AZ_HANDLE m_hOwnerApp;
  1094. DWORD m_dwOwnerAppSN;
  1095. };
  1096. ///////////////////////
  1097. //CAzRole
  1098. class ATL_NO_VTABLE CAzRole :
  1099. public CComObjectRootEx<CComMultiThreadModel>,
  1100. public IDispatchImpl<IAzRole, &IID_IAzRole, &LIBID_AZROLESLib>
  1101. {
  1102. public:
  1103. DECLARE_NO_REGISTRY()
  1104. BEGIN_COM_MAP(CAzRole)
  1105. COM_INTERFACE_ENTRY(IAzRole)
  1106. COM_INTERFACE_ENTRY(IDispatch)
  1107. END_COM_MAP()
  1108. //IAzRole
  1109. public:
  1110. CAzRole();
  1111. ~CAzRole();
  1112. virtual HRESULT STDMETHODCALLTYPE put_Name(
  1113. IN BSTR bstrName);
  1114. virtual HRESULT STDMETHODCALLTYPE get_Name(
  1115. IN BSTR __RPC_FAR *pbstrName);
  1116. virtual HRESULT STDMETHODCALLTYPE put_Description(
  1117. IN BSTR bstrDescription);
  1118. virtual HRESULT STDMETHODCALLTYPE get_Description(
  1119. IN BSTR __RPC_FAR *pbstrDescription);
  1120. virtual HRESULT STDMETHODCALLTYPE put_ApplicationData(
  1121. IN BSTR bstrApplicationData);
  1122. virtual HRESULT STDMETHODCALLTYPE get_ApplicationData(
  1123. IN BSTR __RPC_FAR *pbstrApplicationData);
  1124. virtual
  1125. HRESULT STDMETHODCALLTYPE get_AppMembers(
  1126. OUT VARIANT *pvarProp
  1127. );
  1128. virtual
  1129. HRESULT STDMETHODCALLTYPE get_Members(
  1130. OUT VARIANT *pvarProp
  1131. );
  1132. virtual
  1133. HRESULT STDMETHODCALLTYPE get_Operations(
  1134. OUT VARIANT *pvarProp
  1135. );
  1136. virtual
  1137. HRESULT STDMETHODCALLTYPE get_Tasks(
  1138. OUT VARIANT *pvarProp
  1139. );
  1140. virtual HRESULT STDMETHODCALLTYPE AddAppMember(
  1141. IN BSTR bstrProp,
  1142. IN VARIANT varReserved
  1143. );
  1144. virtual HRESULT STDMETHODCALLTYPE DeleteAppMember(
  1145. IN BSTR bstrProp,
  1146. IN VARIANT varReserved
  1147. );
  1148. virtual HRESULT STDMETHODCALLTYPE AddTask(
  1149. IN BSTR bstrProp,
  1150. IN VARIANT varReserved
  1151. );
  1152. virtual HRESULT STDMETHODCALLTYPE DeleteTask(
  1153. IN BSTR bstrProp,
  1154. IN VARIANT varReserved
  1155. );
  1156. virtual HRESULT STDMETHODCALLTYPE AddOperation(
  1157. IN BSTR bstrProp,
  1158. IN VARIANT varReserved
  1159. );
  1160. virtual HRESULT STDMETHODCALLTYPE DeleteOperation(
  1161. IN BSTR bstrProp,
  1162. IN VARIANT varReserved
  1163. );
  1164. virtual HRESULT STDMETHODCALLTYPE AddMember(
  1165. IN BSTR bstrProp,
  1166. IN VARIANT varReserved);
  1167. virtual HRESULT STDMETHODCALLTYPE DeleteMember(
  1168. IN BSTR bstrProp,
  1169. IN VARIANT varReserved);
  1170. virtual HRESULT STDMETHODCALLTYPE get_Writable(
  1171. OUT BOOL *pfProp);
  1172. virtual HRESULT STDMETHODCALLTYPE GetProperty(
  1173. IN LONG lPropId,
  1174. IN VARIANT varReserved,
  1175. OUT VARIANT *pvarProp);
  1176. virtual HRESULT STDMETHODCALLTYPE SetProperty(
  1177. IN LONG lPropId,
  1178. IN VARIANT varProp,
  1179. IN VARIANT varReserved );
  1180. virtual HRESULT STDMETHODCALLTYPE AddPropertyItem(
  1181. IN LONG lPropId,
  1182. IN VARIANT varProp,
  1183. IN VARIANT varReserved );
  1184. virtual HRESULT STDMETHODCALLTYPE DeletePropertyItem(
  1185. IN LONG lPropId,
  1186. IN VARIANT varProp,
  1187. IN VARIANT varReserved );
  1188. virtual HRESULT STDMETHODCALLTYPE Submit(
  1189. IN LONG lFlags,
  1190. IN VARIANT varReserved);
  1191. virtual HRESULT STDMETHODCALLTYPE AddMemberName(
  1192. IN BSTR bstrProp,
  1193. IN VARIANT varReserved
  1194. );
  1195. virtual HRESULT STDMETHODCALLTYPE DeleteMemberName(
  1196. IN BSTR bstrProp,
  1197. IN VARIANT varReserved
  1198. );
  1199. virtual HRESULT STDMETHODCALLTYPE get_MembersName(
  1200. OUT VARIANT * pvarProp
  1201. );
  1202. //internal methods
  1203. HRESULT _Init(
  1204. IN AZ_HANDLE hOwnerApp,
  1205. IN AZ_HANDLE hHandle);
  1206. private:
  1207. CRITICAL_SECTION m_cs;
  1208. AZ_HANDLE m_hRole;
  1209. AZ_HANDLE m_hOwnerApp;
  1210. DWORD m_dwOwnerAppSN;
  1211. };
  1212. ///////////////////////
  1213. //CAzRoles
  1214. class ATL_NO_VTABLE CAzRoles :
  1215. public CComObjectRootEx<CComMultiThreadModel>,
  1216. public IDispatchImpl<TRolesCollection, &IID_IAzRoles, &LIBID_AZROLESLib>
  1217. {
  1218. public:
  1219. DECLARE_NO_REGISTRY()
  1220. BEGIN_COM_MAP(CAzRoles)
  1221. COM_INTERFACE_ENTRY(IAzRoles)
  1222. COM_INTERFACE_ENTRY(IDispatch)
  1223. END_COM_MAP()
  1224. //IAzRoles
  1225. public:
  1226. //internal methods
  1227. HRESULT _Init(
  1228. IN AZ_HANDLE hOwnerApp,
  1229. IN VARIANT *pvarReserved,
  1230. IN AZ_HANDLE hHandle);
  1231. private:
  1232. AZ_HANDLE m_hOwnerApp;
  1233. DWORD m_dwOwnerAppSN;
  1234. };
  1235. ///////////////////////
  1236. //CAzClientContext
  1237. class ATL_NO_VTABLE CAzClientContext :
  1238. public CComObjectRootEx<CComMultiThreadModel>,
  1239. public IDispatchImpl<IAzClientContext, &IID_IAzClientContext, &LIBID_AZROLESLib>
  1240. {
  1241. public:
  1242. DECLARE_NO_REGISTRY()
  1243. BEGIN_COM_MAP(CAzClientContext)
  1244. COM_INTERFACE_ENTRY(IAzClientContext)
  1245. COM_INTERFACE_ENTRY(IDispatch)
  1246. END_COM_MAP()
  1247. //IAzClientContext
  1248. public:
  1249. CAzClientContext();
  1250. ~CAzClientContext();
  1251. virtual HRESULT STDMETHODCALLTYPE AccessCheck(
  1252. IN BSTR bstrObjectName,
  1253. IN VARIANT varScopeNames,
  1254. IN VARIANT varOperations,
  1255. IN VARIANT varParameterNames,
  1256. IN VARIANT varParameterValues,
  1257. IN VARIANT varInterfaceNames,
  1258. IN VARIANT varInterfaceFlags,
  1259. IN VARIANT varInterfaces,
  1260. OUT VARIANT *pvarResults);
  1261. virtual HRESULT STDMETHODCALLTYPE GetBusinessRuleString(
  1262. OUT BSTR *pbstrBusinessRuleString);
  1263. virtual HRESULT STDMETHODCALLTYPE get_UserDn(
  1264. OUT BSTR *pbstrProp
  1265. );
  1266. virtual HRESULT STDMETHODCALLTYPE get_UserSamCompat(
  1267. OUT BSTR *pbstrProp
  1268. );
  1269. virtual HRESULT STDMETHODCALLTYPE get_UserDisplay(
  1270. OUT BSTR *pbstrProp
  1271. );
  1272. virtual HRESULT STDMETHODCALLTYPE get_UserGuid(
  1273. OUT BSTR *pbstrProp
  1274. );
  1275. virtual HRESULT STDMETHODCALLTYPE get_UserCanonical(
  1276. OUT BSTR *pbstrProp
  1277. );
  1278. virtual HRESULT STDMETHODCALLTYPE get_UserUpn(
  1279. OUT BSTR *pbstrProp
  1280. );
  1281. virtual HRESULT STDMETHODCALLTYPE get_UserDnsSamCompat(
  1282. OUT BSTR *pbstrProp
  1283. );
  1284. virtual HRESULT STDMETHODCALLTYPE GetProperty(
  1285. IN LONG lPropId,
  1286. IN VARIANT varReserved,
  1287. OUT VARIANT *pvarProp);
  1288. virtual HRESULT STDMETHODCALLTYPE GetRoles(
  1289. IN BSTR bstrScopeName,
  1290. OUT VARIANT *pvarRoleNames);
  1291. virtual HRESULT STDMETHODCALLTYPE get_RoleForAccessCheck(
  1292. OUT BSTR *pbstrProp
  1293. );
  1294. virtual HRESULT STDMETHODCALLTYPE put_RoleForAccessCheck(
  1295. IN BSTR bstrProp
  1296. );
  1297. //internal methods
  1298. HRESULT _Init(
  1299. IN AZ_HANDLE hOwnerApp,
  1300. IN AZ_HANDLE hHandle,
  1301. IN LONG varReserved);
  1302. private:
  1303. CRITICAL_SECTION m_cs;
  1304. AZ_HANDLE m_hClientContext;
  1305. LONG m_lReserved;
  1306. WCHAR *m_pwszBusinessRuleString;
  1307. AZ_HANDLE m_hOwnerApp;
  1308. DWORD m_dwOwnerAppSN;
  1309. };
  1310. ///////////////////////
  1311. //CAzBizRuleContext
  1312. class ATL_NO_VTABLE CAzBizRuleContext :
  1313. public CComObjectRootEx<CComMultiThreadModel>,
  1314. public CComCoClass<CAzBizRuleContext, &CLSID_AzBizRuleContext>,
  1315. public IDispatchImpl<IAzBizRuleContext, &IID_IAzBizRuleContext, &LIBID_AZROLESLib>
  1316. {
  1317. public:
  1318. DECLARE_REGISTRY_RESOURCEID(IDR_AZBIZRULECONTEXT)
  1319. BEGIN_COM_MAP(CAzBizRuleContext)
  1320. COM_INTERFACE_ENTRY(IAzBizRuleContext)
  1321. COM_INTERFACE_ENTRY(IDispatch)
  1322. END_COM_MAP()
  1323. //IAzBizRuleContext
  1324. public:
  1325. CAzBizRuleContext();
  1326. ~CAzBizRuleContext();
  1327. virtual HRESULT STDMETHODCALLTYPE put_BusinessRuleResult(
  1328. IN BOOL bResult);
  1329. virtual HRESULT STDMETHODCALLTYPE put_BusinessRuleString(
  1330. IN BSTR bstrBusinessRuleString);
  1331. virtual HRESULT STDMETHODCALLTYPE get_BusinessRuleString(
  1332. OUT BSTR *pbstrBusinessRuleString);
  1333. virtual HRESULT STDMETHODCALLTYPE GetParameter(
  1334. IN BSTR bstrParameterName,
  1335. OUT VARIANT *pvarParameterValue);
  1336. friend VOID SetAccessCheckContext(
  1337. IN OUT CAzBizRuleContext* BizRuleContext,
  1338. IN BOOL bCaseSensitive,
  1339. IN PACCESS_CHECK_CONTEXT AcContext,
  1340. IN PBOOL BizRuleResult,
  1341. IN HRESULT *ScriptError
  1342. );
  1343. private:
  1344. PACCESS_CHECK_CONTEXT m_AcContext;
  1345. PBOOL m_BizRuleResult;
  1346. HRESULT *m_ScriptError;
  1347. ITypeInfo *m_typeInfo;
  1348. BOOL m_bCaseSensitive;
  1349. };
  1350. #endif //__AZDISP_H_