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.

168 lines
5.9 KiB

  1. // Moniker.h -- IMoniker interface for ITSS objects
  2. #ifndef __MONIKER_H__
  3. #define __MONIKER_H__
  4. class CStorageMoniker : public CITUnknown
  5. {
  6. public:
  7. // Creator:
  8. static HRESULT CreateStorageMoniker(IUnknown *punkOuter,
  9. IBindCtx __RPC_FAR *pbc,
  10. LPOLESTR pszDisplayName,
  11. ULONG __RPC_FAR *pchEaten,
  12. IMoniker __RPC_FAR *__RPC_FAR *ppmkOut
  13. );
  14. // Destructor:
  15. ~CStorageMoniker(void);
  16. private:
  17. // Constructor:
  18. CStorageMoniker(IUnknown *punkOuter);
  19. class CImpIStorageMoniker : public IITMoniker
  20. {
  21. public:
  22. CImpIStorageMoniker(CStorageMoniker *pBackObj, IUnknown *punkOuter);
  23. ~CImpIStorageMoniker(void);
  24. HRESULT InitCreateStorageMoniker(IBindCtx __RPC_FAR *pbc,
  25. LPOLESTR pszDisplayName,
  26. ULONG __RPC_FAR *pchEaten
  27. );
  28. // IPersist methods
  29. HRESULT STDMETHODCALLTYPE GetClassID(
  30. /* [out] */ CLSID __RPC_FAR *pClassID);
  31. // IPersistStream methods
  32. HRESULT STDMETHODCALLTYPE IsDirty( void);
  33. HRESULT STDMETHODCALLTYPE Load(
  34. /* [unique][in] */ IStream __RPC_FAR *pStm);
  35. HRESULT STDMETHODCALLTYPE Save(
  36. /* [unique][in] */ IStream __RPC_FAR *pStm,
  37. /* [in] */ BOOL fClearDirty);
  38. HRESULT STDMETHODCALLTYPE GetSizeMax(
  39. /* [out] */ ULARGE_INTEGER __RPC_FAR *pcbSize);
  40. // IMoniker methods
  41. /* [local] */ HRESULT STDMETHODCALLTYPE BindToObject(
  42. /* [unique][in] */ IBindCtx __RPC_FAR *pbc,
  43. /* [unique][in] */ IMoniker __RPC_FAR *pmkToLeft,
  44. /* [in] */ REFIID riidResult,
  45. /* [out] */ void __RPC_FAR *__RPC_FAR *ppvResult);
  46. /* [local] */ HRESULT STDMETHODCALLTYPE BindToStorage(
  47. /* [unique][in] */ IBindCtx __RPC_FAR *pbc,
  48. /* [unique][in] */ IMoniker __RPC_FAR *pmkToLeft,
  49. /* [in] */ REFIID riid,
  50. /* [out] */ void __RPC_FAR *__RPC_FAR *ppvObj);
  51. HRESULT STDMETHODCALLTYPE Reduce(
  52. /* [unique][in] */ IBindCtx __RPC_FAR *pbc,
  53. /* [in] */ DWORD dwReduceHowFar,
  54. /* [unique][out][in] */ IMoniker __RPC_FAR *__RPC_FAR *ppmkToLeft,
  55. /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmkReduced);
  56. HRESULT STDMETHODCALLTYPE ComposeWith(
  57. /* [unique][in] */ IMoniker __RPC_FAR *pmkRight,
  58. /* [in] */ BOOL fOnlyIfNotGeneric,
  59. /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmkComposite);
  60. HRESULT STDMETHODCALLTYPE Enum(
  61. /* [in] */ BOOL fForward,
  62. /* [out] */ IEnumMoniker __RPC_FAR *__RPC_FAR *ppenumMoniker);
  63. HRESULT STDMETHODCALLTYPE IsEqual(
  64. /* [unique][in] */ IMoniker __RPC_FAR *pmkOtherMoniker);
  65. HRESULT STDMETHODCALLTYPE Hash(
  66. /* [out] */ DWORD __RPC_FAR *pdwHash);
  67. HRESULT STDMETHODCALLTYPE IsRunning(
  68. /* [unique][in] */ IBindCtx __RPC_FAR *pbc,
  69. /* [unique][in] */ IMoniker __RPC_FAR *pmkToLeft,
  70. /* [unique][in] */ IMoniker __RPC_FAR *pmkNewlyRunning);
  71. HRESULT STDMETHODCALLTYPE GetTimeOfLastChange(
  72. /* [unique][in] */ IBindCtx __RPC_FAR *pbc,
  73. /* [unique][in] */ IMoniker __RPC_FAR *pmkToLeft,
  74. /* [out] */ FILETIME __RPC_FAR *pFileTime);
  75. HRESULT STDMETHODCALLTYPE Inverse(
  76. /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmk);
  77. HRESULT STDMETHODCALLTYPE CommonPrefixWith(
  78. /* [unique][in] */ IMoniker __RPC_FAR *pmkOther,
  79. /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmkPrefix);
  80. HRESULT STDMETHODCALLTYPE RelativePathTo(
  81. /* [unique][in] */ IMoniker __RPC_FAR *pmkOther,
  82. /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmkRelPath);
  83. HRESULT STDMETHODCALLTYPE GetDisplayName(
  84. /* [unique][in] */ IBindCtx __RPC_FAR *pbc,
  85. /* [unique][in] */ IMoniker __RPC_FAR *pmkToLeft,
  86. /* [out] */ LPOLESTR __RPC_FAR *ppszDisplayName);
  87. HRESULT STDMETHODCALLTYPE ParseDisplayName(
  88. /* [unique][in] */ IBindCtx __RPC_FAR *pbc,
  89. /* [unique][in] */ IMoniker __RPC_FAR *pmkToLeft,
  90. /* [in] */ LPOLESTR pszDisplayName,
  91. /* [out] */ ULONG __RPC_FAR *pchEaten,
  92. /* [out] */ IMoniker __RPC_FAR *__RPC_FAR *ppmkOut);
  93. HRESULT STDMETHODCALLTYPE IsSystemMoniker(
  94. /* [out] */ DWORD __RPC_FAR *pdwMksys);
  95. private:
  96. HRESULT STDMETHODCALLTYPE OpenRootStorage(DWORD grfMode);
  97. IStorage *m_pStorageRoot; // Initially Null; Set when we instantiate
  98. // the storage corresponding to the moniker
  99. WCHAR m_awszStorageFile[MAX_PATH]; // Path to root storage object
  100. WCHAR m_awszStoragePath[MAX_PATH]; // Path within storage object
  101. #ifdef IE30Hack
  102. CHAR m_acsTempFile[MAX_PATH];
  103. CHAR *m_pcsDisplayName;
  104. #endif // IE30Hack
  105. };
  106. CImpIStorageMoniker m_ImpIStorageMoniker;
  107. };
  108. typedef CStorageMoniker *PCStorageMoniker;
  109. extern GUID aIID_CStorageMoniker[];
  110. extern UINT cInterfaces_CStorageMoniker;
  111. inline CStorageMoniker::CStorageMoniker(IUnknown *pUnkOuter)
  112. : m_ImpIStorageMoniker(this, pUnkOuter),
  113. CITUnknown(aIID_CStorageMoniker, cInterfaces_CStorageMoniker, &m_ImpIStorageMoniker)
  114. {
  115. }
  116. inline CStorageMoniker::~CStorageMoniker(void)
  117. {
  118. }
  119. HRESULT STDMETHODCALLTYPE FindRootStorageFile(WCHAR * pwszStorageFile);
  120. #endif // __MONIKER_H__