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.

90 lines
2.5 KiB

  1. // BSCB.h -- Class definition for an IBindStatusCallback hook
  2. #ifndef __BSCB_H__
  3. #define __BSCB_H__
  4. class CBindStatusCallBack : public ITBindStatusCallBack
  5. {
  6. public:
  7. static HRESULT STDMETHODCALLTYPE CreateHook(IBindCtx pBC, IMoniker pMK);
  8. ~CBindStatusCallBack();
  9. private:
  10. CBindStatusCallBack(IUnknown *pUnkOuter);
  11. class Implementation : ITBindStatusCallback
  12. {
  13. Implementation(CBindStatusCallBack *pBackObj, IUnknown *punkOuter);
  14. ~Implementation();
  15. HRESULT STDMETHODCALLTYPE Init(IBindCtx pBC, IMoniker pMK);
  16. // IBindStatusCallback methods:
  17. HRESULT STDMETHODCALLTYPE OnStartBinding(
  18. /* [in] */ DWORD dwReserved,
  19. /* [in] */ IBinding __RPC_FAR *pib);
  20. HRESULT STDMETHODCALLTYPE GetPriority(
  21. /* [out] */ LONG __RPC_FAR *pnPriority);
  22. HRESULT STDMETHODCALLTYPE OnLowResource(
  23. /* [in] */ DWORD reserved);
  24. HRESULT STDMETHODCALLTYPE OnProgress(
  25. /* [in] */ ULONG ulProgress,
  26. /* [in] */ ULONG ulProgressMax,
  27. /* [in] */ ULONG ulStatusCode,
  28. /* [in] */ LPCWSTR szStatusText);
  29. HRESULT STDMETHODCALLTYPE OnStopBinding(
  30. /* [in] */ HRESULT hresult,
  31. /* [unique][in] */ LPCWSTR szError);
  32. /* [local] */ HRESULT STDMETHODCALLTYPE GetBindInfo(
  33. /* [out] */ DWORD __RPC_FAR *grfBINDF,
  34. /* [unique][out][in] */ BINDINFO __RPC_FAR *pbindinfo);
  35. /* [local] */ HRESULT STDMETHODCALLTYPE OnDataAvailable(
  36. /* [in] */ DWORD grfBSCF,
  37. /* [in] */ DWORD dwSize,
  38. /* [in] */ FORMATETC __RPC_FAR *pformatetc,
  39. /* [in] */ STGMEDIUM __RPC_FAR *pstgmed);
  40. HRESULT STDMETHODCALLTYPE OnObjectAvailable(
  41. /* [in] */ REFIID riid,
  42. /* [iid_is][in] */ IUnknown __RPC_FAR *punk);
  43. private:
  44. IBindCtx *m_pBCHooked;
  45. IBindStatusCallback *m_pBSCBClient;
  46. IStream *m_pStream;
  47. DWORD m_grfBINDF;
  48. BINDINFO m_bindinfo;
  49. char m_awcsFile[MAX_PATH];
  50. BOOL m_fTempFile;
  51. };
  52. Implementation m_Implementation;
  53. };
  54. inline CBindStatusCallBack::CBindStatusCallBack(IUnknown *pUnkOuter)
  55. : m_Implementation(this, pUnkOuter),
  56. CITUnknown(&IID_IBindStatusCallback, 1, &m_Implementation)
  57. {
  58. }
  59. inline CBindStatusCallBack::~CBindStatusCallBack()
  60. {
  61. }
  62. HRESULT STDMETHODCALLTYPE CopyStreamToFile(IStream **ppStreamSrc, const WCHAR *pwcsFilePath);
  63. HRESULT STDMETHODCALLTYPE GetStreamFromMoniker
  64. (IBindCtx *pBC, IMoniker *pMK, DWORD grfBINDF, PWCHAR pwcsFile, IStream **ppStrm);
  65. #endif // __BSCB_H__