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.

226 lines
6.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: CAsyncMk.cxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 10-25-95 JohannP (Johann Posch) Created
  15. //
  16. // Note: this class servers as a base class for async moniker
  17. //
  18. //----------------------------------------------------------------------------
  19. #include <urlint.h>
  20. #include "casyncmk.hxx"
  21. // The derived class must implement this method
  22. inline HRESULT DerivedMustImplement( void )
  23. {
  24. return E_NOTIMPL;
  25. }
  26. STDMETHODIMP CAsyncMoniker::QueryInterface
  27. (REFIID riid, LPVOID FAR* ppvObj)
  28. {
  29. VDATETHIS(this);
  30. UrlMkDebugOut((DEB_ASYNCMONIKER, "%p IN CAsyncMoniker::QueryInterface\n", this));
  31. HRESULT hresult = NOERROR;
  32. // Do not validate input as it has already been validated
  33. // by derived classes.
  34. if ( IsEqualIID(riid, IID_IMoniker)
  35. || IsEqualIID(riid, IID_IUnknown)
  36. || IsEqualIID(riid, IID_IPersistStream)
  37. || IsEqualIID(riid, IID_IInternalMoniker)
  38. || IsEqualIID(riid, IID_IAsyncMoniker)
  39. || IsEqualIID(riid, IID_IAsyncURLMoniker)
  40. )
  41. {
  42. *ppvObj = this;
  43. InterlockedIncrement((long *)&m_refs);
  44. }
  45. else
  46. {
  47. *ppvObj = NULL;
  48. hresult = E_NOINTERFACE;
  49. }
  50. UrlMkDebugOut((DEB_ASYNCMONIKER, "%p OUT CAsyncMoniker::QueryInterface\n", this));
  51. return hresult;
  52. }
  53. STDMETHODIMP_(ULONG) CAsyncMoniker::AddRef ()
  54. {
  55. ULONG crefs;
  56. UrlMkDebugOut((DEB_ASYNCMONIKER, "%p IN CAsyncMoniker::AddRef(%ld)\n", this, m_refs));
  57. crefs = InterlockedIncrement((long *)&m_refs);
  58. UrlMkDebugOut((DEB_ASYNCMONIKER, "%p OUT CAsyncMoniker::AddRef(%ld)\n", this, m_refs));
  59. return crefs;
  60. }
  61. STDMETHODIMP CAsyncMoniker::IsDirty (THIS)
  62. {
  63. VDATETHIS(this);
  64. // monikers are immutable so they are either always dirty or never dirty.
  65. HRESULT hresult = S_FALSE;
  66. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN CAsyncMoniker::(%p)\n", this));
  67. UrlMkDebugOut((DEB_ASYNCMONIKER, "OUT CAsyncMoniker::(%p) hr (%x)\n", this, hresult));
  68. return hresult;
  69. }
  70. STDMETHODIMP CAsyncMoniker::Load (THIS_ LPSTREAM pStm)
  71. {
  72. VDATETHIS(this);
  73. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  74. return DerivedMustImplement();
  75. }
  76. STDMETHODIMP CAsyncMoniker::Save (THIS_ LPSTREAM pStm,
  77. BOOL fClearDirty)
  78. {
  79. VDATETHIS(this);
  80. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  81. return DerivedMustImplement();
  82. }
  83. STDMETHODIMP CAsyncMoniker::GetSizeMax (THIS_ ULARGE_INTEGER FAR * pcbSize)
  84. {
  85. VDATETHIS(this);
  86. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  87. return DerivedMustImplement();
  88. }
  89. // *** IMoniker methods ***
  90. STDMETHODIMP CAsyncMoniker::BindToObject (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  91. REFIID riidResult, LPVOID FAR* ppvResult)
  92. {
  93. VDATETHIS(this);
  94. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  95. return DerivedMustImplement();
  96. }
  97. STDMETHODIMP CAsyncMoniker::BindToStorage (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  98. REFIID riid, LPVOID FAR* ppvObj)
  99. {
  100. VDATETHIS(this);
  101. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  102. return DerivedMustImplement();
  103. }
  104. STDMETHODIMP CAsyncMoniker::Reduce (THIS_ LPBC pbc, DWORD dwReduceHowFar, LPMONIKER FAR*
  105. ppmkToLeft, LPMONIKER FAR * ppmkReduced)
  106. {
  107. VDATETHIS(this);
  108. *ppmkReduced = this;
  109. AddRef();
  110. return ResultFromScode(MK_S_REDUCED_TO_SELF);
  111. }
  112. STDMETHODIMP CAsyncMoniker::ComposeWith (THIS_ LPMONIKER pmkRight, BOOL fOnlyIfNotGeneric,
  113. LPMONIKER FAR* ppmkComposite)
  114. {
  115. VDATETHIS(this);
  116. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  117. return DerivedMustImplement();
  118. }
  119. STDMETHODIMP CAsyncMoniker::Enum (THIS_ BOOL fForward, LPENUMMONIKER FAR* ppenumMoniker)
  120. {
  121. VDATETHIS(this);
  122. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  123. return DerivedMustImplement();
  124. }
  125. STDMETHODIMP CAsyncMoniker::IsEqual (THIS_ LPMONIKER pmkOtherMoniker)
  126. {
  127. VDATETHIS(this);
  128. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  129. return DerivedMustImplement();
  130. }
  131. STDMETHODIMP CAsyncMoniker::Hash (THIS_ LPDWORD pdwHash)
  132. {
  133. VDATETHIS(this);
  134. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  135. return DerivedMustImplement();
  136. }
  137. STDMETHODIMP CAsyncMoniker::GetTimeOfLastChange (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  138. FILETIME FAR* pfiletime)
  139. {
  140. VDATETHIS(this);
  141. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  142. return DerivedMustImplement();
  143. }
  144. STDMETHODIMP CAsyncMoniker::Inverse (THIS_ LPMONIKER FAR* ppmk)
  145. {
  146. VDATETHIS(this);
  147. *ppmk = NULL;
  148. return ResultFromScode(MK_E_NOINVERSE);
  149. }
  150. STDMETHODIMP CAsyncMoniker::CommonPrefixWith (LPMONIKER pmkOther, LPMONIKER FAR*
  151. ppmkPrefix)
  152. {
  153. VDATETHIS(this);
  154. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  155. return DerivedMustImplement();
  156. }
  157. STDMETHODIMP CAsyncMoniker::RelativePathTo (THIS_ LPMONIKER pmkOther, LPMONIKER FAR*
  158. ppmkRelPath)
  159. {
  160. VDATETHIS(this);
  161. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  162. return DerivedMustImplement();
  163. }
  164. STDMETHODIMP CAsyncMoniker::GetDisplayName (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  165. LPWSTR FAR* lplpszDisplayName)
  166. {
  167. VDATETHIS(this);
  168. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  169. return DerivedMustImplement();
  170. }
  171. STDMETHODIMP CAsyncMoniker::ParseDisplayName (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  172. LPWSTR lpszDisplayName, ULONG FAR* pchEaten,
  173. LPMONIKER FAR* ppmkOut)
  174. {
  175. VDATETHIS(this);
  176. UrlMkDebugOut((DEB_ASYNCMONIKER, "IN/OUT CAsyncMoniker::(%p) hr=E_NOTIMPL\n", this));
  177. return DerivedMustImplement();
  178. }
  179. STDMETHODIMP CAsyncMoniker::IsSystemMoniker (THIS_ LPDWORD pdwMksys)
  180. {
  181. VDATEPTROUT (pdwMksys, DWORD);
  182. *pdwMksys = 0;
  183. return NOERROR;
  184. }
  185. STDMETHODIMP CAsyncMoniker::IsRunning (THIS_ LPBC pbc, LPMONIKER pmkToLeft,
  186. LPMONIKER pmkNewlyRunning)
  187. {
  188. VDATETHIS(this);
  189. VDATEIFACE (pbc);
  190. LPRUNNINGOBJECTTABLE pROT;
  191. HRESULT hresult = S_FALSE;
  192. return hresult;
  193. }