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.

127 lines
5.4 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1996 **
  4. //*********************************************************************
  5. #ifndef _BINDCB_H_
  6. // the CStubBindStatusCallback implements IBindStatusCallback and
  7. // IHttpNegotiate. We use it to make a "fake" bind status callback
  8. // object when we have headers and post data we would like to apply
  9. // to a navigation. We supply this IBindStatusCallback object, and
  10. // the URL moniker asks us for headers and post data and use those in
  11. // the transaction.
  12. class CStubBindStatusCallback : public IBindStatusCallback,
  13. IHttpNegotiate,
  14. IMarshal
  15. {
  16. private:
  17. UINT _cRef; // ref count on this COM object
  18. LPCTSTR _pszHeaders; // headers to use
  19. HGLOBAL _hszPostData; // post data to use
  20. DWORD _cbPostData; // size of post data
  21. BOOL _bFrameIsOffline : 1; // Indicates if Offline property is set
  22. BOOL _bFrameIsSilent : 1; // Indicates if Silent property is set
  23. BOOL _bHyperlink : 1; // This is a hyperlink or top level request
  24. DWORD _grBindFlags; // optional additional bindinfo flags
  25. public:
  26. CStubBindStatusCallback(LPCWSTR pwzHeaders,LPCBYTE pPostData,DWORD cbPostData,
  27. VARIANT_BOOL bFrameIsOffline, VARIANT_BOOL bFrameIsSilent, BOOL bHyperlink, DWORD grBindFlags);
  28. ~CStubBindStatusCallback();
  29. // *** IUnknown methods ***
  30. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  31. virtual STDMETHODIMP_(ULONG) AddRef(void) ;
  32. virtual STDMETHODIMP_(ULONG) Release(void);
  33. // *** IBindStatusCallback ***
  34. virtual STDMETHODIMP OnStartBinding(
  35. /* [in] */ DWORD grfBSCOption,
  36. /* [in] */ IBinding *pib);
  37. virtual STDMETHODIMP GetPriority(
  38. /* [out] */ LONG *pnPriority);
  39. virtual STDMETHODIMP OnLowResource(
  40. /* [in] */ DWORD reserved);
  41. virtual STDMETHODIMP OnProgress(
  42. /* [in] */ ULONG ulProgress,
  43. /* [in] */ ULONG ulProgressMax,
  44. /* [in] */ ULONG ulStatusCode,
  45. /* [in] */ LPCWSTR szStatusText);
  46. virtual STDMETHODIMP OnStopBinding(
  47. /* [in] */ HRESULT hresult,
  48. /* [in] */ LPCWSTR szError);
  49. virtual STDMETHODIMP GetBindInfo(
  50. /* [out] */ DWORD *grfBINDINFOF,
  51. /* [unique][out][in] */ BINDINFO *pbindinfo);
  52. virtual STDMETHODIMP OnDataAvailable(
  53. /* [in] */ DWORD grfBSCF,
  54. /* [in] */ DWORD dwSize,
  55. /* [in] */ FORMATETC *pformatetc,
  56. /* [in] */ STGMEDIUM *pstgmed);
  57. virtual STDMETHODIMP OnObjectAvailable(
  58. /* [in] */ REFIID riid,
  59. /* [iid_is][in] */ IUnknown *punk);
  60. /* *** IHttpNegotiate *** */
  61. virtual STDMETHODIMP BeginningTransaction(LPCWSTR szURL, LPCWSTR szHeaders,
  62. DWORD dwReserved, LPWSTR __RPC_FAR *pszAdditionalHeaders);
  63. virtual STDMETHODIMP OnResponse(DWORD dwResponseCode, LPCWSTR szResponseHeaders,
  64. LPCWSTR szRequestHeaders, LPWSTR *pszAdditionalRequestHeaders);
  65. // IMarshal methods
  66. STDMETHODIMP GetUnmarshalClass(REFIID riid,void *pvInterface,
  67. DWORD dwDestContext,void *pvDestContext,DWORD mshlflags,CLSID *pCid);
  68. STDMETHODIMP GetMarshalSizeMax(REFIID riid,void *pvInterface,
  69. DWORD dwDestContext,void *pvDestContext,DWORD mshlflags,DWORD *pSize);
  70. STDMETHODIMP MarshalInterface(IStream *pistm,REFIID riid,
  71. void *pvInterface,DWORD dwDestContext,
  72. void *pvDestContext,DWORD mshlflags);
  73. STDMETHODIMP UnmarshalInterface(IStream *pistm,REFIID riid,void ** ppvObj);
  74. STDMETHODIMP ReleaseMarshalData(IStream *pStm);
  75. STDMETHODIMP DisconnectObject(DWORD dwReserved);
  76. // helper methods
  77. STDMETHODIMP _FreeHeadersAndPostData();
  78. BOOL _CanMarshalIID(REFIID riid);
  79. HRESULT _ValidateMarshalParams(REFIID riid,void *pvInterface,
  80. DWORD dwDestContext,void *pvDestContext,DWORD mshlflags);
  81. };
  82. // :
  83. // private flags between shdocvw and mshtml
  84. // -> should be done via bind context
  85. //
  86. #define BINDF_INLINESGETNEWESTVERSION 0x10000000
  87. #define BINDF_INLINESRESYNCHRONIZE 0x20000000
  88. #define BINDF_CONTAINER_NOWRITECACHE 0x40000000
  89. // global helper functions
  90. BOOL fOnProxy();
  91. HRESULT BuildBindInfo(DWORD *grfBINDF,BINDINFO *pbindinfo,HGLOBAL hszPostData,
  92. DWORD cbPostData, BOOL bFrameIsOffline, BOOL bFrameIsSilent, BOOL bHyperlink, LPUNKNOWN pUnkForRelease);
  93. HRESULT BuildAdditionalHeaders(LPCTSTR pszOurExtraHeaders,LPCWSTR * ppwzCombinedHeadersOut);
  94. HRESULT CStubBindStatusCallback_Create(LPCWSTR pwzHeaders, LPCBYTE pPostData,
  95. DWORD cbPostData, VARIANT_BOOL bFrameIsOffline, VARIANT_BOOL bFrameIsSilent,BOOL bHyperlink,
  96. DWORD grBindFlags,
  97. CStubBindStatusCallback ** ppBindStatusCallback);
  98. HRESULT GetHeadersAndPostData(IBindStatusCallback * pBindStatusCallback,
  99. LPTSTR * ppszHeaders, STGMEDIUM * pstgPostData, DWORD * pdwPostData, BOOL * pfUseCache);
  100. HRESULT GetTopLevelBindStatusCallback(IServiceProvider * psp,
  101. IBindStatusCallback ** ppBindStatusCallback);
  102. HRESULT GetTopLevelPendingBindStatusCallback(IServiceProvider * psp,
  103. IBindStatusCallback ** ppBindStatusCallback);
  104. #endif // _BINDCB_H_