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.

103 lines
2.5 KiB

  1. /*---------------------------------------------------------------------------
  2. File: DCTInstaller.h
  3. Comments: COM object that installs the DCT Agent Service on a remote machine.
  4. (c) Copyright 1999, Mission Critical Software, Inc., All Rights Reserved
  5. Proprietary and confidential to Mission Critical Software, Inc.
  6. REVISION LOG ENTRY
  7. Revision By: Christy Boles
  8. Revised on 02/15/99 11:23:57
  9. ---------------------------------------------------------------------------
  10. */
  11. // DCTInstaller.h : Declaration of the CDCTInstaller
  12. #ifndef __DCTINSTALLER_H_
  13. #define __DCTINSTALLER_H_
  14. #include "resource.h" // main symbols
  15. #include "EaLen.hpp"
  16. //#include <mstask.h>
  17. #include <comdef.h>
  18. #include <mtx.h>
  19. #include "Common.hpp"
  20. #include "UString.hpp"
  21. #include "TNode.hpp"
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CDCTInstaller
  24. class ATL_NO_VTABLE CDCTInstaller :
  25. public CComObjectRootEx<CComMultiThreadModel>,
  26. public CComCoClass<CDCTInstaller, &CLSID_DCTInstaller>,
  27. public IWorkNode
  28. {
  29. _bstr_t m_Account;
  30. _bstr_t m_Password;
  31. _bstr_t m_SourcePath;
  32. _bstr_t m_TargetPath;
  33. WCHAR m_LocalComputer[LEN_Computer];
  34. TNodeList * m_PlugInFileList;
  35. public:
  36. CDCTInstaller()
  37. {
  38. m_LocalComputer[0] = L'\0';
  39. m_pUnkMarshaler = NULL;
  40. m_PlugInFileList = NULL;
  41. }
  42. void SetFileList(TNodeList *pList) { m_PlugInFileList = pList; }
  43. DECLARE_REGISTRY_RESOURCEID(IDR_DCTINSTALLER)
  44. DECLARE_NOT_AGGREGATABLE(CDCTInstaller)
  45. DECLARE_GET_CONTROLLING_UNKNOWN()
  46. DECLARE_PROTECT_FINAL_CONSTRUCT()
  47. BEGIN_COM_MAP(CDCTInstaller)
  48. COM_INTERFACE_ENTRY(IWorkNode)
  49. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  50. END_COM_MAP()
  51. HRESULT FinalConstruct()
  52. {
  53. return CoCreateFreeThreadedMarshaler(
  54. GetControllingUnknown(), &m_pUnkMarshaler.p);
  55. }
  56. void FinalRelease()
  57. {
  58. m_pUnkMarshaler.Release();
  59. }
  60. CComPtr<IUnknown> m_pUnkMarshaler;
  61. // IDCTInstaller
  62. public:
  63. STDMETHOD(SetCredentials)(BSTR account, BSTR password);
  64. STDMETHOD(InstallToServer)(BSTR serverName, BSTR configurationFile);
  65. protected:
  66. // helper functions
  67. DWORD GetLocalMachineName();
  68. public:
  69. // IWorkNode
  70. STDMETHOD(Process)(IUnknown * pUnknown);
  71. };
  72. class TFileNode: public TNode
  73. {
  74. WCHAR filename[LEN_Path];
  75. public:
  76. TFileNode(WCHAR const * f) { safecopy(filename,f); }
  77. WCHAR const * FileName() { return filename; }
  78. };
  79. #endif //__DCTINSTALLER_H_