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.

129 lines
4.1 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. MPCUpload.h
  5. Abstract:
  6. This file contains the declaration of the CMPCUpload class, which is
  7. used as the entry point into the Upload Library.
  8. Revision History:
  9. Davide Massarenti (Dmassare) 04/15/99
  10. created
  11. ******************************************************************************/
  12. #if !defined(__INCLUDED___ULMANAGER___MPCUPLOAD_H___)
  13. #define __INCLUDED___ULMANAGER___MPCUPLOAD_H___
  14. #include "MPCUploadEnum.h"
  15. #include "MPCUploadJob.h"
  16. #include "MPCTransportAgent.h"
  17. class ATL_NO_VTABLE CMPCUpload : // Hungarian: mpcu
  18. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  19. public IDispatchImpl<IMPCUpload, &IID_IMPCUpload, &LIBID_UPLOADMANAGERLib>,
  20. public IMPCPersist // Persistence
  21. {
  22. typedef std::list< CMPCUploadJob* > List;
  23. typedef List::iterator Iter;
  24. typedef List::const_iterator IterConst;
  25. DWORD m_dwLastJobID;
  26. List m_lstActiveJobs;
  27. CMPCTransportAgent m_mpctaThread;
  28. mutable bool m_fDirty;
  29. mutable bool m_fPassivated;
  30. ////////////////////
  31. void CleanUp();
  32. HRESULT InitFromDisk();
  33. HRESULT UpdateToDisk();
  34. HRESULT CreateChild ( /*[in/out]*/ CMPCUploadJob*& mpcujJob );
  35. HRESULT ReleaseChild( /*[in/out]*/ CMPCUploadJob*& mpcujJob );
  36. HRESULT WrapChild ( /*[in ]*/ CMPCUploadJob* mpcujJob, /*[out]*/ IMPCUploadJob* *pVal );
  37. public:
  38. CMPCUpload();
  39. virtual ~CMPCUpload();
  40. HRESULT Init ();
  41. void Passivate();
  42. bool CanContinue();
  43. HRESULT TriggerRescheduleJobs( );
  44. HRESULT RescheduleJobs ( /*[in]*/ bool fSignal, /*[out]*/ DWORD *pdwWait = NULL );
  45. HRESULT RemoveNonQueueableJob( /*[in]*/ bool fSignal );
  46. HRESULT GetFirstJob ( /*[out]*/ CMPCUploadJob*& mpcujJob, /*[out]*/ bool& fFound );
  47. HRESULT GetJobByName( /*[out]*/ CMPCUploadJob*& mpcujJob, /*[out]*/ bool& fFound, /*[in]*/ BSTR bstrName );
  48. HRESULT CalculateQueueSize( /*[out]*/ DWORD& dwSize );
  49. BEGIN_COM_MAP(CMPCUpload)
  50. COM_INTERFACE_ENTRY(IDispatch)
  51. COM_INTERFACE_ENTRY(IMPCUpload)
  52. END_COM_MAP()
  53. public:
  54. // IMPCPersist
  55. STDMETHOD_(bool,IsDirty)();
  56. STDMETHOD(Load)( /*[in]*/ MPC::Serializer& streamIn );
  57. STDMETHOD(Save)( /*[in]*/ MPC::Serializer& streamOut );
  58. // IMPCUpload
  59. STDMETHOD(get__NewEnum)( /*[out]*/ IUnknown* *pVal );
  60. STDMETHOD(Item )( /*[in]*/ long index, /*[out]*/ IMPCUploadJob* *pVal );
  61. STDMETHOD(get_Count )( /*[out]*/ long *pVal );
  62. STDMETHOD(CreateJob)( /*[out]*/ IMPCUploadJob* *pVal );
  63. };
  64. extern MPC::CComObjectGlobalNoLock<CMPCUpload> g_Root;
  65. ////////////////////////////////////////////////////////////////////////////////
  66. class ATL_NO_VTABLE CMPCUploadWrapper : // Hungarian: mpcuw
  67. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  68. public CComCoClass<CMPCUpload, &CLSID_MPCUpload>,
  69. public IDispatchImpl<IMPCUpload, &IID_IMPCUpload, &LIBID_UPLOADMANAGERLib>
  70. {
  71. CMPCUpload* m_Object;
  72. public:
  73. CMPCUploadWrapper();
  74. HRESULT FinalConstruct();
  75. void FinalRelease ();
  76. DECLARE_REGISTRY_RESOURCEID(IDR_MPCUPLOAD)
  77. DECLARE_NOT_AGGREGATABLE(CMPCUploadWrapper)
  78. BEGIN_COM_MAP(CMPCUploadWrapper)
  79. COM_INTERFACE_ENTRY(IDispatch)
  80. COM_INTERFACE_ENTRY(IMPCUpload)
  81. END_COM_MAP()
  82. public:
  83. // IMPCUpload
  84. STDMETHOD(get__NewEnum)( /*[out]*/ IUnknown* *pVal );
  85. STDMETHOD(Item )( /*[in]*/ long index, /*[out]*/ IMPCUploadJob* *pVal );
  86. STDMETHOD(get_Count )( /*[out]*/ long *pVal );
  87. STDMETHOD(CreateJob)( /*[out]*/ IMPCUploadJob* *pVal );
  88. };
  89. #endif // !defined(__INCLUDED___ULMANAGER___MPCUPLOAD_H___)