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.

101 lines
3.5 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. Cabinet.h
  5. Abstract:
  6. This file contains the declaration of the classes used to implement
  7. the Setup Finalizer class.
  8. Revision History:
  9. Davide Massarenti (Dmassare) 08/25/99
  10. created
  11. ******************************************************************************/
  12. #if !defined(__INCLUDED___SAF___CABINET_H___)
  13. #define __INCLUDED___SAF___CABINET_H___
  14. #include <MPC_COM.h>
  15. #include <MPC_utils.h>
  16. #include <MPC_security.h>
  17. /////////////////////////////////////////////////////////////////////////////
  18. class ATL_NO_VTABLE CSAFCabinet : // Hungarian: hcpcb
  19. public MPC::Thread < CSAFCabinet, ISAFCabinet >,
  20. public MPC::ConnectionPointImpl< CSAFCabinet, &DIID_DSAFCabinetEvents, MPC::CComSafeMultiThreadModel >,
  21. public IDispatchImpl < ISAFCabinet, &IID_ISAFCabinet, &LIBID_HelpServiceTypeLib >
  22. {
  23. MPC::Impersonation m_imp;
  24. MPC::Cabinet m_cab;
  25. HRESULT m_hResult;
  26. CB_STATUS m_cbStatus;
  27. CComPtr<IDispatch> m_sink_onProgressFiles;
  28. CComPtr<IDispatch> m_sink_onProgressBytes;
  29. CComPtr<IDispatch> m_sink_onComplete;
  30. //////////////////////////////////////////////////////////////////////
  31. HRESULT Run();
  32. HRESULT CanModifyProperties();
  33. HRESULT put_Status( /*[in]*/ CB_STATUS pVal );
  34. //////////////////////////////////////////////////////////////////////
  35. //
  36. // Callback methods.
  37. //
  38. static HRESULT fnCallback_Files( MPC::Cabinet* cabinet, LPCWSTR szFile, ULONG lDone, ULONG lTotal, LPVOID user );
  39. static HRESULT fnCallback_Bytes( MPC::Cabinet* cabinet, ULONG lDone, ULONG lTotal, LPVOID user );
  40. //////////////////////////////////////////////////////////////////////
  41. //
  42. // Event firing methods.
  43. //
  44. HRESULT Fire_onProgressFiles( ISAFCabinet* hcpcb, BSTR bstrFile, long lDone, long lTotal );
  45. HRESULT Fire_onProgressBytes( ISAFCabinet* hcpcb, long lDone, long lTotal );
  46. HRESULT Fire_onComplete ( ISAFCabinet* hcpcb, HRESULT hrRes );
  47. //////////////////////////////////////////////////////////////////////
  48. public:
  49. DECLARE_NO_REGISTRY()
  50. DECLARE_NOT_AGGREGATABLE(CSAFCabinet)
  51. DECLARE_GET_CONTROLLING_UNKNOWN()
  52. DECLARE_PROTECT_FINAL_CONSTRUCT()
  53. BEGIN_COM_MAP(CSAFCabinet)
  54. COM_INTERFACE_ENTRY(IDispatch)
  55. COM_INTERFACE_ENTRY(ISAFCabinet)
  56. COM_INTERFACE_ENTRY(IConnectionPointContainer)
  57. END_COM_MAP()
  58. CSAFCabinet();
  59. void FinalRelease();
  60. public:
  61. // ISAFCabinet
  62. STDMETHOD(put_IgnoreMissingFiles)( /*[in] */ VARIANT_BOOL fIgnoreMissingFiles );
  63. STDMETHOD(put_onProgressFiles )( /*[in] */ IDispatch* function );
  64. STDMETHOD(put_onProgressBytes )( /*[in] */ IDispatch* function );
  65. STDMETHOD(put_onComplete )( /*[in] */ IDispatch* function );
  66. STDMETHOD(get_Status )( /*[out]*/ CB_STATUS *pVal );
  67. STDMETHOD(get_ErrorCode )( /*[out]*/ long *pVal );
  68. STDMETHOD(AddFile )( /*[in]*/ BSTR bstrFilePath , /*[in]*/ VARIANT vFileName );
  69. STDMETHOD(Compress)( /*[in]*/ BSTR bstrCabinetFile );
  70. STDMETHOD(Abort )();
  71. };
  72. #endif // !defined(__INCLUDED___SAF___CABINET_H___)