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.

100 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_SourcePath;
  30. _bstr_t m_TargetPath;
  31. WCHAR m_LocalComputer[LEN_Computer];
  32. TNodeList * m_PlugInFileList;
  33. public:
  34. CDCTInstaller()
  35. {
  36. m_LocalComputer[0] = L'\0';
  37. m_pUnkMarshaler = NULL;
  38. m_PlugInFileList = NULL;
  39. }
  40. void SetFileList(TNodeList *pList) { m_PlugInFileList = pList; }
  41. DECLARE_REGISTRY_RESOURCEID(IDR_DCTINSTALLER)
  42. DECLARE_NOT_AGGREGATABLE(CDCTInstaller)
  43. DECLARE_GET_CONTROLLING_UNKNOWN()
  44. DECLARE_PROTECT_FINAL_CONSTRUCT()
  45. BEGIN_COM_MAP(CDCTInstaller)
  46. COM_INTERFACE_ENTRY(IWorkNode)
  47. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  48. END_COM_MAP()
  49. HRESULT FinalConstruct()
  50. {
  51. return CoCreateFreeThreadedMarshaler(
  52. GetControllingUnknown(), &m_pUnkMarshaler.p);
  53. }
  54. void FinalRelease()
  55. {
  56. m_pUnkMarshaler.Release();
  57. }
  58. CComPtr<IUnknown> m_pUnkMarshaler;
  59. // IDCTInstaller
  60. public:
  61. STDMETHOD(InstallToServer)(BSTR serverName, BSTR configurationFile, BSTR bstrCacheFile);
  62. protected:
  63. // helper functions
  64. DWORD GetLocalMachineName();
  65. public:
  66. // IWorkNode
  67. STDMETHOD(Process)(IUnknown * pUnknown);
  68. };
  69. class TFileNode: public TNode
  70. {
  71. WCHAR filename[LEN_Path];
  72. public:
  73. TFileNode(WCHAR const * f) { safecopy(filename,f); }
  74. WCHAR const * FileName() { return filename; }
  75. };
  76. #endif //__DCTINSTALLER_H_