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.

914 lines
22 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: genpage.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // genpage.h : header file
  11. //
  12. #define SERVERSETTINGS_PROPPAGE_GENERAL 0x1
  13. #define SERVERSETTINGS_PROPPAGE_POLICY 0x2
  14. #define SERVERSETTINGS_PROPPAGE_EXIT 0x4
  15. #define SERVERSETTINGS_PROPPAGE_STORAGE 0x8
  16. #define SERVERSETTINGS_PROPPAGE_KRA 0x10
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CGeneralPage dialog
  19. #include "chooser.h"
  20. #include "csw97ppg.h"
  21. #include "urls.h"
  22. #include "officer.h"
  23. #include "roles.h"
  24. //////////////////////////////
  25. // hand-hewn pages
  26. class CSvrSettingsGeneralPage : public CAutoDeletePropPage
  27. {
  28. public:
  29. enum { IID_DEFAULT = IDD_CERTSRV_PROPPAGE1 };
  30. // Construction
  31. public:
  32. CSvrSettingsGeneralPage(CertSvrCA* pCA, UINT uIDD = IID_DEFAULT);
  33. virtual ~CSvrSettingsGeneralPage();
  34. // Dialog Data
  35. CString m_cstrCAName;
  36. CString m_cstrOrg;
  37. CString m_cstrDescription;
  38. CString m_cstrProvName;
  39. CString m_cstrHashAlg;
  40. // Overrides
  41. public:
  42. virtual BOOL OnApply();
  43. virtual BOOL OnInitDialog();
  44. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  45. // Implementation
  46. protected:
  47. void OnDestroy();
  48. void OnEditChange();
  49. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  50. void OnViewCert(HWND hwnd);
  51. BOOL OnNotify(UINT idCtrl, NMHDR* pnmh);
  52. public:
  53. void NeedServiceRestart(WORD wPage) { m_fRestartServer = TRUE; m_wRestart |= wPage; }
  54. void TryServiceRestart(WORD wPage);
  55. void SetAllocedSecurityInfo(LPSECURITYINFO pToBeReleased) {m_pReleaseMe = pToBeReleased; }
  56. LONG_PTR m_hConsoleHandle; // Handle given to the snap-in by the console
  57. CertSvrCA* m_pCA;
  58. private:
  59. BOOL m_bUpdate;
  60. BOOL m_fRestartServer;
  61. WORD m_wRestart;
  62. BOOL m_fWin2kCA;
  63. LPSECURITYINFO m_pReleaseMe;
  64. ICertAdmin2 *m_pAdmin;
  65. };
  66. class CSvrSettingsPolicyPage : public CAutoDeletePropPage, public CRolesSupportInPropPage
  67. {
  68. public:
  69. enum { IID_DEFAULT = IDD_CERTSRV_PROPPAGE2 };
  70. static RoleAccessToControl sm_ControlToRoleMap[];
  71. // Construction
  72. public:
  73. CSvrSettingsPolicyPage(CSvrSettingsGeneralPage* pControlPage, UINT uIDD = IID_DEFAULT);
  74. virtual ~CSvrSettingsPolicyPage();
  75. // Dialog Data
  76. CString m_cstrModuleName;
  77. CString m_cstrModuleDescr;
  78. CString m_cstrModuleVersion;
  79. CString m_cstrModuleCopyright;
  80. BOOL m_fLoadedActiveModule;
  81. LPOLESTR m_pszprogidPolicyModule;
  82. CLSID m_clsidPolicyModule;
  83. // Overrides
  84. public:
  85. virtual BOOL OnApply();
  86. virtual BOOL OnInitDialog();
  87. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  88. // Implementation
  89. protected:
  90. void OnDestroy();
  91. void OnSetActiveModule();
  92. void OnConfigureModule();
  93. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  94. HRESULT GetCurrentModuleProperties();
  95. public:
  96. CSvrSettingsGeneralPage* m_pControlPage;
  97. private:
  98. BOOL m_bUpdate;
  99. };
  100. // everything you could want to describe a policy/exit module
  101. typedef struct _COM_CERTSRV_MODULEDEFN
  102. {
  103. LPOLESTR szModuleProgID;
  104. CLSID clsidModule;
  105. } COM_CERTSRV_MODULEDEFN, *PCOM_CERTSRV_MODULEDEFN;
  106. class CSvrSettingsExitPage : public CAutoDeletePropPage, public CRolesSupportInPropPage
  107. {
  108. public:
  109. enum { IID_DEFAULT = IDD_CERTSRV_PROPPAGE3 };
  110. static RoleAccessToControl sm_ControlToRoleMap[];
  111. // Construction
  112. public:
  113. CSvrSettingsExitPage(CSvrSettingsGeneralPage* pControlPage, UINT uIDD = IID_DEFAULT);
  114. virtual ~CSvrSettingsExitPage();
  115. // Dialog Data
  116. CString m_cstrModuleName;
  117. CString m_cstrModuleDescr;
  118. CString m_cstrModuleVersion;
  119. CString m_cstrModuleCopyright;
  120. BOOL m_fLoadedActiveModule;
  121. int m_iSelected;
  122. CArray<COM_CERTSRV_MODULEDEFN, COM_CERTSRV_MODULEDEFN> m_arrExitModules;
  123. // Overrides
  124. public:
  125. virtual BOOL OnApply();
  126. virtual BOOL OnInitDialog();
  127. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  128. // Implementation
  129. protected:
  130. void OnDestroy();
  131. BOOL UpdateSelectedModule();
  132. void OnAddActiveModule();
  133. void OnRemoveActiveModule();
  134. void OnConfigureModule();
  135. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  136. HRESULT InitializeExitLB();
  137. public:
  138. CSvrSettingsGeneralPage* m_pControlPage;
  139. private:
  140. BOOL m_bUpdate;
  141. };
  142. typedef struct _EXTENSIONWIZ_DATA
  143. {
  144. int idExtensionName; //resource id of extension name
  145. int idExtensionExplain;//resource id of extension explaination
  146. int idCheckboxText; // resource id of 'include in...' checkbox text
  147. int idCheckboxText2; // resource id of 'OCSP' vs. 'publish Deltas here' chkbox text
  148. WCHAR *wszRegName; //value name in registry
  149. DWORD dwFlagsMask; //flag mask of compatible bits
  150. CSURLTEMPLATENODE *pURLList; //list of url templates
  151. } EXTENSIONWIZ_DATA;
  152. class CSvrSettingsExtensionPage : public CAutoDeletePropPage, public CRolesSupportInPropPage
  153. {
  154. public:
  155. enum { IID_DEFAULT = IDD_CERTSRV_PROPPAGE4 };
  156. static RoleAccessToControl sm_ControlToRoleMap[];
  157. // Construction
  158. public:
  159. CSvrSettingsExtensionPage(
  160. CertSvrCA *pCA,
  161. CSvrSettingsGeneralPage *pControlPage,
  162. UINT uIDD = IID_DEFAULT);
  163. virtual ~CSvrSettingsExtensionPage();
  164. // Dialog Data
  165. // Overrides
  166. public:
  167. virtual BOOL OnApply();
  168. virtual BOOL OnInitDialog();
  169. virtual BOOL OnNotify(UINT idCtrl, NMHDR* pnmh);
  170. virtual void OnHelp(LPHELPINFO lpHelp);
  171. virtual void OnContextHelp(HWND hwnd);
  172. // Implementation
  173. protected:
  174. void OnDestroy();
  175. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  176. public:
  177. CSvrSettingsGeneralPage* m_pControlPage;
  178. private:
  179. void UpdateURLFlags(
  180. IN EXTENSIONWIZ_DATA *pExt,
  181. IN OPTIONAL CSURLTEMPLATENODE *pURLNode);
  182. void UpdateURLFlagControl(
  183. IN int idCtrl,
  184. IN DWORD dwFlag,
  185. IN EXTENSIONWIZ_DATA *pExt,
  186. IN CSURLTEMPLATENODE *pURLNode);
  187. void OnExtensionChange();
  188. void OnURLChange();
  189. void OnURLCopy();
  190. void OnFlagChange(DWORD dwFlag);
  191. BOOL OnURLRemove();
  192. BOOL OnURLAdd();
  193. CSURLTEMPLATENODE *GetCurrentURL(LRESULT *pnIndex);
  194. EXTENSIONWIZ_DATA *GetCurrentExtension();
  195. BOOL m_bUpdate;
  196. LRESULT m_nIndexReset;
  197. EXTENSIONWIZ_DATA *m_pExtData; // point to array of extensions
  198. };
  199. class CSvrSettingsStoragePage : public CAutoDeletePropPage
  200. {
  201. public:
  202. enum { IID_DEFAULT = IDD_CERTSRV_PROPPAGE5 };
  203. // Construction
  204. public:
  205. CSvrSettingsStoragePage(CSvrSettingsGeneralPage* pControlPage, UINT uIDD = IID_DEFAULT);
  206. virtual ~CSvrSettingsStoragePage();
  207. // Dialog Data
  208. CString m_cstrDatabasePath;
  209. CString m_cstrLogPath;
  210. CString m_cstrSharedFolder;
  211. // Overrides
  212. public:
  213. virtual BOOL OnInitDialog();
  214. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  215. public:
  216. CSvrSettingsGeneralPage* m_pControlPage;
  217. private:
  218. BOOL m_bUpdate;
  219. };
  220. typedef struct _KRA_NODE
  221. {
  222. CERT_CONTEXT const *pCert;
  223. DWORD dwDisposition;
  224. DWORD dwFlags;
  225. struct _KRA_NODE *next;
  226. } KRA_NODE;
  227. class CSvrSettingsKRAPage : public CAutoDeletePropPage, public CRolesSupportInPropPage
  228. {
  229. public:
  230. enum { IID_DEFAULT = IDD_CERTSRV_PROPPAGE_CHOOSE_KRA };
  231. static RoleAccessToControl sm_ControlToRoleMap[];
  232. // Construction
  233. public:
  234. CSvrSettingsKRAPage(
  235. CertSvrCA *pCA,
  236. CSvrSettingsGeneralPage* pControlPage,
  237. UINT uIDD = IID_DEFAULT);
  238. virtual ~CSvrSettingsKRAPage();
  239. // Dialog Data
  240. // Overrides
  241. public:
  242. virtual BOOL OnApply();
  243. virtual BOOL OnInitDialog();
  244. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  245. static LPCWSTR MapDispositionToString(DWORD dwDisp);
  246. // Implementation
  247. protected:
  248. void OnDestroy();
  249. void OnAddKRA();
  250. void OnRemoveKRA();
  251. void OnViewKRA();
  252. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  253. void EnableKRARemoveViewListButtons(BOOL fEnabled);
  254. void EnableKRAAddListButton(BOOL fEnabled);
  255. void EnableKRARadioButtons(BOOL fMoreThanZero);
  256. void EnableKRAListView(BOOL fEnabled);
  257. void EnableKRAEdit(BOOL fEnabled);
  258. void UpdateKRARadioControls();
  259. void LoadKRADispositions();
  260. BOOL OnNotify(UINT idCtrl, NMHDR* pnmh);
  261. HRESULT SaveKRAList(ICertAdmin2 *pAdmin);
  262. HRESULT LoadKRAList(ICertAdmin2 *pAdmin);
  263. bool IsCurrentItemValidCert();
  264. public:
  265. CSvrSettingsGeneralPage* m_pControlPage;
  266. private:
  267. BOOL m_fDirty;
  268. BOOL m_fArchiveKey;
  269. BOOL m_fCountUpdate;
  270. BOOL m_fKRAUpdate;
  271. KRA_NODE *m_pKRAList; //list of KRAs
  272. DWORD m_dwKRAUsedCount;
  273. DWORD m_dwKRACount;
  274. static CString m_strDispositions[];
  275. };
  276. /////////////////////////////////////////
  277. // CCRLPropPage
  278. class CCRLPropPage : public CAutoDeletePropPage, public CRolesSupportInPropPage
  279. {
  280. public:
  281. enum { IID_DEFAULT = IDD_CRL_PROPPAGE };
  282. static RoleAccessToControl sm_ControlToRoleMap[];
  283. // Construction
  284. public:
  285. CCRLPropPage(CertSvrCA* pCA, UINT uIDD = IID_DEFAULT);
  286. virtual ~CCRLPropPage();
  287. // Dialog Data
  288. CString m_cstrPublishPeriodCount;
  289. CComboBox m_cboxPublishPeriodString;
  290. CString m_cstrLastCRLPublish;
  291. // int m_iNoAutoPublish;
  292. CString m_cstrDeltaPublishPeriodCount;
  293. CComboBox m_cboxDeltaPublishPeriodString;
  294. CString m_cstrDeltaLastCRLPublish;
  295. int m_iDeltaPublish;
  296. // Overrides
  297. public:
  298. virtual BOOL OnApply();
  299. virtual BOOL OnInitDialog();
  300. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  301. // Implementation
  302. protected:
  303. void OnDestroy();
  304. void OnEditChange();
  305. void OnCheckBoxChange(BOOL fDisableBaseCRL);
  306. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  307. void GetDeltaNextPublish();
  308. public:
  309. LONG_PTR m_hConsoleHandle; // Handle given to the snap-in by the console
  310. private:
  311. BOOL m_bUpdate;
  312. };
  313. /////////////////////////////////////////
  314. // CCRLViewPage
  315. class CCRLViewPage : public CAutoDeletePropPage
  316. {
  317. public:
  318. enum { IID_DEFAULT = IDD_CRL_VIEWPAGE };
  319. // Construction
  320. public:
  321. CCRLViewPage(CCRLPropPage* pControlPage, UINT uIDD = IID_DEFAULT);
  322. virtual ~CCRLViewPage();
  323. // Dialog Data
  324. // Overrides
  325. public:
  326. virtual BOOL OnInitDialog();
  327. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  328. // Implementation
  329. protected:
  330. void OnViewCRL(BOOL fViewBaseCRL);
  331. void OnSelectCRL(BOOL fBaseCRL);
  332. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  333. void OnDestroy();
  334. BOOL OnNotify(UINT idCtrl, NMHDR* pnmh);
  335. public:
  336. CCRLPropPage* m_pControlPage;
  337. };
  338. typedef struct _BACKUPWIZ_STATE
  339. {
  340. CertSvrCA* pCA;
  341. BOOL fBackupKeyCert;
  342. BOOL fBackupLogs;
  343. BOOL fIncremental;
  344. LPWSTR szLogsPath;
  345. LPWSTR szPassword;
  346. } BACKUPWIZ_STATE, *PBACKUPWIZ_STATE;
  347. /////////////////////////////////////////
  348. // CBackupWizPage
  349. class CBackupWizPage1 : public CWizard97PropertyPage
  350. {
  351. public:
  352. enum { IID_DEFAULT = IDD_BACKUPWIZ_WELCOME };
  353. // Construction
  354. public:
  355. CBackupWizPage1(PBACKUPWIZ_STATE pState, CWizard97PropertySheet *pcDlg, UINT uIDD = IID_DEFAULT);
  356. ~CBackupWizPage1();
  357. // Dialog Data
  358. // Overrides
  359. public:
  360. virtual BOOL OnInitDialog();
  361. virtual BOOL OnSetActive();
  362. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  363. // Implementation
  364. protected:
  365. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  366. public:
  367. PBACKUPWIZ_STATE m_pState;
  368. CWizard97PropertySheet* m_pParentSheet;
  369. };
  370. /////////////////////////////////////////
  371. // CBackupWizPage2
  372. class CBackupWizPage2 : public CWizard97PropertyPage
  373. {
  374. public:
  375. enum { IID_DEFAULT = IDD_BACKUPWIZ_SELECT_DATA};
  376. // Construction
  377. public:
  378. CBackupWizPage2(PBACKUPWIZ_STATE pState, CWizard97PropertySheet *pcDlg, UINT uIDD = IID_DEFAULT);
  379. // Dialog Data
  380. CString m_cstrLogsPath;
  381. int m_iKeyCertCheck;
  382. int m_iLogsCheck;
  383. int m_iIncrementalCheck;
  384. BOOL m_fIncrementalAllowed;
  385. // Overrides
  386. public:
  387. virtual BOOL OnInitDialog();
  388. virtual LRESULT OnWizardNext();
  389. virtual BOOL OnSetActive();
  390. void OnBrowse();
  391. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  392. // Implementation
  393. protected:
  394. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  395. HRESULT ConvertLogsPathToFullPath();
  396. public:
  397. PBACKUPWIZ_STATE m_pState;
  398. CWizard97PropertySheet* m_pParentSheet;
  399. };
  400. /////////////////////////////////////////
  401. // CBackupWizPage3
  402. class CBackupWizPage3 : public CWizard97PropertyPage
  403. {
  404. public:
  405. enum { IID_DEFAULT = IDD_BACKUPWIZ_SELECT_PASSWORD};
  406. // Construction
  407. public:
  408. CBackupWizPage3(PBACKUPWIZ_STATE pState, CWizard97PropertySheet *pcDlg, UINT uIDD = IID_DEFAULT);
  409. // Dialog Data
  410. CString m_cstrPwd;
  411. CString m_cstrPwdVerify;
  412. // Overrides
  413. public:
  414. virtual BOOL OnInitDialog();
  415. virtual LRESULT OnWizardNext();
  416. virtual BOOL OnSetActive();
  417. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  418. // Implementation
  419. protected:
  420. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  421. public:
  422. PBACKUPWIZ_STATE m_pState;
  423. CWizard97PropertySheet* m_pParentSheet;
  424. };
  425. /////////////////////////////////////////
  426. // CBackupWizPage5
  427. class CBackupWizPage5 : public CWizard97PropertyPage
  428. {
  429. public:
  430. enum { IID_DEFAULT = IDD_BACKUPWIZ_COMPLETION };
  431. // Construction
  432. public:
  433. CBackupWizPage5(PBACKUPWIZ_STATE pState, CWizard97PropertySheet *pcDlg, UINT uIDD = IID_DEFAULT);
  434. // Dialog Data
  435. // Overrides
  436. public:
  437. virtual BOOL OnInitDialog();
  438. virtual LRESULT OnWizardBack();
  439. virtual BOOL OnSetActive();
  440. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  441. // Implementation
  442. protected:
  443. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  444. public:
  445. PBACKUPWIZ_STATE m_pState;
  446. CWizard97PropertySheet* m_pParentSheet;
  447. };
  448. typedef struct _RESTOREWIZ_STATE
  449. {
  450. CertSvrCA* pCA;
  451. BOOL fRestoreKeyCert;
  452. LPWSTR szKeyCertPath;
  453. LPWSTR szConfigPath;
  454. BOOL fRestoreLogs;
  455. LPWSTR szLogsPath;
  456. LPWSTR szPassword;
  457. BOOL fIncremental;
  458. } RESTOREWIZ_STATE, *PRESTOREWIZ_STATE;
  459. /////////////////////////////////////////
  460. // CRestoreWizPage
  461. class CRestoreWizPage1 : public CWizard97PropertyPage
  462. {
  463. public:
  464. enum { IID_DEFAULT = IDD_RESTOREWIZ_WELCOME };
  465. // Construction
  466. public:
  467. CRestoreWizPage1(PRESTOREWIZ_STATE pState, CWizard97PropertySheet *pcDlg, UINT uIDD = IID_DEFAULT);
  468. ~CRestoreWizPage1();
  469. // Dialog Data
  470. // Overrides
  471. public:
  472. virtual BOOL OnInitDialog();
  473. virtual BOOL OnSetActive();
  474. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  475. // Implementation
  476. protected:
  477. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  478. public:
  479. PRESTOREWIZ_STATE m_pState;
  480. CWizard97PropertySheet* m_pParentSheet;
  481. };
  482. /////////////////////////////////////////
  483. // CRestoreWizPage2
  484. class CRestoreWizPage2 : public CWizard97PropertyPage
  485. {
  486. public:
  487. enum { IID_DEFAULT = IDD_RESTOREWIZ_SELECT_DATA};
  488. // Construction
  489. public:
  490. CRestoreWizPage2(PRESTOREWIZ_STATE pState, CWizard97PropertySheet *pcDlg, UINT uIDD = IID_DEFAULT);
  491. // Dialog Data
  492. CString m_cstrLogsPath;
  493. int m_iKeyCertCheck;
  494. int m_iLogsCheck;
  495. // Overrides
  496. public:
  497. virtual BOOL OnInitDialog();
  498. virtual LRESULT OnWizardNext();
  499. virtual BOOL OnSetActive();
  500. void OnBrowse();
  501. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  502. // Implementation
  503. protected:
  504. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  505. public:
  506. PRESTOREWIZ_STATE m_pState;
  507. CWizard97PropertySheet* m_pParentSheet;
  508. };
  509. /////////////////////////////////////////
  510. // CRestoreWizPage3
  511. class CRestoreWizPage3 : public CWizard97PropertyPage
  512. {
  513. public:
  514. enum { IID_DEFAULT = IDD_RESTOREWIZ_SELECT_PASSWORD};
  515. // Construction
  516. public:
  517. CRestoreWizPage3(PRESTOREWIZ_STATE pState, CWizard97PropertySheet *pcDlg, UINT uIDD = IID_DEFAULT);
  518. // Dialog Data
  519. CString m_cstrPwd;
  520. // Overrides
  521. public:
  522. virtual BOOL OnInitDialog();
  523. virtual LRESULT OnWizardNext();
  524. virtual BOOL OnSetActive();
  525. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  526. // Implementation
  527. protected:
  528. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  529. public:
  530. PRESTOREWIZ_STATE m_pState;
  531. CWizard97PropertySheet* m_pParentSheet;
  532. };
  533. /////////////////////////////////////////
  534. // CRestoreWizPage5
  535. class CRestoreWizPage5 : public CWizard97PropertyPage
  536. {
  537. public:
  538. enum { IID_DEFAULT = IDD_RESTOREWIZ_COMPLETION };
  539. // Construction
  540. public:
  541. CRestoreWizPage5(PRESTOREWIZ_STATE pState, CWizard97PropertySheet *pcDlg, UINT uIDD = IID_DEFAULT);
  542. // Dialog Data
  543. // Overrides
  544. public:
  545. virtual BOOL OnInitDialog();
  546. virtual LRESULT OnWizardBack();
  547. virtual BOOL OnSetActive();
  548. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  549. // Implementation
  550. protected:
  551. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  552. public:
  553. PRESTOREWIZ_STATE m_pState;
  554. CWizard97PropertySheet* m_pParentSheet;
  555. };
  556. /////////////////////////////////////////
  557. // CViewAttrib
  558. class CViewAttrib : public CAutoDeletePropPage
  559. {
  560. enum { IID_DEFAULT = IDD_ATTR_PROPPAGE };
  561. public:
  562. CViewAttrib(UINT uIDD = IID_DEFAULT);
  563. // Dialog Data
  564. // Overrides
  565. public:
  566. virtual BOOL OnInitDialog();
  567. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  568. // Implementation
  569. protected:
  570. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  571. public:
  572. IEnumCERTVIEWATTRIBUTE* m_pAttr;
  573. };
  574. /////////////////////////////////////////
  575. // CViewExtn
  576. class CViewExtn : public CAutoDeletePropPage
  577. {
  578. enum { IID_DEFAULT = IDD_EXTN_PROPPAGE };
  579. public:
  580. CViewExtn(UINT uIDD = IID_DEFAULT);
  581. ~CViewExtn();
  582. // Dialog Data
  583. // Overrides
  584. public:
  585. virtual BOOL OnInitDialog();
  586. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  587. // Implementation
  588. protected:
  589. BOOL OnNotify(UINT idCtrl, NMHDR* pnmh);
  590. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  591. void OnReselectItem();
  592. public:
  593. IEnumCERTVIEWEXTENSION* m_pExtn;
  594. CArray<CString*, CString*> m_carrExtnValues;
  595. };
  596. /////////////////////////////////////////
  597. // CSvrSettingsCertManagersPage
  598. class CSvrSettingsCertManagersPage : public CAutoDeletePropPage, public CRolesSupportInPropPage
  599. {
  600. enum { IID_DEFAULT = IDD_CERTSRV_PROPPAGE6 };
  601. static RoleAccessToControl sm_ControlToRoleMap[];
  602. public:
  603. CSvrSettingsCertManagersPage(CSvrSettingsGeneralPage* pControlPage, UINT uIDD = IID_DEFAULT);
  604. ~CSvrSettingsCertManagersPage();
  605. // Dialog Data
  606. // Overrides
  607. public:
  608. virtual BOOL OnApply();
  609. virtual BOOL OnInitDialog();
  610. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  611. // Implementation
  612. protected:
  613. BOOL OnNotify(UINT idCtrl, NMHDR* pnmh);
  614. void OnDestroy();
  615. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  616. void OnAddSubject();
  617. void OnRemoveSubject();
  618. void OnOfficerListSelChange(DWORD dwIndexSelected);
  619. void OnAllowDeny();
  620. void OnEnableOfficers(bool fEnable);
  621. void OnOfficerChange();
  622. void SetDirty()
  623. {
  624. SendMessage (GetParent(), PSM_CHANGED, (WPARAM) m_hWnd, 0);
  625. m_fDirty = TRUE;
  626. }
  627. void ClearDirty() { m_fDirty = FALSE; }
  628. BOOL IsDirty() { return m_fDirty; }
  629. HRESULT BrowseForSubject(HWND hwnd, PSID &rpSid);
  630. HRESULT GetOfficerRights();
  631. HRESULT SetOfficerRights();
  632. HRESULT BuildVirtualOfficerRights();
  633. void FillOfficerList();
  634. void FillClientList(DWORD dwOfficerIndex);
  635. void SetAllowDeny();
  636. void EnableControls();
  637. DWORD GetCurrentOfficerIndex()
  638. {
  639. LRESULT lSel = SendMessage(
  640. GetDlgItem(m_hWnd, IDC_LIST_CERTMANAGERS),
  641. CB_GETCURSEL,
  642. 0,
  643. 0);
  644. return (CB_ERR == lSel) ? 0 : (DWORD)lSel;
  645. }
  646. DWORD GetCurrentClientIndex()
  647. {
  648. LRESULT lSel = ListView_GetNextItem(
  649. GetDlgItem(m_hWnd, IDC_LIST_SUBJECTS), -1, LVNI_SELECTED);
  650. return (-1==lSel) ? 0 : (DWORD)lSel;
  651. }
  652. CSvrSettingsGeneralPage* m_pControlPage;
  653. CertSrv::COfficerRightsList m_OfficerRightsList;
  654. BOOL m_fEnabled;
  655. BOOL m_fDirty;
  656. static CString m_strButtonAllow;
  657. static CString m_strButtonDeny;
  658. static CString m_strTextAllow;
  659. static CString m_strTextDeny;
  660. };
  661. /////////////////////////////////////////
  662. // CSvrSettingsAuditFilterPage
  663. class CSvrSettingsAuditFilterPage : public CAutoDeletePropPage, public CRolesSupportInPropPage
  664. {
  665. public:
  666. enum { IID_DEFAULT = IDD_CERTSRV_PROPPAGE7 };
  667. static RoleAccessToControl sm_ControlToRoleMap[];
  668. // Construction
  669. public:
  670. CSvrSettingsAuditFilterPage(CSvrSettingsGeneralPage* pControlPage, UINT uIDD = IID_DEFAULT);
  671. virtual ~CSvrSettingsAuditFilterPage();
  672. // Overrides
  673. public:
  674. virtual BOOL OnApply();
  675. virtual BOOL OnInitDialog();
  676. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  677. HRESULT GetAuditFilter();
  678. HRESULT SetAuditFilter();
  679. // Implementation
  680. protected:
  681. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  682. HRESULT GetAuditFilterDCOM();
  683. HRESULT GetAuditFilterRegistry();
  684. HRESULT SetAuditFilterDCOM();
  685. HRESULT SetAuditFilterRegistry();
  686. public:
  687. CSvrSettingsGeneralPage* m_pControlPage;
  688. private:
  689. BOOL m_fDirty;
  690. DWORD m_dwFilter;
  691. static int m_iCheckboxID[];
  692. };
  693. // Wizard pages
  694. DWORD PublishCRLWizard(CertSvrCA* pCertCA, HWND hwnd);
  695. DWORD CertAdminRevokeCert(CertSvrCA* pCertCA, ICertAdmin* pAdmin, LONG lReason, LPWSTR szCertSerNum);
  696. DWORD CertAdminResubmitRequest(CertSvrCA* pCertCA, ICertAdmin* pAdmin, LONG lRequestID);
  697. DWORD CertAdminDenyRequest(CertSvrCA* pCertCA, ICertAdmin* pAdmin, LONG lRequestID);
  698. DWORD CABackupWizard(CertSvrCA* pCertCA, HWND hwnd);
  699. DWORD CARestoreWizard(CertSvrCA* pCertCA, HWND hwnd);
  700. DWORD CARequestInstallHierarchyWizard(CertSvrCA* pCertCA, HWND hwnd, BOOL fRenewal, BOOL fAttemptRestart);
  701. // misc dialogs
  702. DWORD ModifyQueryFilter(HWND hwnd, CertViewRowEnum* pRowEnum, CComponentDataImpl* pCompData, int i);
  703. DWORD GetUserConfirmRevocationReason(LONG* plReasonCode, HWND hwnd);
  704. DWORD ViewRowAttributesExtensions(HWND hwnd, IEnumCERTVIEWATTRIBUTE* pAttr, IEnumCERTVIEWEXTENSION* pExtn, LPCWSTR szReqID);
  705. DWORD ViewRowRequestASN(HWND hwnd, LPCWSTR szTempFileName, PBYTE pbReq, DWORD cbReq, IN BOOL fSaveToFile);
  706. DWORD ChooseBinaryColumnToDump(IN HWND hwnd, IN CComponentDataImpl* pComp, OUT LPCWSTR* pcwszColumn, OUT BOOL* pfSaveToFileOnly);