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.

94 lines
3.4 KiB

  1. // webgate.h : Declaration of the CWebGate
  2. #ifndef __WEBGATE_H_
  3. #define __WEBGATE_H_
  4. #include <urlmon.h>
  5. #include <wininet.h>
  6. #include <shlwapi.h>
  7. #include <windowsx.h>
  8. #include "obcomglb.h"
  9. /////////////////////////////////////////////////////////////////////////////
  10. // CWebGate
  11. class CWebGate : public IBindStatusCallback, IHttpNegotiate
  12. {
  13. public:
  14. CWebGate ();
  15. ~CWebGate ();
  16. // IUnknown methods
  17. STDMETHODIMP QueryInterface (REFIID riid, void ** ppv);
  18. STDMETHODIMP_(ULONG) AddRef ();
  19. STDMETHODIMP_(ULONG) Release ();
  20. // IBindStatusCallback methods
  21. STDMETHODIMP OnStartBinding (DWORD dwReserved, IBinding* pbinding);
  22. STDMETHODIMP GetPriority (LONG* pnPriority);
  23. STDMETHODIMP OnLowResource (DWORD dwReserved);
  24. STDMETHODIMP OnProgress (ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR pwzStatusText);
  25. STDMETHODIMP OnStopBinding (HRESULT hrResult, LPCWSTR szError);
  26. STDMETHODIMP GetBindInfo (DWORD* pgrfBINDF, BINDINFO* pbindinfo);
  27. STDMETHODIMP OnDataAvailable (DWORD grfBSCF, DWORD dwSize, FORMATETC *pfmtetc, STGMEDIUM* pstgmed);
  28. STDMETHODIMP OnObjectAvailable (REFIID riid, IUnknown* punk);
  29. // IHttpNegotiate methods
  30. STDMETHODIMP BeginningTransaction (LPCWSTR szURL, LPCWSTR szHeaders, DWORD dwReserved, LPWSTR* pszAdditionalHeaders);
  31. STDMETHODIMP OnResponse (DWORD dwResponseCode, LPCWSTR szResponseHeaders, LPCWSTR szRequestHeaders, LPWSTR* pszAdditionalRequestHeaders);
  32. //WebGate
  33. STDMETHOD (get_DownloadFname) (BSTR *pVal);
  34. STDMETHOD (FetchPage) (DWORD dwDoWait, BOOL *pbRetVal);
  35. STDMETHOD (put_Path) (BSTR newVal);
  36. private:
  37. DWORD m_cRef;
  38. IMoniker* m_pmk;
  39. IBindCtx* m_pbc;
  40. IStream* m_pstm;
  41. BSTR m_bstrCacheFileName;
  42. HANDLE m_hEventComplete;
  43. HANDLE m_hEventError;
  44. BSTR m_bstrPath;
  45. void FlushCache();
  46. };
  47. /*
  48. // ===========================================================================
  49. // CWebGateBindStatusCallback Definition
  50. //
  51. // This class will be use to indicate download progress
  52. //
  53. // ===========================================================================
  54. class CWebGateBindStatusCallback : public IBindStatusCallback
  55. {
  56. public:
  57. // IUnknown methods
  58. STDMETHODIMP QueryInterface (REFIID riid, void ** ppv);
  59. STDMETHODIMP_(ULONG) AddRef ();
  60. STDMETHODIMP_(ULONG) Release ();
  61. // IBindStatusCallback methods
  62. STDMETHODIMP OnStartBinding (DWORD dwReserved, IBinding* pbinding);
  63. STDMETHODIMP GetPriority (LONG* pnPriority);
  64. STDMETHODIMP OnLowResource (DWORD dwReserved);
  65. STDMETHODIMP OnProgress (ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR pwzStatusText);
  66. STDMETHODIMP OnStopBinding (HRESULT hrResult, LPCWSTR szError);
  67. STDMETHODIMP GetBindInfo (DWORD* pgrfBINDF, BINDINFO* pbindinfo);
  68. STDMETHODIMP OnDataAvailable (DWORD grfBSCF, DWORD dwSize, FORMATETC *pfmtetc, STGMEDIUM* pstgmed);
  69. STDMETHODIMP OnObjectAvailable (REFIID riid, IUnknown* punk);
  70. // constructors/destructors
  71. CWebGateBindStatusCallback (CWebGate* lpWebGate);
  72. ~CWebGateBindStatusCallback ();
  73. // data members
  74. DWORD m_cRef;
  75. IBinding* m_pbinding;
  76. IStream* m_pstm;
  77. CWebGate* m_lpWebGate;
  78. };
  79. */
  80. #endif //__WEBGATE_H_