Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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