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.

732 lines
29 KiB

  1. // wizards.cpp : Defines the initialization routines for the DLL.
  2. //
  3. #include "stdafx.h"
  4. #include "wizards.h"
  5. #include <MigrationMutex.h>
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. IVarSet * pVarSet;
  12. IVarSet * pVarSetUndo;
  13. IVarSet * pVarSetService;
  14. IIManageDB * db;
  15. UINT g_cfDsObjectPicker;
  16. IDsObjectPicker *pDsObjectPicker;
  17. IDataObject *pdo;
  18. IDsObjectPicker *pDsObjectPicker2;
  19. IDataObject *pdo2;
  20. int migration;
  21. CEdit pEdit;
  22. CComModule _Module;
  23. CListCtrl m_listBox;
  24. CListCtrl m_cancelBox;
  25. CListCtrl m_reportingBox;
  26. CListCtrl m_serviceBox;
  27. CComboBox m_rebootBox;
  28. CString sourceNetbios;
  29. CString targetNetbios;
  30. CListCtrl m_trustBox;
  31. CString sourceDNS;
  32. CString targetDNS;
  33. CComboBox sourceDrop;
  34. CComboBox additionalDrop;
  35. CComboBox targetDrop;
  36. StringLoader gString;
  37. TErrorDct err;
  38. TError & errCommon = err;
  39. bool alreadyRefreshed;
  40. DSBROWSEFORCONTAINER DsBrowseForContainerX;
  41. BOOL gbNeedToVerify=FALSE;
  42. _bstr_t yes,no;
  43. CString lastInitializedTo;
  44. bool clearCredentialsName;
  45. CString sourceDC;
  46. CStringList DCList;
  47. CMapStringToString PropIncMap1;
  48. CMapStringToString PropExcMap1;
  49. CMapStringToString PropIncMap2;
  50. CMapStringToString PropExcMap2;
  51. CString sType1;
  52. bool bChangedMigrationTypes;
  53. bool bChangeOnFly;
  54. CString targetServer;
  55. HWND s_hParentWindow;
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CWizardsApp
  58. BEGIN_MESSAGE_MAP(CWizardsApp, CWinApp)
  59. //{{AFX_MSG_MAP(CWizardsApp)
  60. // NOTE - the ClassWizard will add and remove mapping macros here.
  61. // DO NOT EDIT what you see in these blocks of generated code!
  62. //}}AFX_MSG_MAP
  63. END_MESSAGE_MAP()
  64. /////////////////////////////////////////////////////////////////////////////
  65. // CWizardsApp construction
  66. CWizardsApp::CWizardsApp()
  67. {
  68. // TODO: add construction code here,
  69. // Place all significant initialization in InitInstance
  70. }
  71. // Forward decleration for this function
  72. HRESULT BrowseForContainer(HWND hWnd,//Handle to window that should own the browse dialog.
  73. LPOLESTR szRootPath, //Root of the browse tree. NULL for entire forest.
  74. LPOLESTR *ppContainerADsPath, //Return the ADsPath of the selected container.
  75. LPOLESTR *ppContainerClass //Return the ldapDisplayName of the container's class.
  76. );
  77. /////////////////////////////////////////////////////////////////////////////
  78. // The one and only CWizardsApp object
  79. CWizardsApp theApp;
  80. /////////////////////////////////////////////////////////////////////////////
  81. // CDeletemeApp initialization
  82. BOOL CWizardsApp::InitInstance()
  83. {
  84. ATLTRACE(_T("{wizards.dll}CWizardsApp::InitInstance() : m_hInstance=0x%08X\n"), m_hInstance);
  85. BOOL bInit = CWinApp::InitInstance();
  86. _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF);
  87. return bInit;
  88. }
  89. int CWizardsApp::ExitInstance()
  90. {
  91. ATLTRACE(_T("{wizards.dll}CWizardsApp::ExitInstance() : m_hInstance=0x%08X\n"), m_hInstance);
  92. return CWinApp::ExitInstance();
  93. }
  94. //extern "C" __declspec(dllexport) int runWizard(int whichWizard, HWND hParentWindow)
  95. int LocalRunWizard(int whichWizard, HWND hParentWindow)
  96. {
  97. //declare variables
  98. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  99. CMigrationMutex mutexMigration(ADMT_MUTEX);
  100. if (mutexMigration.ObtainOwnership(0) == false)
  101. {
  102. CString strCaption;
  103. strCaption.LoadString(IDS_APP_CAPTION);
  104. CString strMessage;
  105. strMessage.LoadString(IDS_MIGRATION_RUNNING);
  106. CWnd* pWnd = theApp.GetMainWnd();
  107. if (pWnd)
  108. {
  109. pWnd->MessageBox(strMessage, strCaption);
  110. }
  111. else
  112. {
  113. MessageBox(NULL, strMessage, strCaption, MB_OK);
  114. }
  115. GetError(0);
  116. return 0;
  117. }
  118. int result=0;
  119. yes=GET_BSTR(IDS_YES);no=GET_BSTR(IDS_No);
  120. migration =whichWizard;
  121. gbNeedToVerify = CanSkipVerification();
  122. //migration varset
  123. IVarSetPtr pVs(__uuidof(VarSet));
  124. HRESULT hr = pVs->QueryInterface(IID_IVarSet, (void**) &pVarSet);
  125. //undo varset
  126. IVarSetPtr pVs2(__uuidof(VarSet));
  127. hr = pVs2->QueryInterface(IID_IVarSet, (void**) &pVarSetUndo);
  128. IVarSetPtr pVs4(__uuidof(VarSet));
  129. hr = pVs4->QueryInterface(IID_IVarSet, (void**) &pVarSetService);
  130. //database
  131. IIManageDBPtr pDb;
  132. hr = pDb.CreateInstance(__uuidof(IManageDB));
  133. if (FAILED(hr))
  134. {
  135. return 0;
  136. }
  137. hr = pDb->QueryInterface(IID_IIManageDB, (void**) &db);
  138. IUnknown * pUnk;
  139. if (migration!=w_undo)
  140. pVarSet->QueryInterface(IID_IUnknown, (void**) &pUnk);
  141. else
  142. pVarSetUndo->QueryInterface(IID_IUnknown, (void**) &pUnk);
  143. db->GetSettings(&pUnk);
  144. pUnk->Release();
  145. if (migration!= w_undo)
  146. {
  147. IVarSetPtr leaves;
  148. hr=pVarSet->raw_getReference(L"Accounts",&leaves);
  149. if (SUCCEEDED(hr))
  150. leaves->Clear();
  151. hr = pVarSet->raw_getReference(L"Servers",&leaves);
  152. if (SUCCEEDED(hr))
  153. leaves->Clear();
  154. g_cfDsObjectPicker = RegisterClipboardFormat(CFSTR_DSOP_DS_SELECTION_LIST);
  155. pDsObjectPicker = NULL;
  156. pdo = NULL;
  157. hr = CoCreateInstance(CLSID_DsObjectPicker,NULL,CLSCTX_INPROC_SERVER,IID_IDsObjectPicker,(void **) &pDsObjectPicker);
  158. sourceNetbios = L"";
  159. targetNetbios = L"";
  160. sourceDNS = L"";
  161. targetDNS = L"";
  162. if (FAILED(hr)) return 0;
  163. }
  164. if (migration==w_groupmapping)
  165. {
  166. pDsObjectPicker2 = NULL;
  167. pdo2 = NULL;
  168. hr = CoCreateInstance(CLSID_DsObjectPicker,NULL,CLSCTX_INPROC_SERVER,IID_IDsObjectPicker,(void **) &pDsObjectPicker2);
  169. if (FAILED(hr)) return 0;
  170. }
  171. s_hParentWindow = hParentWindow;
  172. switch (whichWizard)
  173. {
  174. case w_account:
  175. result =doAccount();
  176. break;
  177. case w_group:
  178. result =doGroup();
  179. break;
  180. case w_computer:
  181. result =doComputer();
  182. break;
  183. case w_security:
  184. result =doSecurity();
  185. break;
  186. case w_service:
  187. result =doService();
  188. break;
  189. case w_exchangeDir:
  190. result =doExchangeDir();
  191. break;
  192. case w_exchangeSrv:
  193. result =doExchangeSrv();
  194. break;
  195. case w_reporting:
  196. result =doReporting();
  197. break;
  198. case w_undo:
  199. result =doUndo();
  200. break;
  201. case w_retry:
  202. result =doRetry();
  203. break;
  204. case w_trust:
  205. result =doTrust();
  206. break;
  207. case w_groupmapping:
  208. result =doGroupMapping();
  209. break;
  210. }
  211. s_hParentWindow = 0;
  212. m_listBox.Detach();
  213. m_trustBox.Detach();
  214. m_reportingBox.Detach();
  215. m_cancelBox.Detach();
  216. m_serviceBox.Detach();
  217. sourceDrop.Detach();
  218. additionalDrop.Detach();
  219. targetDrop.Detach();
  220. m_rebootBox.Detach();
  221. if (pDsObjectPicker2)
  222. {
  223. pDsObjectPicker2->Release();
  224. pDsObjectPicker2 = NULL;
  225. }
  226. if (pDsObjectPicker)
  227. {
  228. pDsObjectPicker->Release();
  229. pDsObjectPicker = NULL;
  230. }
  231. if (pVarSet)
  232. {
  233. pVarSet->Release();
  234. pVarSet = NULL;
  235. }
  236. if (pVarSetService)
  237. {
  238. pVarSetService->Release();
  239. pVarSetService = NULL;
  240. }
  241. if (pVarSetUndo)
  242. {
  243. pVarSetUndo->Release();
  244. pVarSetUndo = NULL;
  245. }
  246. if (db)
  247. {
  248. db->Release();
  249. db = NULL;
  250. }
  251. mutexMigration.ReleaseOwnership();
  252. return result;
  253. }
  254. extern "C" __declspec(dllexport) int runWizard(int whichWizard, HWND hParentWindow)
  255. {
  256. return LocalRunWizard(whichWizard, hParentWindow);
  257. }
  258. void setpdatavars(SHAREDWIZDATA& wizdata,LOGFONT& TitleLogFont)
  259. {
  260. WCHAR filename[500];
  261. BOOL yo = GetDirectory(filename);
  262. CString temp=filename;
  263. CString temp2 =filename;
  264. put(DCTVS_Options_MaxThreads, L"20");
  265. put(DCTVS_Options_DispatchLog, _bstr_t(temp+L"Logs\\dispatch.log"));
  266. put(DCTVS_Options_Logfile, _bstr_t(temp+L"Logs\\Migration.log"));
  267. pVarSet->put(L"PlugIn.0",L"");
  268. put(DCTVS_Options_AppendToLogs,yes);
  269. put(DCTVS_Reports_Generate,no);
  270. wizdata.hTitleFont = CreateFontIndirect(&TitleLogFont);
  271. wizdata.renameSwitch=1;
  272. wizdata.refreshing = false;
  273. wizdata.prefixorsuffix =false;
  274. wizdata.expireSwitch =false;
  275. wizdata.someService =false;
  276. alreadyRefreshed = false;
  277. wizdata.memberSwitch =false;
  278. wizdata.proceed=false;
  279. for (int i =0;i<6;i++)wizdata.sort[i]=true;
  280. wizdata.sourceIsNT4=true;
  281. wizdata.secWithMapFile=false;
  282. bChangedMigrationTypes=false;
  283. bChangeOnFly = false;
  284. //make sure we don't hide the progress dialogs if set by scripting
  285. put(DCTVS_Options_AutoCloseHideDialogs, L"0");
  286. put(DCTVS_Options_DontBeginNewLog, no);//always start a new log
  287. //don't use any specific server yet
  288. put(DCTVS_Options_TargetServerOverride, L"");
  289. switch (migration)
  290. {
  291. case w_account:
  292. put(DCTVS_AccountOptions_CopyUsers, yes);
  293. put(DCTVS_AccountOptions_CopyLocalGroups, no);
  294. put(DCTVS_AccountOptions_CopyComputers, no);
  295. put(DCTVS_AccountOptions_CopyContainerContents, no);
  296. put(DCTVS_Security_TranslateContainers, L"");
  297. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_USER));
  298. put(DCTVS_Options_Wizard, L"user");
  299. put(DCTVS_AccountOptions_FixMembership, yes);
  300. // put(DCTVS_AccountOptions_MoveReplacedAccounts, no);
  301. break;
  302. case w_group:
  303. put(DCTVS_AccountOptions_CopyLocalGroups, yes);
  304. put(DCTVS_AccountOptions_CopyComputers, no);
  305. put(DCTVS_AccountOptions_CopyMemberOf,no);
  306. put(DCTVS_Security_TranslateContainers, L"");
  307. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_GROUP));
  308. put(DCTVS_Options_Wizard, L"group");
  309. put(DCTVS_AccountOptions_FixMembership, yes);
  310. break;
  311. case w_computer:
  312. put(DCTVS_AccountOptions_CopyUsers, no);
  313. put(DCTVS_AccountOptions_CopyLocalGroups, no);
  314. put(DCTVS_AccountOptions_CopyComputers, yes);
  315. put(DCTVS_Security_TranslateContainers, L"");
  316. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_COMPUTER));
  317. put(DCTVS_Options_Wizard, L"computer");
  318. put(DCTVS_AccountOptions_AddSidHistory,L"");
  319. put(DCTVS_AccountOptions_CopyContainerContents, no);
  320. put(DCTVS_AccountOptions_CopyMemberOf, no);
  321. put(DCTVS_AccountOptions_CopyLocalGroups, no);
  322. put(DCTVS_AccountOptions_FixMembership, yes);
  323. break;
  324. case w_security:
  325. put(DCTVS_AccountOptions_CopyUsers, no);
  326. put(DCTVS_AccountOptions_CopyLocalGroups, no);
  327. put(DCTVS_AccountOptions_CopyComputers, no);
  328. put(DCTVS_Security_TranslateContainers, L"");
  329. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_SECURITY));
  330. put(DCTVS_Options_Wizard, L"security");
  331. pVarSet->put(L"PlugIn.0",L"None");
  332. put(DCTVS_AccountOptions_AddSidHistory,L"");
  333. put(DCTVS_AccountOptions_SecurityInputMOT, yes);
  334. break;
  335. case w_undo:
  336. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_UNDO));
  337. put(DCTVS_Options_Wizard, L"undo");
  338. put(DCTVS_Security_TranslateContainers, L"");
  339. break;
  340. case w_retry:
  341. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_RETRY));
  342. put(DCTVS_Options_Wizard, L"retry");
  343. put(DCTVS_Security_TranslateContainers, L"");
  344. break;
  345. case w_reporting:
  346. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_REPORTING));
  347. put(DCTVS_Options_Wizard, L"reporting");
  348. put(DCTVS_GatherInformation, yes);
  349. put(DCTVS_Security_TranslateContainers, L"");
  350. pVarSet->put(L"PlugIn.0",L"None");
  351. break;
  352. case w_service:
  353. {
  354. _bstr_t t= get(DCTVS_AccountOptions_PasswordFile);
  355. CString yo=(WCHAR *) t;
  356. yo.TrimLeft();yo.TrimRight();
  357. if (yo.IsEmpty())
  358. {
  359. CString toinsert;
  360. GetDirectory(toinsert.GetBuffer(1000));
  361. toinsert.ReleaseBuffer();
  362. toinsert+="Logs\\passwords.txt";
  363. put(DCTVS_AccountOptions_PasswordFile,_bstr_t(toinsert));
  364. }
  365. put(DCTVS_Security_TranslateContainers, L"");
  366. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_SERVICE));
  367. put(DCTVS_Options_Wizard, L"service");
  368. break;
  369. }
  370. case w_exchangeDir:
  371. put(DCTVS_AccountOptions_AddSidHistory,L"");
  372. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_EXCHANGEDIR));
  373. put(DCTVS_Options_Wizard, L"exchangeDir");
  374. break;
  375. case w_exchangeSrv:
  376. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_EXCHANGESRV));
  377. put(DCTVS_Options_Wizard, L"exchangeDrv");
  378. break;
  379. case w_trust:
  380. put(DCTVS_Security_TranslateContainers, L"");
  381. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_TRUST));
  382. put(DCTVS_Options_Wizard, L"trust");
  383. break;
  384. case w_groupmapping:
  385. //* put(DCTVS_Options_Wizard, GET_BSTR1(IDS_WIZARD_GROUPMAPPING));
  386. put(DCTVS_Options_Wizard, L"groupmapping");
  387. put(DCTVS_AccountOptions_ReplaceExistingAccounts, yes);
  388. put(DCTVS_AccountOptions_CopyContainerContents, no);
  389. put(DCTVS_AccountOptions_CopyUsers, no);
  390. put(DCTVS_AccountOptions_CopyLocalGroups, yes);
  391. put(DCTVS_AccountOptions_CopyComputers, L"");
  392. put(DCTVS_AccountOptions_ReplaceExistingGroupMembers, no);
  393. put(DCTVS_Security_TranslateContainers, L"");
  394. put(DCTVS_AccountOptions_FixMembership, yes);
  395. break;
  396. }
  397. }
  398. void intropage(HPROPSHEETPAGE ahpsp[],PROPSHEETPAGE& psp,int dialog,
  399. int pagenum,SHAREDWIZDATA& wizdata,int dialogtitle,DLGPROC p)
  400. {
  401. psp.dwSize = sizeof(psp);
  402. psp.dwFlags = PSP_DEFAULT|PSP_HIDEHEADER|PSP_USETITLE |PSP_HASHELP;
  403. psp.hInstance = AfxGetInstanceHandle();
  404. psp.lParam = (LPARAM) &wizdata;
  405. psp.pszTitle = MAKEINTRESOURCE(dialogtitle);
  406. psp.pszTemplate = MAKEINTRESOURCE(dialog);
  407. psp.pfnDlgProc = p;
  408. ahpsp[pagenum] = CreatePropertySheetPage(&psp);
  409. }
  410. void definepage(HPROPSHEETPAGE ahpsp[],PROPSHEETPAGE& psp,int title,int subtitle,int dialog,
  411. int pagenum,int dialogtitle,DLGPROC p)
  412. {
  413. psp.dwFlags = PSP_DEFAULT|PSP_USEHEADERTITLE|PSP_USEHEADERSUBTITLE|PSP_USETITLE|PSP_HASHELP;
  414. psp.pszTitle = MAKEINTRESOURCE(dialogtitle);
  415. psp.pszHeaderTitle = MAKEINTRESOURCE(title);
  416. psp.pszHeaderSubTitle = MAKEINTRESOURCE(subtitle);
  417. psp.pszTemplate = MAKEINTRESOURCE(dialog);
  418. psp.pfnDlgProc = p;
  419. ahpsp[pagenum] = CreatePropertySheetPage(&psp);
  420. }
  421. void endpage(HPROPSHEETPAGE ahpsp[],PROPSHEETPAGE& psp,int dialog,int pagenum,int dialogtitle,DLGPROC p)
  422. {
  423. psp.dwFlags = PSP_DEFAULT|PSP_HIDEHEADER|PSP_USETITLE|PSP_HASHELP;
  424. psp.pszTitle = MAKEINTRESOURCE(dialogtitle);
  425. psp.pszTemplate = MAKEINTRESOURCE(dialog);
  426. psp.pfnDlgProc = p;
  427. ahpsp[pagenum] = CreatePropertySheetPage(&psp);
  428. }
  429. int defineSheet(HPROPSHEETPAGE ahpsp[],PROPSHEETHEADER& psh,int numpages,SHAREDWIZDATA& wizdata
  430. ,int headerGraphic,int waterGraphic)
  431. {
  432. psh.dwSize = sizeof(psh);
  433. psh.hInstance = AfxGetInstanceHandle();
  434. psh.hwndParent = s_hParentWindow;
  435. psh.phpage = ahpsp;
  436. psh.dwFlags = REAL_PSH_WIZARD97|PSH_WATERMARK|PSH_HEADER;
  437. psh.pszbmWatermark = MAKEINTRESOURCE(waterGraphic);
  438. psh.pszbmHeader = MAKEINTRESOURCE(headerGraphic);
  439. psh.nStartPage = 0;
  440. psh.nPages = numpages;
  441. NONCLIENTMETRICS ncm = {0};
  442. ncm.cbSize = sizeof(ncm);
  443. SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
  444. LOGFONT TitleLogFont = ncm.lfMessageFont;
  445. TitleLogFont.lfWeight = FW_BOLD;
  446. CString s;
  447. s.LoadString(IDS_TEXT);
  448. lstrcpy(TitleLogFont.lfFaceName, s.GetBuffer(1000));
  449. s.ReleaseBuffer();
  450. HDC hdc = GetDC(NULL); //gets the screen DC
  451. INT FontSize = 12;
  452. TitleLogFont.lfHeight = 0 - GetDeviceCaps(hdc, LOGPIXELSY) * FontSize / 72;
  453. setpdatavars(wizdata,TitleLogFont);
  454. ReleaseDC(NULL, hdc);
  455. // int a=PropertySheet(&psh);
  456. int a=(int)PropertySheet(&psh);
  457. DeleteObject(wizdata.hTitleFont);
  458. return a;
  459. }
  460. int doTrust()
  461. {
  462. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  463. HPROPSHEETPAGE ahpsp[4] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  464. PROPSHEETHEADER psh = {0}; //defines the property sheet
  465. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  466. intropage(ahpsp,psp,IDD_INTRO_TRUST,0,wizdata,IDS_TRUST_TITLE,IntroDlgProc);
  467. definepage(ahpsp,psp,IDS_DOMAIN,IDS_TRUST_DOMAIN,IDD_DOMAIN_SELECTION,1,IDS_TRUST_TITLE,IntDomainSelectionProc);
  468. definepage(ahpsp,psp,IDS_TRUST,IDS_TRUST_SUB,IDD_TRUST_INFO,2,IDS_TRUST_TITLE, IntTrustProc);
  469. endpage(ahpsp,psp,IDD_END_TRUST,3,IDS_TRUST_TITLE, EndDlgProc);
  470. int result = defineSheet(ahpsp,psh,4,wizdata,IDB_HEADER_KEY,IDB_WATERMARK_SECURITY);
  471. return result;
  472. }
  473. int doGroupMapping()
  474. {
  475. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  476. HPROPSHEETPAGE ahpsp[9] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  477. PROPSHEETHEADER psh = {0}; //defines the property sheet
  478. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  479. intropage(ahpsp,psp,IDD_INTRO_GROUPMAPPING,0,wizdata,IDS_GROUPMAPPING_TITLE,IntroDlgProc);
  480. definepage(ahpsp,psp,IDS_COMMIT,IDS_COMMIT_SUB,IDD_COMMIT,1,IDS_GROUPMAPPING_TITLE,IntCommitProc);
  481. definepage(ahpsp,psp,IDS_DOMAIN,IDS_DOMAIN_SUB,IDD_DOMAIN_SELECTION,2,IDS_GROUPMAPPING_TITLE,IntDomainSelectionProc);
  482. definepage(ahpsp,psp,IDS_GROUP_MAPPING,IDS_GROUP_MAPPING_SUB,IDD_SELECTION2,3,IDS_GROUPMAPPING_TITLE,IntSelectionProc);
  483. definepage(ahpsp,psp,IDS_TARGET_GROUP,IDS_TARGET_GROUP_SUB,IDD_TARGET_GROUP,4,IDS_GROUPMAPPING_TITLE,IntTargetGroupProc);
  484. definepage(ahpsp,psp,IDS_OU_SELECTION,IDS_OU_SELECTION_SUB,IDD_OU_SELECTION,5,IDS_GROUPMAPPING_TITLE,IntOuSelectionProc);
  485. definepage(ahpsp,psp,IDS_OPTIONS_GROUP,IDS_OPTIONS_GROUPMAPPING_SUB,IDD_OPTIONS_GROUPMAPPING,6,IDS_GROUPMAPPING_TITLE,IntOptionsGroupMappingProc);
  486. definepage(ahpsp,psp,IDS_CREDENTIALS_ACCOUNT,IDS_CREDENTIALS_SUB,IDD_CREDENTIALS,7,IDS_GROUPMAPPING_TITLE,IntCredentialsProc);
  487. endpage(ahpsp,psp,IDD_END_GROUPMAPPING,8,IDS_GROUPMAPPING_TITLE, EndDlgProc);
  488. int result = defineSheet(ahpsp,psh,9,wizdata,IDB_HEADER_KEY,IDB_WATERMARK_GROUP);
  489. return result;
  490. }
  491. int doAccount()
  492. {
  493. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  494. HPROPSHEETPAGE ahpsp[13] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  495. PROPSHEETHEADER psh = {0}; //defines the property sheet
  496. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  497. intropage(ahpsp,psp,IDD_INTRO_ACCOUNT,0,wizdata,IDS_ACCOUNT_TITLE,IntroDlgProc);
  498. definepage(ahpsp,psp,IDS_COMMIT,IDS_COMMIT_SUB,IDD_COMMIT,1,IDS_ACCOUNT_TITLE,IntCommitProc);
  499. definepage(ahpsp,psp,IDS_DOMAIN,IDS_DOMAIN_ACCOUNT,IDD_DOMAIN_SELECTION,2,IDS_ACCOUNT_TITLE,IntDomainSelectionProc);
  500. definepage(ahpsp,psp,IDS_ACCOUNT,IDS_ACCOUNT_SUB,IDD_SELECTION3,3,IDS_ACCOUNT_TITLE,IntSelectionProc);
  501. definepage(ahpsp,psp,IDS_OU_SELECTION,IDS_OU_SELECTION_SUB,IDD_OU_SELECTION,4,IDS_ACCOUNT_TITLE,IntOuSelectionProc);
  502. definepage(ahpsp,psp,IDS_PASSWORD,IDS_PASSWORD_SUB,IDD_PASSWORD,5,IDS_ACCOUNT_TITLE,IntPasswordProc);
  503. definepage(ahpsp,psp,IDS_DISABLE,IDS_DISABLE_SUB,IDD_DISABLE,6,IDS_ACCOUNT_TITLE,IntDisableProc);
  504. definepage(ahpsp,psp,IDS_CREDENTIALS_ACCOUNT,IDS_CREDENTIALS_SUB,IDD_CREDENTIALS,7,IDS_ACCOUNT_TITLE,IntCredentialsProc);
  505. definepage(ahpsp,psp,IDS_OPTIONS,IDS_OPTIONS_SUB,IDD_OPTIONS,8,IDS_ACCOUNT_TITLE,IntOptionsProc);
  506. definepage(ahpsp,psp,IDS_PROPEX,IDS_PROPEX_SUB,IDD_PROP_EXCLUSION,9,IDS_ACCOUNT_TITLE,IntPropExclusionProc);
  507. definepage(ahpsp,psp,IDS_RENAMING,IDS_RENAMING_SUB1,IDD_RENAMING,10,IDS_ACCOUNT_TITLE,IntRenameProc);
  508. definepage(ahpsp,psp,IDS_SA_INFO,IDS_SA_INFO_SUB,IDD_SA_INFO,11,IDS_ACCOUNT_TITLE,IntServiceInfoProc);
  509. endpage(ahpsp,psp,IDD_END_ACCOUNT,12,IDS_ACCOUNT_TITLE,EndDlgProc);
  510. int result = defineSheet(ahpsp,psh,13,wizdata,IDB_HEADER_ARROW,IDB_WATERMARK_USER);
  511. return result;
  512. }
  513. int doGroup()
  514. {
  515. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  516. HPROPSHEETPAGE ahpsp[13] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  517. PROPSHEETHEADER psh = {0}; //defines the property sheet
  518. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  519. intropage(ahpsp,psp,IDD_INTRO_GROUP,0,wizdata,IDS_GROUP_TITLE,IntroDlgProc);
  520. definepage(ahpsp,psp,IDS_COMMIT,IDS_COMMIT_SUB,IDD_COMMIT,1,IDS_GROUP_TITLE,IntCommitProc);
  521. definepage(ahpsp,psp,IDS_DOMAIN,IDS_DOMAIN_GROUP,IDD_DOMAIN_SELECTION,2,IDS_GROUP_TITLE,IntDomainSelectionProc);
  522. definepage(ahpsp,psp,IDS_GROUP,IDS_GROUP_SUB,IDD_SELECTION2,3,IDS_GROUP_TITLE, IntSelectionProc);
  523. definepage(ahpsp,psp,IDS_OU_SELECTION,IDS_OU_SELECTION_SUB,IDD_OU_SELECTION,4,IDS_GROUP_TITLE,IntOuSelectionProc);
  524. definepage(ahpsp,psp,IDS_OPTIONS_GROUP,IDS_OPTIONS_GROUP_SUB,IDD_OPTIONS_GROUP,5,IDS_GROUP_TITLE,IntGroupOptionsProc);
  525. definepage(ahpsp,psp,IDS_PROPEX,IDS_PROPEX_SUB,IDD_PROP_EXCLUSION,6,IDS_GROUP_TITLE,IntPropExclusionProc);
  526. definepage(ahpsp,psp,IDS_CREDENTIALS_ACCOUNT,IDS_CREDENTIALS_SUB,IDD_CREDENTIALS,7,IDS_GROUP_TITLE,IntCredentialsProc);
  527. definepage(ahpsp,psp,IDS_RENAMING,IDS_RENAMING_SUB2,IDD_RENAMING,8,IDS_GROUP_TITLE, IntRenameProc);
  528. definepage(ahpsp,psp,IDS_PASSWORD_GRP,IDS_PASSWORD_SUB_GRP,IDD_PASSWORD,9,IDS_GROUP_TITLE,IntPasswordProc);
  529. definepage(ahpsp,psp,IDS_DISABLE_GRP,IDS_DISABLE_SUB_GRP,IDD_DISABLE,10,IDS_GROUP_TITLE,IntDisableProc);
  530. // definepage(ahpsp,psp,IDS_OPTIONS_FROM_USER,IDS_OPTIONS_FROM_USER_SUB,IDD_OPTIONS_FROM_USER,10,IDS_GROUP_TITLE, IntOptionsFromUserProc);
  531. definepage(ahpsp,psp,IDS_SA_INFO,IDS_SA_INFO_SUB,IDD_SA_INFO,11,IDS_GROUP_TITLE,IntServiceInfoProc);
  532. endpage(ahpsp,psp,IDD_END_GROUP,12,IDS_GROUP_TITLE, EndDlgProc);
  533. int result = defineSheet(ahpsp,psh,13,wizdata,IDB_HEADER_ARROW,IDB_WATERMARK_GROUP);
  534. return result;
  535. }
  536. int doComputer()
  537. {
  538. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  539. HPROPSHEETPAGE ahpsp[11] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  540. PROPSHEETHEADER psh = {0}; //defines the property sheet
  541. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  542. intropage(ahpsp,psp,IDD_INTRO_COMPUTER,0,wizdata,IDS_COMPUTER_TITLE,IntroDlgProc);
  543. definepage(ahpsp,psp,IDS_COMMIT,IDS_COMMIT_SUB,IDD_COMMIT,1,IDS_COMPUTER_TITLE,IntCommitProc);
  544. definepage(ahpsp,psp,IDS_DOMAIN,IDS_DOMAIN_COMPUTERS,IDD_DOMAIN_SELECTION,2,IDS_COMPUTER_TITLE, IntDomainSelectionProc);
  545. definepage(ahpsp,psp,IDS_COMPUTER,IDS_COMPUTER_SUB,IDD_SELECTION1,3,IDS_COMPUTER_TITLE, IntSelectionProc);
  546. definepage(ahpsp,psp,IDS_OU_SELECTION,IDS_OU_SELECTION_SUB,IDD_OU_SELECTION,4,IDS_COMPUTER_TITLE, IntOuSelectionProc);
  547. definepage(ahpsp,psp,IDS_TRANSLATION,IDS_TRANSLATION_SUB,IDD_TRANSLATION,5,IDS_COMPUTER_TITLE, IntTranslationProc);
  548. definepage(ahpsp,psp,IDS_SECURITY_OPTIONS,IDS_TRANSLATION_MODE_SUB,IDD_TRANSLATION_MODE,6,IDS_COMPUTER_TITLE, IntTranslationModeProc);
  549. // definepage(ahpsp,psp,IDS_CREDENTIALS2,IDS_CREDENTIALS_SUB2,IDD_CREDENTIALS2,7,IDS_COMPUTER_TITLE, IntCredentials2Proc);
  550. definepage(ahpsp,psp,IDS_COMPUTER_OPTIONS,IDS_REBOOT_SUB,IDD_REBOOT,7,IDS_COMPUTER_TITLE, IntRebootProc);
  551. definepage(ahpsp,psp,IDS_PROPEX,IDS_PROPEX_SUB,IDD_PROP_EXCLUSION,8,IDS_COMPUTER_TITLE,IntPropExclusionProc);
  552. definepage(ahpsp,psp,IDS_RENAMING,IDS_RENAMING_SUB3,IDD_RENAMING,9,IDS_COMPUTER_TITLE, IntRenameProc);
  553. endpage(ahpsp,psp,IDD_END_COMPUTER,10,IDS_COMPUTER_TITLE, EndDlgProc);
  554. int result = defineSheet(ahpsp,psh,11,wizdata,IDB_HEADER_ARROW,IDB_WATERMARK_COMPUTER);
  555. return result;
  556. }
  557. int doSecurity()
  558. {
  559. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  560. HPROPSHEETPAGE ahpsp[8] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  561. PROPSHEETHEADER psh = {0}; //defines the property sheet
  562. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  563. intropage(ahpsp,psp,IDD_INTRO_SECURITY,0,wizdata,IDS_SECURITY_TITLE,IntroDlgProc);
  564. definepage(ahpsp,psp,IDS_COMMIT,IDS_COMMIT_SUB,IDD_COMMIT,1,IDS_SECURITY_TITLE,IntCommitProc);
  565. definepage(ahpsp,psp,IDS_SECURITY_OPTIONS,IDS_TRANSLATION_MODE_SUB,IDD_TRANSLATION_SRC,2,IDS_SECURITY_TITLE,IntTranslationInputProc);
  566. definepage(ahpsp,psp,IDS_DOMAIN,IDS_DOMAIN_SECURITY,IDD_DOMAIN_SELECTION,3,IDS_SECURITY_TITLE ,IntDomainSelectionProc);
  567. definepage(ahpsp,psp,IDS_SECURITY,IDS_SECURITY_SUB,IDD_SELECTION4,4,IDS_SECURITY_TITLE,IntSelectionSecurityProc);
  568. definepage(ahpsp,psp,IDS_TRANSLATION,IDS_TRANSLATION_SUB,IDD_TRANSLATION,5,IDS_SECURITY_TITLE, IntTranslationProc);
  569. definepage(ahpsp,psp,IDS_SECURITY_OPTIONS,IDS_TRANSLATION_MODE_SUB,IDD_TRANSLATION_MODE,6,IDS_SECURITY_TITLE,IntTranslationModeProc);
  570. // definepage(ahpsp,psp,IDS_CREDENTIALS2,IDS_CREDENTIALS_SUB2,IDD_CREDENTIALS2,7,IDS_SECURITY_TITLE, IntCredentials2Proc);
  571. endpage(ahpsp,psp,IDD_END_SECURITY,7,IDS_SECURITY_TITLE, EndDlgProc);
  572. int result = defineSheet(ahpsp,psh,8,wizdata,IDB_HEADER_KEY,IDB_WATERMARK_SECURITY);
  573. return result;
  574. }
  575. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  576. int doExchangeDir()
  577. {
  578. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  579. HPROPSHEETPAGE ahpsp[7] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  580. PROPSHEETHEADER psh = {0}; //defines the property sheet
  581. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  582. intropage(ahpsp,psp,IDD_INTRO_EXCHANGE_DIR,0,wizdata,IDS_EXCHANGE_DIR_TITLE,IntroDlgProc);
  583. definepage(ahpsp,psp,IDS_COMMIT,IDS_COMMIT_SUB,IDD_COMMIT,1,IDS_EXCHANGE_DIR_TITLE,IntCommitProc);
  584. definepage(ahpsp,psp,IDS_DOMAIN,IDS_DOMAIN_DIRECTORY,IDD_DOMAIN_SELECTION,2,IDS_EXCHANGE_DIR_TITLE, IntDomainSelectionProc);
  585. definepage(ahpsp,psp,IDS_SECURITY_OPTIONS,IDS_TRANSLATION_MODE_SUB,IDD_TRANSLATION_MODE,3,IDS_EXCHANGE_DIR_TITLE, IntTranslationModeProc);
  586. definepage(ahpsp,psp,IDS_EXCHANGE_SELECTION,IDS_EXCHANGE_SELECTION_SUB,IDD_EXCHANGE_SELECTION,4,IDS_EXCHANGE_DIR_TITLE,IntExchangeSelectionProc);
  587. definepage(ahpsp,psp,IDS_CREDENTIALS_EXCHANGE,IDS_CREDENTIALS_EXCHANGE_SUB,IDD_CREDENTIALS,5,IDS_EXCHANGE_DIR_TITLE,IntCredentialsProc);
  588. endpage(ahpsp,psp,IDD_END_EXCHANGE_DIR,6,IDS_EXCHANGE_DIR_TITLE, EndDlgProc);
  589. int result = defineSheet(ahpsp,psh,7,wizdata,IDB_HEADER_ARROW,IDB_WATERMARK_EXCHANGE);
  590. return result;
  591. }
  592. int doExchangeSrv()
  593. {
  594. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  595. HPROPSHEETPAGE ahpsp[5] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  596. PROPSHEETHEADER psh = {0}; //defines the property sheet
  597. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  598. intropage(ahpsp,psp,IDD_INTRO_EXCHANGE_SRV,0,wizdata,IDS_EXCHANGE_SRV_TITLE,IntroDlgProc);
  599. definepage(ahpsp,psp,IDS_COMMIT,IDS_COMMIT_SUB,IDD_COMMIT,1,IDS_EXCHANGE_SRV_TITLE,IntCommitProc);
  600. definepage(ahpsp,psp,IDS_DOMAIN,IDS_DOMAIN_SUB,IDD_DOMAIN_SELECTION,2,IDS_EXCHANGE_SRV_TITLE, IntDomainSelectionProc);
  601. definepage(ahpsp,psp,IDS_EXCHANGE_SELECTION,IDS_EXCHANGE_SELECTION_SUB,IDD_EXCHANGE_SELECTION,3,IDS_EXCHANGE_SRV_TITLE,IntExchangeSelectionProc);
  602. endpage(ahpsp,psp,IDD_END_EXCHANGE_SRV,4,IDS_EXCHANGE_SRV_TITLE, EndDlgProc);
  603. int result = defineSheet(ahpsp,psh,5,wizdata,IDB_HEADER_ARROW,IDB_WATERMARK_EXCHANGE);
  604. return result;
  605. }
  606. int doUndo()
  607. {
  608. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  609. HPROPSHEETPAGE ahpsp[4] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  610. PROPSHEETHEADER psh = {0}; //defines the property sheet
  611. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  612. intropage(ahpsp,psp,IDD_INTRO_UNDO,0,wizdata,IDS_UNDO_TITLE,IntroDlgProc);
  613. definepage(ahpsp,psp,IDS_UNDO,IDS_UNDO_SUB,IDD_UNDO,1,IDS_UNDO_TITLE,IntUndoProc);
  614. definepage(ahpsp,psp,IDS_CREDENTIALS_ACCOUNT,IDS_CREDENTIALS_SUB,IDD_CREDENTIALS,2,IDS_UNDO_TITLE,IntCredentialsProc);
  615. // definepage(ahpsp,psp,IDS_CREDENTIALS2,IDS_CREDENTIALS_SUB2,IDD_CREDENTIALS2,3,IDS_UNDO_TITLE, IntCredentials2Proc);
  616. endpage(ahpsp,psp,IDD_END_UNDO,3,IDS_UNDO_TITLE, EndDlgProc);
  617. int result = defineSheet(ahpsp,psh,4,wizdata,IDB_HEADER_ARROW,IDB_WATERMARK_USER);
  618. return result;
  619. }
  620. int doRetry()
  621. {
  622. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  623. HPROPSHEETPAGE ahpsp[3] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  624. PROPSHEETHEADER psh = {0}; //defines the property sheet
  625. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  626. intropage(ahpsp,psp,IDD_INTRO_RETRY,0,wizdata,IDS_RETRY_TITLE,IntroDlgProc);
  627. definepage(ahpsp,psp,IDS_RETRY,IDS_RETRY_SUB,IDD_RETRY,1,IDS_RETRY_TITLE,IntRetryProc);
  628. // definepage(ahpsp,psp,IDS_CREDENTIALS2,IDS_CREDENTIALS_SUB2,IDD_CREDENTIALS2,2,IDS_RETRY_TITLE,IntCredentials2Proc);
  629. endpage(ahpsp,psp,IDD_END_RETRY,2,IDS_RETRY_TITLE, EndDlgProc);
  630. int result = defineSheet(ahpsp,psh,3,wizdata,IDB_HEADER_ARROW,IDB_WATERMARK_USER);
  631. return result;
  632. }
  633. int doReporting()
  634. {
  635. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  636. HPROPSHEETPAGE ahpsp[6] = {0}; //an array to hold the page's HPROPSHEETPAGE handles
  637. PROPSHEETHEADER psh = {0}; //defines the property sheet
  638. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  639. intropage(ahpsp,psp,IDD_INTRO_REPORTING,0,wizdata,IDS_REPORTING_TITLE,IntroDlgProc);
  640. definepage(ahpsp,psp,IDS_DOMAIN,IDS_DOMAIN_REPORTING_SUB,IDD_DOMAIN_SELECTION,1,IDS_REPORTING_TITLE,IntDomainSelectionProc);
  641. definepage(ahpsp,psp,IDS_HTML_LOCATION,IDS_HTML_LOCATION_SUB,IDD_HTML_LOCATION,2,IDS_REPORTING_TITLE,IntHTMLLocationProc);
  642. definepage(ahpsp,psp,IDS_OPTIONS_REPORTING,IDS_OPTIONS_REPORTING_SUB,IDD_OPTIONS_REPORTING,3,IDS_REPORTING_TITLE,IntOptionsReportingProc);
  643. // definepage(ahpsp,psp,IDS_CREDENTIALS3,IDS_CREDENTIALS_SUB3,IDD_CREDENTIALS2,4,IDS_REPORTING_TITLE, IntCredentials2Proc);
  644. definepage(ahpsp,psp,IDS_REPORTING,IDS_REPORTING_SUB,IDD_SELECTION1,4,IDS_REPORTING_TITLE,IntSelectionProc);
  645. endpage(ahpsp,psp,IDD_END_REPORTING,5,IDS_REPORTING_TITLE, EndDlgProc);
  646. int result = defineSheet(ahpsp,psh,6,wizdata,IDB_HEADER_BOOK,IDB_WATERMARK_REPORTING);
  647. return result;
  648. }
  649. int doService()
  650. {
  651. PROPSHEETPAGE psp = {0}; //defines the property sheet pages
  652. HPROPSHEETPAGE ahpsp[6]= {0}; //an array to hold the page's HPROPSHEETPAGE handles
  653. PROPSHEETHEADER psh = {0}; //defines the property sheet
  654. SHAREDWIZDATA wizdata = {0}; //the shared data structure
  655. intropage(ahpsp,psp,IDD_INTRO_SERVICE,0,wizdata,IDS_SERVICE_TITLE,IntroDlgProc);
  656. definepage(ahpsp,psp,IDS_DOMAIN,IDS_SERVICE_DOMAIN,IDD_DOMAIN_SELECTION,1,IDS_SERVICE_TITLE,IntDomainSelectionProc);
  657. definepage(ahpsp,psp,IDS_SA_REFRESH,IDS_SA_REFRESH_SUB,IDD_SA_REFRESH,2,IDS_SERVICE_TITLE,IntServiceRefreshProc);
  658. definepage(ahpsp,psp,IDS_SERVICE,IDS_SERVICE_SUB,IDD_SELECTION1,3,IDS_SERVICE_TITLE,IntSelectionProc);
  659. // definepage(ahpsp,psp,IDS_CREDENTIALS2,IDS_SERVICE_CREDENTIALS,IDD_CREDENTIALS2,4,IDS_SERVICE_TITLE, IntCredentials2Proc);
  660. definepage(ahpsp,psp,IDS_SA_INFO,IDS_SA_INFO_SUB,IDD_SA_INFO_BUTTON,4,IDS_SERVICE_TITLE,IntServiceInfoButtonProc);
  661. endpage(ahpsp,psp,IDD_END_SERVICE,5,IDS_SERVICE_TITLE,EndDlgProc);
  662. int result = defineSheet(ahpsp,psh,6,wizdata,IDB_HEADER_ARROW,IDB_WATERMARK_SERVICE_ACCOUNT);
  663. return result;
  664. }