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.

118 lines
4.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: urlmk.hxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 12-12-95 JohannP (Johann Posch) Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef URLMK_HXX
  18. #define URLMK_HXX
  19. // These two structures are used to pass data from the inloader callbacks
  20. // to the wndproc of the hidden window in the main thread.
  21. class CUrlMon;
  22. // Declaration of CUrlMon. This class implements IMoniker.
  23. // class declaration of CUrlMon. This class derives from IMoniker.
  24. class CUrlMon : public IMoniker, public IROTData, public IMarshal
  25. {
  26. public:
  27. CUrlMon(LPWSTR szUrl);
  28. ~CUrlMon();
  29. LPWSTR GetUrl() { return _pwzUrl; }
  30. private:
  31. void DeleteUrl();
  32. HRESULT SetUrl(LPWSTR pwzUrl, LPWSTR pwzExtra = NULL);
  33. HRESULT IsRunningROT(IBindCtx *pbc, IMoniker *pmkToLeft,LPRUNNINGOBJECTTABLE *ppROT);
  34. BOOL IsUrlMoniker(IMoniker *pMk);
  35. STDMETHODIMP StartBinding(BOOL fBindToObject, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, void **ppvObj);
  36. public:
  37. // *** IUnknown methods ***
  38. STDMETHODIMP QueryInterface(REFIID iid, void **ppvObj);
  39. STDMETHODIMP_(ULONG) AddRef(void);
  40. STDMETHODIMP_(ULONG) Release(void);
  41. // *** IPerist methods ***
  42. STDMETHODIMP GetClassID(CLSID *pClassID);
  43. // *** IPeristStream methods ***
  44. STDMETHODIMP IsDirty();
  45. STDMETHODIMP Load(IStream *pistm);
  46. STDMETHODIMP Save(IStream *pistm, BOOL fClearDirty);
  47. STDMETHODIMP GetSizeMax(ULARGE_INTEGER *pcbSize);
  48. // *** IMoniker methods ***
  49. STDMETHODIMP BindToObject(IBindCtx *pbc, IMoniker *pmkToLeft,
  50. REFIID riidResult, void **ppvResult);
  51. STDMETHODIMP BindToStorage(IBindCtx *pbc, IMoniker *pmkToLeft,
  52. REFIID riid, void **ppvObj);
  53. STDMETHODIMP Reduce(IBindCtx *pbc, DWORD dwReduceHowFar,
  54. IMoniker **ppmkToLeft, IMoniker **ppmkReduced);
  55. STDMETHODIMP ComposeWith(IMoniker *pmkRight, BOOL fOnlyIfNotGeneric,
  56. IMoniker **ppmkComposite);
  57. STDMETHODIMP Enum(BOOL fForward, IEnumMoniker **ppenumMoniker);
  58. STDMETHODIMP IsEqual(IMoniker *pmkOtherMoniker);
  59. STDMETHODIMP Hash(DWORD *pdwHash);
  60. STDMETHODIMP IsRunning(IBindCtx *pbc, IMoniker *pmkToLeft,
  61. IMoniker *pmkNewlyRunning);
  62. STDMETHODIMP GetTimeOfLastChange(IBindCtx *pbc, IMoniker *pmkToLeft,
  63. FILETIME *pFileTime);
  64. STDMETHODIMP Inverse(IMoniker **ppmk);
  65. STDMETHODIMP CommonPrefixWith(IMoniker *pmkOther, IMoniker **ppmkPrefix);
  66. STDMETHODIMP RelativePathTo(IMoniker *pmkOther, IMoniker **ppmkRelPath);
  67. STDMETHODIMP GetDisplayName(IBindCtx *pbc, IMoniker *pmkToLeft,
  68. LPOLESTR *ppszDisplayName);
  69. STDMETHODIMP ParseDisplayName(IBindCtx *pbc, IMoniker *pmkToLeft,
  70. LPOLESTR pszDisplayName, ULONG *pchEaten,
  71. IMoniker **ppmkOut);
  72. STDMETHODIMP IsSystemMoniker(DWORD *pdwMksys);
  73. public:
  74. //
  75. // *** IMarshal methods ***
  76. STDMETHODIMP GetUnmarshalClass(REFIID riid, void *pvInterface, DWORD dwDestContext,
  77. void *pvDestContext, DWORD mshlflags, CLSID *pCid);
  78. STDMETHODIMP GetMarshalSizeMax(REFIID riid, void *pvInterface, DWORD dwDestContext,
  79. void *pvDestContext, DWORD mshlflags, DWORD *pSize);
  80. STDMETHODIMP MarshalInterface(IStream *pStm, REFIID riid, void *pvInteface, DWORD dwDestContext,
  81. void *pvDestContext, DWORD mshlflags);
  82. STDMETHODIMP UnmarshalInterface(IStream *pStm, REFIID riid, void **ppv);
  83. STDMETHODIMP ReleaseMarshalData(IStream *pStm);
  84. STDMETHODIMP DisconnectObject(DWORD dwReserved);
  85. private:
  86. inline BOOL CanMarshalIID(REFIID riid);
  87. HRESULT ValidateMarshalParams(REFIID riid, void *pvInterface, DWORD dwDestContext,
  88. void *pvDestContext,DWORD mshlflags);
  89. public:
  90. // *** IROTData methods ***
  91. STDMETHODIMP GetComparisonData(byte *pbData, ULONG cbMax, ULONG *pcbData);
  92. private:
  93. CRefCount _CRefs; // refcount class
  94. LPWSTR _pwzUrl; // the url string
  95. };
  96. #endif // URLMK_HXX