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.

89 lines
2.4 KiB

  1. //
  2. // MODULE: DOWNLOAD.H
  3. //
  4. // PURPOSE: Downloads and installs the latest trouble shooters.
  5. //
  6. // PROJECT: Generic Troubleshooter DLL for Microsoft AnswerPoint
  7. //
  8. // COMPANY: Saltmine Creative, Inc. (206)-633-4743 [email protected]
  9. //
  10. // AUTHOR: Roman Mach
  11. //
  12. // ORIGINAL DATE: 6/4/96
  13. //
  14. // NOTES:
  15. // 1. Based on PROGRESS.CPP from Microsoft Platform Preview SDK
  16. // 2. Not supported functionality 3/98
  17. //
  18. // Version Date By Comments
  19. //--------------------------------------------------------------------
  20. // V0.1 - RM Original
  21. // V0.3 3/24/98 JM Local Version for NT5
  22. //
  23. #include "urlmon.h"
  24. #include "wininet.h"
  25. #include "resource.h"
  26. #include "commctrl.h"
  27. #define EDIT_BOX_LIMIT 0x7FFF // The Edit box limit
  28. //
  29. #include "ErrorEnums.h"
  30. //
  31. enum DLITEMTYPES {
  32. DLITEM_INI = 0,
  33. DLITEM_DSC = 1,
  34. };
  35. //
  36. //
  37. class CDownload {
  38. public:
  39. CDownload();
  40. ~CDownload();
  41. HRESULT DoDownload(CTSHOOTCtrl *pEvent, LPCTSTR pURL, DLITEMTYPES dwItem);
  42. private:
  43. IMoniker* m_pmk;
  44. IBindCtx* m_pbc;
  45. IBindStatusCallback* m_pbsc;
  46. };
  47. //
  48. //
  49. class CBindStatusCallback : public IBindStatusCallback {
  50. public:
  51. // IUnknown methods
  52. STDMETHODIMP QueryInterface(REFIID riid,void ** ppv);
  53. STDMETHODIMP_(ULONG) AddRef() { return m_cRef++; }
  54. STDMETHODIMP_(ULONG) Release() { if (--m_cRef == 0) { delete this; return 0; } return m_cRef; }
  55. // IBindStatusCallback methods
  56. STDMETHODIMP OnStartBinding(DWORD dwReserved, IBinding* pbinding);
  57. STDMETHODIMP GetPriority(LONG* pnPriority);
  58. STDMETHODIMP OnLowResource(DWORD dwReserved);
  59. STDMETHODIMP OnProgress(ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode,
  60. LPCWSTR pwzStatusText);
  61. STDMETHODIMP OnStopBinding(HRESULT hrResult, LPCWSTR szError);
  62. STDMETHODIMP GetBindInfo(DWORD* pgrfBINDF, BINDINFO* pbindinfo);
  63. STDMETHODIMP OnDataAvailable(DWORD grfBSCF, DWORD dwSize, FORMATETC *pfmtetc,
  64. STGMEDIUM* pstgmed);
  65. STDMETHODIMP OnObjectAvailable(REFIID riid, IUnknown* punk);
  66. // constructors/destructors
  67. CBindStatusCallback(CTSHOOTCtrl *pEvent, DLITEMTYPES dwItem);
  68. ~CBindStatusCallback();
  69. // data members
  70. DWORD m_cRef;
  71. IBinding* m_pbinding;
  72. IStream* m_pstm;
  73. CTSHOOTCtrl *m_pEvent;
  74. DLITEMTYPES m_dwItem;
  75. TCHAR *m_data;
  76. int m_datalen;
  77. };