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.

88 lines
3.4 KiB

  1. #ifndef _MIGWIZ_HXX_
  2. #define _MIGWIZ_HXX_
  3. #include <shlobj.h>
  4. #define NUMPAGES 22
  5. #define ENGINE_RULE_MAXLEN 4000
  6. #define ENGINE_NOTINIT 0
  7. #define ENGINE_INITGATHER 1
  8. #define ENGINE_INITAPPLY 2
  9. // custom window messages
  10. #define WM_USER_FINISHED (WM_APP + 1)
  11. #define WM_USER_CANCELLED (WM_APP + 2)
  12. #define WM_USER_THREAD_COMPLETE (WM_APP + 3)
  13. #define WM_USER_CANCEL_PENDING (WM_APP + 4)
  14. #define WM_USER_STATUS (WM_APP + 5)
  15. #define WM_USER_ROLLBACK (WM_APP + 6)
  16. // device bit entries
  17. #ifndef ARRAYSIZE
  18. #define ARRAYSIZE(x) (sizeof(x) / sizeof((x)[0]))
  19. #endif
  20. class MigrationWizard
  21. {
  22. public:
  23. MigrationWizard();
  24. ~MigrationWizard();
  25. HRESULT Init(HINSTANCE hinstance, LPTSTR pszUsername);
  26. HRESULT Execute();
  27. HINSTANCE GetInstance() { return _hInstance; }
  28. HFONT GetTitleFont() { return _hTitleFont; }
  29. HFONT Get95HeaderFont() { return _h95HeaderFont; }
  30. HIMAGELIST GetImageList() { return _hil; }
  31. BOOL GetLegacy() { return _fLegacyMode; }
  32. BOOL GetWin9X() { return _fWin9X; }
  33. BOOL GetWinNT4() { return _fWinNT4; }
  34. BOOL GetOOBEMode() { return _fOOBEMode; }
  35. BOOL GetOldStyle() { return _fOldStyle; }
  36. void ResetLastResponse();
  37. BOOL GetLastResponse();
  38. HRESULT SelectComponentSet(UINT uSelectionGroup);
  39. private: // helper functions
  40. HRESULT _CreateWizardPages();
  41. HRESULT _InitEngine(BOOL fSource, BOOL* pfNetworkDetected);
  42. protected: // friend WinProcs
  43. friend INT_PTR CALLBACK _CollectProgressDlgProc (HWND hwndDlg,UINT uMsg, WPARAM wParam, LPARAM lParam);
  44. friend DWORD WINAPI _CollectProgressDlgProcThread (LPVOID lpParam);
  45. friend INT_PTR CALLBACK _ApplyProgressDlgProc (HWND hwndDlg,UINT uMsg, WPARAM wParam, LPARAM lParam);
  46. friend DWORD WINAPI _ApplyProgressDlgProcThread (LPVOID lpParam);
  47. friend INT_PTR CALLBACK _DiskProgressDlgProc (HWND hwndDlg,UINT uMsg, WPARAM wParam, LPARAM lParam);
  48. friend INT_PTR CALLBACK _PickMethodDlgProc (HWND hwndDlg,UINT uMsg, WPARAM wParam, LPARAM lParam);
  49. friend DWORD WINAPI _StartEngineDlgProcThread (LPVOID lpParam);
  50. // other friend functions
  51. friend BOOL _HandleCancel (HWND hwndDlg, BOOL PressNext);
  52. private:
  53. LPTSTR _pszUsername; // username specified
  54. HFONT _hTitleFont; // The title font for the Welcome and Completion pages
  55. HFONT _h95HeaderFont; // The title font for the Wizard 95 interior page header titles
  56. HINSTANCE _hInstance; // HInstance the wizard is run in
  57. HPROPSHEETPAGE _rghpsp[NUMPAGES]; // an array to hold the page's HPROPSHEETPAGE handles
  58. PROPSHEETHEADER _psh; // defines the property sheet
  59. HIMAGELIST _hil; // shell's small image list
  60. BOOL _fInit; // has the engine been initialized yet
  61. BOOL _fOOBEMode; // are we running on from an OOBE floppy?
  62. BOOL _fLegacyMode; // are we running on a downlevel (non-whistler) machine?
  63. BOOL _fWin9X; // are we running on a Win9X machine?
  64. BOOL _fWinNT4; // are we running on a WinNT4 machine?
  65. BOOL _fOldStyle; // are we running the old-style wizard?
  66. BOOL _fDelCs; // delete critical section on terminate?
  67. };
  68. #endif