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.

298 lines
7.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: agent.CXX
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 11-21-1996 JohannP (Johann Posch) Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #include <agent.h>
  18. //+---------------------------------------------------------------------------
  19. //
  20. // Method: COInetAgent::QueryInterface
  21. //
  22. // Synopsis:
  23. //
  24. // Arguments: [riid] --
  25. // [ppvObj] --
  26. //
  27. // Returns:
  28. //
  29. // History: 11-22-96 JohannP (Johann Posch) Created
  30. //
  31. // Notes:
  32. //
  33. //----------------------------------------------------------------------------
  34. STDMETHODIMP COInetAgent::QueryInterface(REFIID riid, void **ppvObj)
  35. {
  36. VDATEPTROUT(ppvObj, void *);
  37. VDATETHIS(this);
  38. HRESULT hr = NOERROR;
  39. TransDebugOut((DEB_SESSION, "%p _IN COInetAgent::QueryInterface\n", this));
  40. *ppvObj = NULL;
  41. if ((riid == IID_IUnknown) || (riid == IID_IOInetSession) )
  42. {
  43. *ppvObj = this;
  44. AddRef();
  45. }
  46. else
  47. {
  48. hr = E_NOINTERFACE;
  49. }
  50. TransDebugOut((DEB_SESSION, "%p OUT COInetAgent::QueryInterface (hr:%lx\n", this,hr));
  51. return hr;
  52. }
  53. //+---------------------------------------------------------------------------
  54. //
  55. // Function: COInetAgent::AddRef
  56. //
  57. // Synopsis:
  58. //
  59. // Arguments: [ULONG] --
  60. //
  61. // Returns:
  62. //
  63. // History: 11-22-96 JohannP (Johann Posch) Created
  64. //
  65. // Notes:
  66. //
  67. //----------------------------------------------------------------------------
  68. STDMETHODIMP_(ULONG) COInetAgent::AddRef(void)
  69. {
  70. TransDebugOut((DEB_SESSION, "%p _IN COInetAgent::AddRef\n", this));
  71. LONG lRet = ++_CRefs;
  72. TransDebugOut((DEB_SESSION, "%p OUT COInetAgent::AddRef (cRefs:%ld)\n", this,lRet));
  73. return lRet;
  74. }
  75. //+---------------------------------------------------------------------------
  76. //
  77. // Function: COInetAgent::Release
  78. //
  79. // Synopsis:
  80. //
  81. // Arguments: [ULONG] --
  82. //
  83. // Returns:
  84. //
  85. // History: 11-22-96 JohannP (Johann Posch) Created
  86. //
  87. // Notes:
  88. //
  89. //----------------------------------------------------------------------------
  90. STDMETHODIMP_(ULONG) COInetAgent::Release(void)
  91. {
  92. TransDebugOut((DEB_SESSION, "%p _IN COInetAgent::Release\n", this));
  93. LONG lRet = --_CRefs;
  94. if (_CRefs == 0)
  95. {
  96. // this is global
  97. //delete this;
  98. }
  99. TransDebugOut((DEB_SESSION, "%p OUT COInetAgent::Release (cRefs:%ld)\n",this,lRet));
  100. return lRet;
  101. }
  102. STDMETHODIMP COInetAgent::StartListen(
  103. const LPCWSTR szProtocol,
  104. IOInetItemFilter *pWChkItemFilter,
  105. DWORD grfFilterMode,
  106. CLSID *pclsidProtocol,
  107. DWORD dwReserved
  108. )
  109. {
  110. TransDebugOut((DEB_PROT, "%p _IN COInetAgent::StartListen\n", this));
  111. HRESULT hr = E_FAIL;
  112. TransDebugOut((DEB_PROT, "%p OUT COInetAgent::StartListen (hr:%lx)\n",this, hr));
  113. return hr;
  114. }
  115. // will release the sink passed in at StartListen
  116. STDMETHODIMP COInetAgent::StopListen(CLSID *pclsidProtocol)
  117. {
  118. TransDebugOut((DEB_PROT, "%p _IN COInetAgent::StopListen\n", this));
  119. HRESULT hr = E_FAIL;
  120. TransDebugOut((DEB_PROT, "%p OUT COInetAgent::StopListen (hr:%lx)\n",this, hr));
  121. return hr;
  122. }
  123. // add item to the spooler
  124. STDMETHODIMP COInetAgent::ScheduleItem(
  125. IOInetItem *pWChkItem,
  126. IOInetDestination *pWChkDest,
  127. SCHEDULEDATA *pschdata,
  128. DWORD dwMode,
  129. DWORD *pdwCookie
  130. )
  131. {
  132. TransDebugOut((DEB_PROT, "%p _IN COInetAgent::ScheduleItem\n", this));
  133. HRESULT hr = E_FAIL;
  134. TransDebugOut((DEB_PROT, "%p OUT COInetAgent::ScheduleItem (hr:%lx)\n",this, hr));
  135. return hr;
  136. }
  137. STDMETHODIMP COInetAgent::RevokeItem(DWORD dwCookie)
  138. {
  139. TransDebugOut((DEB_PROT, "%p _IN COInetAgent::RevokeItem\n", this));
  140. HRESULT hr = E_FAIL;
  141. TransDebugOut((DEB_PROT, "%p OUT COInetAgent::RevokeItem (hr:%lx)\n",this, hr));
  142. return hr;
  143. }
  144. #if 0
  145. //+---------------------------------------------------------------------------
  146. //
  147. // Method: COInetItem::QueryInterface
  148. //
  149. // Synopsis:
  150. //
  151. // Arguments: [riid] --
  152. // [ppvObj] --
  153. //
  154. // Returns:
  155. //
  156. // History: 11-22-96 JohannP (Johann Posch) Created
  157. //
  158. // Notes:
  159. //
  160. //----------------------------------------------------------------------------
  161. STDMETHODIMP COInetItem::QueryInterface(REFIID riid, void **ppvObj)
  162. {
  163. VDATEPTROUT(ppvObj, void *);
  164. VDATETHIS(this);
  165. HRESULT hr = NOERROR;
  166. TransDebugOut((DEB_SESSION, "%p _IN COInetItem::QueryInterface\n", this));
  167. *ppvObj = NULL;
  168. if ((riid == IID_IUnknown) || (riid == IID_IOInetSession) )
  169. {
  170. *ppvObj = this;
  171. AddRef();
  172. }
  173. else
  174. {
  175. hr = E_NOINTERFACE;
  176. }
  177. TransDebugOut((DEB_SESSION, "%p OUT COInetItem::QueryInterface (hr:%lx\n", this,hr));
  178. return hr;
  179. }
  180. //+---------------------------------------------------------------------------
  181. //
  182. // Function: COInetItem::AddRef
  183. //
  184. // Synopsis:
  185. //
  186. // Arguments: [ULONG] --
  187. //
  188. // Returns:
  189. //
  190. // History: 11-22-96 JohannP (Johann Posch) Created
  191. //
  192. // Notes:
  193. //
  194. //----------------------------------------------------------------------------
  195. STDMETHODIMP_(ULONG) COInetItem::AddRef(void)
  196. {
  197. TransDebugOut((DEB_SESSION, "%p _IN COInetItem::AddRef\n", this));
  198. LONG lRet = ++_CRefs;
  199. TransDebugOut((DEB_SESSION, "%p OUT COInetItem::AddRef (cRefs:%ld)\n", this,lRet));
  200. return lRet;
  201. }
  202. //+---------------------------------------------------------------------------
  203. //
  204. // Function: COInetItem::Release
  205. //
  206. // Synopsis:
  207. //
  208. // Arguments: [ULONG] --
  209. //
  210. // Returns:
  211. //
  212. // History: 11-22-96 JohannP (Johann Posch) Created
  213. //
  214. // Notes:
  215. //
  216. //----------------------------------------------------------------------------
  217. STDMETHODIMP_(ULONG) COInetItem::Release(void)
  218. {
  219. TransDebugOut((DEB_SESSION, "%p _IN COInetItem::Release\n", this));
  220. LONG lRet = --_CRefs;
  221. if (_CRefs == 0)
  222. {
  223. //delete this;
  224. }
  225. TransDebugOut((DEB_SESSION, "%p OUT COInetItem::Release (cRefs:%ld)\n",this,lRet));
  226. return lRet;
  227. }
  228. STDMETHODIMP COInetItem::GetURL(LPOLESTR *ppwzUrl)
  229. {
  230. TransDebugOut((DEB_PROT, "%p _IN COInetItem::GetURL\n", this));
  231. HRESULT hr = E_FAIL;
  232. TransDebugOut((DEB_PROT, "%p OUT COInetItem::GetURL (hr:%lx)\n",this, hr));
  233. return hr;
  234. }
  235. STDMETHODIMP COInetItem::GetInfo(
  236. DWORD dwOptions,
  237. LPOLESTR *ppwzItemMime,
  238. LPCLSID *pclsidItem,
  239. LPOLESTR *ppwzProtocol,
  240. LPCLSID *pclsidProtocol,
  241. DWORD *pdwOut
  242. )
  243. {
  244. TransDebugOut((DEB_PROT, "%p _IN COInetItem::GetInfo\n", this));
  245. HRESULT hr = E_FAIL;
  246. TransDebugOut((DEB_PROT, "%p OUT COInetItem::GetInfo (hr:%lx)\n",this, hr));
  247. return hr;
  248. }
  249. STDMETHODIMP COInetItem::GetItemData(DWORD *grfITEMF,ITEMDATA * pitemdata)
  250. {
  251. TransDebugOut((DEB_PROT, "%p _IN COInetItem::GetItemData\n", this));
  252. HRESULT hr = E_FAIL;
  253. TransDebugOut((DEB_PROT, "%p OUT COInetItem::GetItemData (hr:%lx)\n",this, hr));
  254. return hr;
  255. }
  256. #endif // 0