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.

588 lines
14 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // DS Administration MMC snapin.
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 1999
  7. //
  8. // File: DSDlgs.h
  9. //
  10. // Contents: Definition for the DS Dialogs
  11. //
  12. // History: 03-Oct-96 WayneSc Created
  13. //
  14. //-----------------------------------------------------------------------------
  15. #ifndef __DSDLGS_H__
  16. #define __DSDLGS_H__
  17. #include "dcbufmgr.h"
  18. #include "uiutil.h"
  19. HRESULT GetDnsNameOfDomainOrForest(
  20. IN CString& csName,
  21. OUT CString& csDnsName,
  22. IN BOOL bIsInputADomainName,
  23. IN BOOL bRequireDomain
  24. );
  25. //+----------------------------------------------------------------------------
  26. //
  27. // Class: CPropDlg
  28. //
  29. // Purpose: Display the properties of a DS object.
  30. //
  31. //-----------------------------------------------------------------------------
  32. class CPropDlg
  33. {
  34. public:
  35. CPropDlg() {}
  36. ~CPropDlg() {}
  37. void SetTitle(CString* pstrTitle) {m_strTitle = *pstrTitle;}
  38. void SetTitle(LPTSTR szTitle) {m_strTitle = szTitle;}
  39. CString GetTitle(void) {return m_strTitle;}
  40. void SetUrl(CString* pstrUrl) {m_strUrl = *pstrUrl;}
  41. void SetUrl(LPTSTR szUrl) {m_strUrl = szUrl;}
  42. CString GetUrl(void) {return m_strUrl;}
  43. void DoModal(void) {CString strMsg = _T("The Url is ");
  44. strMsg += m_strUrl;
  45. CThemeContextActivator activator;
  46. MessageBox(NULL, strMsg, m_strTitle, MB_OK);}
  47. private:
  48. CString m_strTitle;
  49. CString m_strUrl;
  50. }; // CPropDlg
  51. /////////////////////////////////////////////////////////////////////////////
  52. class CChangePassword : public CHelpDialog
  53. {
  54. // Construction
  55. public:
  56. CChangePassword(CWnd* pParent = NULL); // standard constructor
  57. const EncryptedString& GetConfirm (void) const
  58. {
  59. return m_ConfirmPwd;
  60. }
  61. const EncryptedString& GetNew (void) const
  62. {
  63. return m_NewPwd;
  64. }
  65. BOOL GetChangePwd() const
  66. {
  67. return m_ChangePwd;
  68. }
  69. // NTRAID#NTBUG9-635046-2002/06/10-artm
  70. // Get the return value from the last call to encrypt
  71. // and store the values the user entered.
  72. HRESULT GetLastEncryptionResult() const
  73. {
  74. return m_LastEncryptionResult;
  75. }
  76. void Clear();
  77. void AllowMustChangePasswordCheck(BOOL bAllowCheck) { m_bAllowMustChangePwdCheck = bAllowCheck; }
  78. public:
  79. virtual BOOL OnInitDialog();
  80. virtual void DoContextHelp(HWND hWndControl);
  81. // Overrides
  82. // ClassWizard generated virtual function overrides
  83. //{{AFX_VIRTUAL(CChangePassword)
  84. protected:
  85. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  86. //}}AFX_VIRTUAL
  87. // Implementation
  88. protected:
  89. // Generated message map functions
  90. //{{AFX_MSG(CChangePassword)
  91. //}}AFX_MSG
  92. DECLARE_MESSAGE_MAP()
  93. private:
  94. BOOL m_bAllowMustChangePwdCheck;
  95. EncryptedString m_ConfirmPwd, m_NewPwd;
  96. HRESULT m_LastEncryptionResult;
  97. // Dialog Data
  98. //{{AFX_DATA(CChangePassword)
  99. enum { IDD = IDD_CHANGE_PASSWORD };
  100. BOOL m_ChangePwd;
  101. //}}AFX_DATA
  102. }; // CChangePassword
  103. /////////////////////////////////////////////////////////////////////////////
  104. // CChooseDomainDlg dialog
  105. class CChooseDomainDlg : public CHelpDialog
  106. {
  107. // Construction
  108. public:
  109. CChooseDomainDlg(CWnd* pParent = NULL); // standard constructor
  110. // Dialog Data
  111. //{{AFX_DATA(CChooseDomainDlg)
  112. enum { IDD = IDD_SELECT_DOMAIN };
  113. CString m_csTargetDomain;
  114. BOOL m_bSaveCurrent;
  115. //}}AFX_DATA
  116. BOOL m_bSiteRepl;
  117. virtual void DoContextHelp(HWND hWndControl);
  118. // Overrides
  119. // ClassWizard generated virtual function overrides
  120. //{{AFX_VIRTUAL(CChooseDomainDlg)
  121. protected:
  122. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  123. //}}AFX_VIRTUAL
  124. // Implementation
  125. protected:
  126. // Generated message map functions
  127. //{{AFX_MSG(CChooseDomainDlg)
  128. afx_msg void OnSelectdomainBrowse();
  129. virtual void OnOK();
  130. virtual BOOL OnInitDialog();
  131. //}}AFX_MSG
  132. DECLARE_MESSAGE_MAP()
  133. };
  134. /////////////////////////////////////////////////////////////////////////////
  135. // CChooseDCDlg dialog
  136. class CSelectDCEdit : public CEdit
  137. {
  138. public:
  139. BOOL m_bHandleKillFocus;
  140. inline CSelectDCEdit() { m_bHandleKillFocus = FALSE; }
  141. afx_msg void OnKillFocus(CWnd* pNewWnd);
  142. DECLARE_MESSAGE_MAP()
  143. };
  144. class CChooseDCDlg : public CHelpDialog
  145. {
  146. // Construction
  147. public:
  148. CChooseDCDlg(CWnd* pParent = NULL); // standard constructor
  149. ~CChooseDCDlg();
  150. // Dialog Data
  151. //{{AFX_DATA(CChooseDCDlg)
  152. enum { IDD = IDD_SELECT_DC };
  153. CListCtrl m_hDCListView;
  154. CString m_csTargetDomainController;
  155. CString m_csTargetDomain;
  156. //}}AFX_DATA
  157. CSelectDCEdit m_selectDCEdit;
  158. BOOL m_bSiteRepl;
  159. CString m_csPrevDomain;
  160. CDCBufferManager *m_pDCBufferManager;
  161. CString m_csAnyDC;
  162. CString m_csWaiting;
  163. CString m_csError;
  164. virtual void DoContextHelp(HWND hWndControl);
  165. // Overrides
  166. // ClassWizard generated virtual function overrides
  167. //{{AFX_VIRTUAL(CChooseDCDlg)
  168. protected:
  169. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  170. //}}AFX_VIRTUAL
  171. // Implementation
  172. protected:
  173. void OnGetDCThreadDone(WPARAM wParam, LPARAM lParam);
  174. void InsertSpecialMsg(
  175. IN BOOL bWaiting
  176. );
  177. HRESULT InsertDCListView(
  178. IN CDCSITEINFO *pEntry
  179. );
  180. void RefreshDCListViewErrorReport(
  181. IN PCTSTR pszDomainName,
  182. IN HRESULT hr
  183. );
  184. bool RefreshDCListView(); // JonN 9/05/01 464466
  185. void FreeDCItems(CListCtrl& clv);
  186. // Generated message map functions
  187. //{{AFX_MSG(CChooseDCDlg)
  188. virtual BOOL OnInitDialog();
  189. afx_msg void OnItemchangedSelectdcDCListView(NMHDR* pNMHDR, LRESULT* pResult);
  190. afx_msg void OnKillfocusSelectdcDomain();
  191. virtual void OnOK();
  192. virtual void OnCancel();
  193. afx_msg void OnSelectdcBrowse();
  194. afx_msg void OnColumnclickSelectdcDCListView(NMHDR* pNMHDR, LRESULT* pResult);
  195. //}}AFX_MSG
  196. DECLARE_MESSAGE_MAP()
  197. };
  198. /////////////////////////////////////////////////////////////////////////
  199. // CDsAdminChooseDCObj
  200. class CDsAdminChooseDCObj:
  201. public IDsAdminChooseDC,
  202. public CComObjectRoot,
  203. public CComCoClass<CDsAdminChooseDCObj, &CLSID_DsAdminChooseDCObj>
  204. {
  205. public:
  206. BEGIN_COM_MAP(CDsAdminChooseDCObj)
  207. COM_INTERFACE_ENTRY(IDsAdminChooseDC)
  208. END_COM_MAP()
  209. DECLARE_REGISTRY_CLSID()
  210. CDsAdminChooseDCObj()
  211. {
  212. }
  213. ~CDsAdminChooseDCObj()
  214. {
  215. }
  216. // IDsAdminChooseDC
  217. STDMETHOD(InvokeDialog)(/*IN*/ HWND hwndParent,
  218. /*IN*/ LPCWSTR lpszTargetDomain,
  219. /*IN*/ LPCWSTR lpszTargetDomainController,
  220. /*IN*/ ULONG uFlags,
  221. /*OUT*/ BSTR* bstrSelectedDC);
  222. };
  223. /////////////////////////////////////////////////////////////////////////////
  224. // CRenameUser dialog
  225. class CRenameUserDlg : public CHelpDialog
  226. {
  227. // Construction
  228. public:
  229. CRenameUserDlg(CDSComponentData* pComponentData, CWnd* pParent = NULL); // standard constructor
  230. // Dialog Data
  231. //{{AFX_DATA(CRenameUserDlg)
  232. enum { IDD = IDD_RENAME_USER };
  233. CString m_cn;
  234. CString m_displayname;
  235. CString m_oldcn;
  236. CString m_login;
  237. CString m_samaccountname;
  238. CString m_domain;
  239. CString m_dldomain;
  240. CStringList m_domains;
  241. CString m_first;
  242. CString m_last;
  243. //}}AFX_DATA
  244. // Overrides
  245. virtual void DoContextHelp(HWND hWndControl);
  246. afx_msg void OnObjectNameChange();
  247. afx_msg void OnNameChange();
  248. afx_msg void OnUserNameChange();
  249. // ClassWizard generated virtual function overrides
  250. //{{AFX_VIRTUAL(CRenameUserDlg)
  251. protected:
  252. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  253. //}}AFX_VIRTUAL
  254. // Implementation
  255. protected:
  256. CUserNameFormatter m_nameFormatter; // name ordering for given name and surname
  257. // Generated message map functions
  258. //{{AFX_MSG(CRenameUserDlg)
  259. virtual BOOL OnInitDialog();
  260. //}}AFX_MSG
  261. DECLARE_MESSAGE_MAP()
  262. private:
  263. void UpdateComboBoxDropWidth(CComboBox* comboBox);
  264. CDSComponentData* m_pComponentData;
  265. };
  266. /////////////////////////////////////////////////////////////////////////////
  267. // CRenameGeneric dialog
  268. class CRenameGenericDlg : public CHelpDialog
  269. {
  270. // Construction
  271. public:
  272. CRenameGenericDlg(CWnd* pParent = NULL); // standard constructor
  273. // Dialog Data
  274. //{{AFX_DATA(CRenameGenericDlg)
  275. enum { IDD = IDD_RENAME_GENERIC };
  276. CString m_cn;
  277. //}}AFX_DATA
  278. // Overrides
  279. virtual void DoContextHelp(HWND hWndControl);
  280. // ClassWizard generated virtual function overrides
  281. //{{AFX_VIRTUAL(CRenameGenericDlg)
  282. protected:
  283. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  284. //}}AFX_VIRTUAL
  285. // Implementation
  286. protected:
  287. // Generated message map functions
  288. //{{AFX_MSG(CRenameGenericDlg)
  289. virtual BOOL OnInitDialog();
  290. //}}AFX_MSG
  291. DECLARE_MESSAGE_MAP()
  292. };
  293. /////////////////////////////////////////////////////////////////////////////
  294. // CRenameGroup dialog
  295. class CRenameGroupDlg : public CHelpDialog
  296. {
  297. // Construction
  298. public:
  299. CRenameGroupDlg(CWnd* pParent = NULL); // standard constructor
  300. // Dialog Data
  301. //{{AFX_DATA(CRenameGroupDlg)
  302. enum { IDD = IDD_RENAME_GROUP };
  303. CString m_samaccountname;
  304. CString m_cn;
  305. UINT m_samtextlimit;
  306. //}}AFX_DATA
  307. // Overrides
  308. virtual void DoContextHelp(HWND hWndControl);
  309. // ClassWizard generated virtual function overrides
  310. //{{AFX_VIRTUAL(CRenameGroupDlg)
  311. protected:
  312. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  313. //}}AFX_VIRTUAL
  314. // Implementation
  315. protected:
  316. // Generated message map functions
  317. //{{AFX_MSG(CRenameGroupDlg)
  318. virtual BOOL OnInitDialog();
  319. //}}AFX_MSG
  320. DECLARE_MESSAGE_MAP()
  321. };
  322. /////////////////////////////////////////////////////////////////////////////
  323. // CRenameContact dialog
  324. class CRenameContactDlg : public CHelpDialog
  325. {
  326. // Construction
  327. public:
  328. CRenameContactDlg(CWnd* pParent = NULL); // standard constructor
  329. // Dialog Data
  330. //{{AFX_DATA(CRenameContactDlg)
  331. enum { IDD = IDD_RENAME_CONTACT };
  332. CString m_cn;
  333. CString m_first;
  334. CString m_last;
  335. CString m_disp;
  336. //}}AFX_DATA
  337. // Overrides
  338. virtual void DoContextHelp(HWND hWndControl);
  339. // ClassWizard generated virtual function overrides
  340. //{{AFX_VIRTUAL(CRenameContactDlg)
  341. protected:
  342. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  343. //}}AFX_VIRTUAL
  344. // Implementation
  345. protected:
  346. // Generated message map functions
  347. //{{AFX_MSG(CRenameContactDlg)
  348. virtual BOOL OnInitDialog();
  349. //}}AFX_MSG
  350. DECLARE_MESSAGE_MAP()
  351. };
  352. /////////////////////////////////////////////////////////////////////////////
  353. // CSpecialMessageBox dialog
  354. class CSpecialMessageBox : public CDialog
  355. {
  356. // Construction
  357. public:
  358. CSpecialMessageBox(CWnd* pParent = NULL); // standard constructor
  359. // Dialog Data
  360. //{{AFX_DATA(CSpecialMessageBox)
  361. enum { IDD = IDD_MULTIPLE_ERROR };
  362. CString m_title;
  363. CString m_message;
  364. //}}AFX_DATA
  365. // Overrides
  366. afx_msg void OnHelpInfo(HELPINFO* lpHelpInfo );
  367. // ClassWizard generated virtual function overrides
  368. //{{AFX_VIRTUAL(CSpecialMessageBox)
  369. protected:
  370. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  371. //}}AFX_VIRTUAL
  372. // Implementation
  373. protected:
  374. // Generated message map functions
  375. //{{AFX_MSG(CSpecialMessageBox)
  376. virtual BOOL OnInitDialog();
  377. afx_msg void OnYesButton();
  378. afx_msg void OnNoButton();
  379. afx_msg void OnYesToAllButton();
  380. //}}AFX_MSG
  381. DECLARE_MESSAGE_MAP()
  382. };
  383. #ifdef FIXUPDC
  384. /////////////////////////////////////////////////////////////////////////////
  385. // CFixupDC dialog
  386. #define NUM_FIXUP_OPTIONS 6
  387. typedef struct _FixupOptionsMsg {
  388. DWORD dwOption;
  389. int nMsgID;
  390. BOOL bDefaultOn;
  391. } FixupOptionsMsg;
  392. class CFixupDC : public CHelpDialog
  393. {
  394. // Construction
  395. public:
  396. CFixupDC(CWnd* pParent = NULL); // standard constructor
  397. // Dialog Data
  398. //{{AFX_DATA(CFixupDC)
  399. enum { IDD = IDD_FIXUP_DC };
  400. CString m_strServer;
  401. //}}AFX_DATA
  402. BOOL m_bCheck[NUM_FIXUP_OPTIONS];
  403. // Overrides
  404. virtual void DoContextHelp(HWND hWndControl);
  405. // ClassWizard generated virtual function overrides
  406. //{{AFX_VIRTUAL(CFixupDC)
  407. protected:
  408. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  409. //}}AFX_VIRTUAL
  410. // Implementation
  411. protected:
  412. // Generated message map functions
  413. //{{AFX_MSG(CFixupDC)
  414. virtual BOOL OnInitDialog();
  415. virtual void OnOK();
  416. //}}AFX_MSG
  417. DECLARE_MESSAGE_MAP()
  418. };
  419. #endif // FIXUPDC
  420. /////////////////////////////////////////////////////////////////////////////
  421. // CPasswordDlg dialog
  422. #ifdef FIXUPDC
  423. // NOTICE-2002/04/12-artm
  424. // When I was converting this class to use encrypted strings I noticed that
  425. // it had no validation code to check that the length of the password <=
  426. // MAX_PASSWORD_LENGTH.
  427. //
  428. // Further investigation revealed that the class is only used in code that is
  429. // conditionally compiled in dssite.cpp, and in fact may never be compiled (b/c
  430. // it needs work and the feature might not ever be released).
  431. //
  432. // Rather than spend unnecessary time understanding and fixing this I've
  433. // used the same #ifdef to conditionally include it as the code that uses it.
  434. //
  435. // IF YOU NEED TO USE THIS class make sure you add password length validation
  436. // code!
  437. class CPasswordDlg : public CHelpDialog
  438. {
  439. // Construction
  440. public:
  441. CPasswordDlg(CWnd* pParent = NULL); // standard constructor
  442. // Overrides
  443. virtual void DoContextHelp(HWND hWndControl);
  444. // Accessor methods.
  445. const EncryptedString& GetPassword(void) const
  446. {
  447. return m_password;
  448. }
  449. CString GetUserName(void) const
  450. {
  451. return m_strUserName;
  452. }
  453. // ClassWizard generated virtual function overrides
  454. //{{AFX_VIRTUAL(CPasswordDlg)
  455. protected:
  456. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  457. //}}AFX_VIRTUAL
  458. // Implementation
  459. protected:
  460. // Generated message map functions
  461. //{{AFX_MSG(CPasswordDlg)
  462. virtual void OnOK();
  463. //}}AFX_MSG
  464. DECLARE_MESSAGE_MAP()
  465. private:
  466. // Dialog Data
  467. EncryptedString m_password;
  468. //{{AFX_DATA(CPasswordDlg)
  469. enum { IDD = IDD_PASSWORD };
  470. CString m_strUserName;
  471. //}}AFX_DATA
  472. };
  473. #endif //FIXUPDC
  474. #endif //__DSDLGS_H__