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.

85 lines
3.2 KiB

  1. // Migrator.h: Definition of the CMigrator class
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_MIGRATOR_H__1AA3D2E2_2B15_11D3_8AE5_00A0C9AFE114__INCLUDED_)
  5. #define AFX_MIGRATOR_H__1AA3D2E2_2B15_11D3_8AE5_00A0C9AFE114__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "resource.h" // main symbols
  10. #import "DBMgr.tlb" no_namespace, named_guids
  11. #define MAX_DB_FIELD 255
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CMigrator
  14. class CMigrator :
  15. public IDispatchImpl<IPerformMigrationTask, &IID_IPerformMigrationTask, &LIBID_MCSMIGRATIONDRIVERLib>,
  16. public ISupportErrorInfoImpl<&IID_IPerformMigrationTask>,
  17. public CComObjectRoot,
  18. public CComCoClass<CMigrator,&CLSID_Migrator>
  19. {
  20. public:
  21. CMigrator() {}
  22. BEGIN_COM_MAP(CMigrator)
  23. COM_INTERFACE_ENTRY(IDispatch)
  24. COM_INTERFACE_ENTRY(IPerformMigrationTask)
  25. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  26. END_COM_MAP()
  27. //DECLARE_NOT_AGGREGATABLE(CMigrator)
  28. // Remove the comment from the line above if you don't want your object to
  29. // support aggregation.
  30. DECLARE_REGISTRY_RESOURCEID(IDR_Migrator)
  31. protected:
  32. // these helper functions are implemented in StrDesc.cpp
  33. void BuildGeneralDesc(IVarSet * pVarSet,CString & str);
  34. void BuildAcctReplDesc(IVarSet * pVarSet,CString & str);
  35. void BuildSecTransDesc(IVarSet * pVarSet,CString & str, BOOL bLocal);
  36. void BuildDispatchDesc(IVarSet * pVarSet,CString & str);
  37. void BuildReportDesc(IVarSet * pVarSet, CString & str);
  38. void BuildUndoDesc(IVarSet * pVarSet, CString & str);
  39. void BuildGroupMappingDesc(IVarSet * pVarSet, CString & str);
  40. void PreProcessForReporting(IVarSet * pVarSet);
  41. void PreProcessDispatcher(IVarSet * pVarSet);
  42. void PostProcessDispatcher(IVarSet * pVarSet);
  43. HRESULT BuildAccountListForUndo(IVarSet * pVarSet,long actionID);
  44. HRESULT ProcessServerListForUndo(IVarSet * pVarSet);
  45. HRESULT ConstructUndoVarSet(IVarSet * pVarSetIn,IVarSet * pVarSetOut);
  46. HRESULT TrimMigratingComputerList(IVarSet * pVarSetIn, bool* bAnyToDispatch);
  47. HRESULT RunReports(IVarSet * pVarSet);
  48. HRESULT SetReportDataInRegistry(WCHAR const * reportName,WCHAR const * filename);
  49. HRESULT ViewPreviousDispatchResults();
  50. // IPerformMigrationTask
  51. public:
  52. STDMETHOD(GetTaskDescription)(IUnknown * pVarSet,/*[out]*/BSTR * pDescription);
  53. STDMETHOD(PerformMigrationTask)(IUnknown * pVarSet,LONG_PTR HWND);
  54. STDMETHOD(GetUndoTask)(IUnknown * pVarSet,/*[out]*/ IUnknown ** ppVarSetOut);
  55. private:
  56. typedef struct _DATABASE_ENTRY {
  57. _bstr_t m_domain;
  58. _bstr_t m_sSAMName;
  59. _bstr_t m_sRDN;
  60. _bstr_t m_sCanonicalName;
  61. _bstr_t m_sObjectClass;
  62. BOOL m_bSource;
  63. }DATABASE_ENTRY, *PDATABASE_ENTRY;
  64. CList<DATABASE_ENTRY,DATABASE_ENTRY&> mUserList;
  65. HRESULT PopulateAccounts(IVarSetPtr pVs);
  66. bool PopulateDomainDBs(IVarSet * pVarSet);
  67. bool PopulateADomainDB(WCHAR const *domain, WCHAR const *domainDNS, BOOL bSource);
  68. DWORD GetOSVersionForDomain(WCHAR const * domain);
  69. BOOL DeleteItemFromList(WCHAR const * aName);
  70. void RetrieveSrcDomainSid(IVarSet * pVarSet, IIManageDBPtr pDb);
  71. };
  72. #endif // !defined(AFX_MIGRATOR_H__1AA3D2E2_2B15_11D3_8AE5_00A0C9AFE114__INCLUDED_)