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.

67 lines
2.2 KiB

  1. #ifndef _MIGOOBE_H
  2. #define _MIGOOBE_H
  3. #include "cowsite.h"
  4. class CMigWizEngine : public CObjectWithSite
  5. ,public IMigrationWizardAuto
  6. {
  7. public:
  8. // Constructor
  9. CMigWizEngine();
  10. // Destructor
  11. virtual ~CMigWizEngine();
  12. // IUnknown
  13. virtual STDMETHODIMP QueryInterface(const IID& iid, void** ppv);
  14. virtual STDMETHODIMP_(ULONG) AddRef();
  15. virtual STDMETHODIMP_(ULONG) Release();
  16. protected:
  17. // IMigrationWizardAuto
  18. virtual STDMETHODIMP CreateToolDisk(BSTR pszDrivePath, BSTR pszFilesPath, BSTR pszManifestPath);
  19. virtual STDMETHODIMP ApplySettings(BSTR pszStore);
  20. virtual STDMETHODIMP Cancel();
  21. // IDispatch
  22. virtual STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo, UINT * puArgErr);
  23. virtual STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo);
  24. virtual STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID * rgdispid);
  25. virtual STDMETHODIMP GetTypeInfoCount(UINT FAR* pctinfo);
  26. protected:
  27. // helpers
  28. HRESULT _FireEvent(LPVOID lpParam, int iDISPID, DISPPARAMS* pdisp);
  29. HRESULT _FireProgress(LPVOID lpParam, BSTR pszMsg, int iDone, int iTotal);
  30. HRESULT _FireComplete(LPVOID lpParam, BSTR pszMsg);
  31. HRESULT _GetIDispatchStream (IStream** ppStream);
  32. HRESULT _CreateToolDiskThreadWorker();
  33. static DWORD WINAPI _CreateToolDiskThread (LPVOID lpParam);
  34. HRESULT _ApplySettingsThreadWorker();
  35. static DWORD WINAPI _ApplySettingsThread (LPVOID lpParam);
  36. private:
  37. // Reference count
  38. long m_cRef;
  39. BOOL m_fUserApplying;
  40. BOOL m_fInBackgroundThread; // only one background thread at a time, precludes more calls to CreateToolDisk, ApplySettings
  41. // _CreateToolDiskThread, _ApplySettingsThread
  42. BSTR m_pszDrivePath;
  43. BSTR m_pszFilesPath;
  44. BSTR m_pszManifestPath;
  45. BOOL m_fCancelled;
  46. IStream* m_pDispatchStream;
  47. friend UINT ProgressCallback (LPVOID lpparam, UINT ui1, UINT ui2);
  48. friend VOID WINAPI ApplyProgressCallback (MIG_PROGRESSPHASE Phase, MIG_PROGRESSSTATE State, UINT uiWorkDone, UINT uiTotalWork, ULONG_PTR pArg);
  49. };
  50. #endif