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.

84 lines
1.9 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (c) 1999 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: callback.h
  6. //
  7. // Purpose: INSENG callback implementation
  8. //
  9. // History: 19-jan-99 YAsmi Created
  10. //
  11. //=======================================================================
  12. #ifndef _CALLBACK_H
  13. #define _CALLBACK_H
  14. #include "stdafx.h"
  15. #include "inseng.h"
  16. #include "cwudload.h"
  17. class CInstallEngineCallback : public IInstallEngineCallback
  18. {
  19. public:
  20. CInstallEngineCallback();
  21. // IUnknown
  22. STDMETHOD_(ULONG, AddRef)();
  23. STDMETHOD_(ULONG, Release)();
  24. STDMETHOD(QueryInterface)(REFIID, void**);
  25. // IInstallEngineCallback
  26. STDMETHOD(OnEngineStatusChange)(THIS_ DWORD dwEngStatus, DWORD substatus);
  27. STDMETHOD(OnStartInstall)(THIS_ DWORD dwDLSize, DWORD dwInstallSize);
  28. STDMETHOD(OnStartComponent)(THIS_ LPCSTR pszID, DWORD dwDLSize,
  29. DWORD dwInstallSize, LPCSTR pszString);
  30. STDMETHOD(OnComponentProgress)(THIS_ LPCSTR pszID, DWORD dwPhase,
  31. LPCSTR pszString, LPCSTR pszMsgString, ULONG progress, ULONG themax);
  32. STDMETHOD(OnStopComponent)(THIS_ LPCSTR pszID, HRESULT hError,
  33. DWORD dwPhase, LPCSTR pszString, DWORD dwStatus);
  34. STDMETHOD(OnStopInstall)(THIS_ HRESULT hrError, LPCSTR szError,
  35. DWORD dwStatus);
  36. STDMETHOD(OnEngineProblem)(THIS_ DWORD dwProblem, LPDWORD dwAction);
  37. void Reset();
  38. DWORD GetStatus()
  39. {
  40. return m_dwInstallStatus;
  41. }
  42. DWORD GetPhase()
  43. {
  44. return m_dwPhase;
  45. }
  46. DWORD LastError()
  47. {
  48. return m_hResult;
  49. }
  50. void SetProgressPtr(IWUProgress* pProgress)
  51. {
  52. m_pProgress = pProgress;
  53. }
  54. void SetEnginePtr(IInstallEngine2* pEngine)
  55. {
  56. m_pEngine = pEngine;
  57. }
  58. private:
  59. ULONG m_cRef;
  60. DWORD m_dwPhase;
  61. HRESULT m_hResult;
  62. DWORD m_dwInstallStatus;
  63. IWUProgress* m_pProgress;
  64. IInstallEngine2* m_pEngine;
  65. BOOL m_bAborted;
  66. };
  67. #endif //_CALLBACK_H