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.

5024 lines
233 KiB

  1. // --------------------------------------------------------------------------------
  2. // IMNXPORT.IDL
  3. // Copyright (c)1993-1998 Microsoft Corporation, All Rights Reserved
  4. //
  5. // Authors:
  6. // Steven J. Bailey (sbailey)
  7. // Steve Serdy (steveser)
  8. // Raymond Cheng (raych)
  9. // Greg Friedman (gregfrie)
  10. //
  11. // Date: 11/12/96
  12. // --------------------------------------------------------------------------------
  13. import "imnact.idl";
  14. interface IInternetTransport;
  15. interface ISMTPTransport;
  16. interface IPOP3Transport;
  17. interface INNTPTransport;
  18. interface IRASTransport;
  19. interface IIMAPTransport;
  20. interface IHTTPMailTransport;
  21. interface IPropFindResponse;
  22. // OE team hasn't fixed their idl to avoid the Win64 midl warnings - turn it off
  23. midl_pragma warning(disable:2395)
  24. cpp_quote("//--------------------------------------------------------------------------------")
  25. cpp_quote("// IMNXPORT.H")
  26. cpp_quote("//--------------------------------------------------------------------------------")
  27. cpp_quote("// (C) Copyright 1995-1998 Microsoft Corporation. All Rights Reserved.")
  28. cpp_quote("//")
  29. cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
  30. cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
  31. cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
  32. cpp_quote("// PARTICULAR PURPOSE.")
  33. cpp_quote("//--------------------------------------------------------------------------------")
  34. cpp_quote("")
  35. cpp_quote("#pragma comment(lib,\"uuid.lib\")")
  36. cpp_quote("// --------------------------------------------------------------------------------")
  37. cpp_quote("// Dependencies")
  38. cpp_quote("// --------------------------------------------------------------------------------")
  39. cpp_quote("#include <ras.h>")
  40. cpp_quote("#include <raserror.h>")
  41. cpp_quote("")
  42. cpp_quote("// --------------------------------------------------------------------------------")
  43. cpp_quote("// GUIDS")
  44. cpp_quote("// --------------------------------------------------------------------------------")
  45. cpp_quote("// {CA30CC91-B1B3-11d0-85D0-00C04FD85AB4}")
  46. cpp_quote("DEFINE_GUID(CLSID_IInternetMessageUrl, 0xca30cc91, 0xb1b3, 0x11d0, 0x85, 0xd0, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  47. cpp_quote("")
  48. cpp_quote("// {0DF2C7E1-3435-11d0-81D0-00C04FD85AB4}")
  49. cpp_quote("DEFINE_GUID(IID_ITransportCallback, 0xdf2c7e1, 0x3435, 0x11d0, 0x81, 0xd0, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  50. cpp_quote("")
  51. cpp_quote("// {1F636C01-364E-11d0-81D3-00C04FD85AB4}")
  52. cpp_quote("DEFINE_GUID(IID_IInternetTransport, 0x1f636c01, 0x364e, 0x11d0, 0x81, 0xd3, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  53. cpp_quote("")
  54. cpp_quote("// {1F636C02-364E-11d0-81D3-00C04FD85AB4}")
  55. cpp_quote("DEFINE_GUID(IID_ISMTPCallback, 0x1f636c02, 0x364e, 0x11d0, 0x81, 0xd3, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  56. cpp_quote("")
  57. cpp_quote("// {FD853CE6-7F86-11d0-8252-00C04FD85AB4}")
  58. cpp_quote("DEFINE_GUID(CLSID_ISMTPTransport, 0xfd853ce6, 0x7f86, 0x11d0, 0x82, 0x52, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  59. cpp_quote("// {0DF2C7E2-3435-11d0-81D0-00C04FD85AB4}")
  60. cpp_quote("DEFINE_GUID(IID_ISMTPTransport, 0xdf2c7e2, 0x3435, 0x11d0, 0x81, 0xd0, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  61. cpp_quote("// {0DF2C7EC-3435-11d0-81D0-00C04FD85AB4}")
  62. cpp_quote("DEFINE_GUID(IID_ISMTPTransport2, 0xdf2c7eC, 0x3435, 0x11d0, 0x81, 0xd0, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  63. cpp_quote("")
  64. cpp_quote("// {0DF2C7E3-3435-11d0-81D0-00C04FD85AB4}")
  65. cpp_quote("DEFINE_GUID(IID_IPOP3Callback, 0xdf2c7e3, 0x3435, 0x11d0, 0x81, 0xd0, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  66. cpp_quote("")
  67. cpp_quote("// {FD853CE7-7F86-11d0-8252-00C04FD85AB4}")
  68. cpp_quote("DEFINE_GUID(CLSID_IPOP3Transport, 0xfd853ce7, 0x7f86, 0x11d0, 0x82, 0x52, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  69. cpp_quote("// {0DF2C7E4-3435-11d0-81D0-00C04FD85AB4}")
  70. cpp_quote("DEFINE_GUID(IID_IPOP3Transport, 0xdf2c7e4, 0x3435, 0x11d0, 0x81, 0xd0, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  71. cpp_quote("")
  72. cpp_quote("// {0DF2C7E5-3435-11d0-81D0-00C04FD85AB4}")
  73. cpp_quote("DEFINE_GUID(IID_INNTPCallback, 0xdf2c7e5, 0x3435, 0x11d0, 0x81, 0xd0, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  74. cpp_quote("")
  75. cpp_quote("// {FD853CE8-7F86-11d0-8252-00C04FD85AB4}")
  76. cpp_quote("DEFINE_GUID(CLSID_INNTPTransport, 0xfd853ce8, 0x7f86, 0x11d0, 0x82, 0x52, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  77. cpp_quote("// {0DF2C7E6-3435-11d0-81D0-00C04FD85AB4}")
  78. cpp_quote("DEFINE_GUID(IID_INNTPTransport, 0xdf2c7e6, 0x3435, 0x11d0, 0x81, 0xd0, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  79. cpp_quote("// {0DF2C7ED-3435-11d0-81D0-00C04FD85AB4}")
  80. cpp_quote("DEFINE_GUID(IID_INNTPTransport2, 0xdf2c7eD, 0x3435, 0x11d0, 0x81, 0xd0, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  81. cpp_quote("")
  82. cpp_quote("// {36D88911-3CD6-11d0-81DF-00C04FD85AB4}")
  83. cpp_quote("DEFINE_GUID(IID_IRASCallback, 0x36d88911, 0x3cd6, 0x11d0, 0x81, 0xdf, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  84. cpp_quote("")
  85. cpp_quote("// {FD853CE9-7F86-11d0-8252-00C04FD85AB4}")
  86. cpp_quote("DEFINE_GUID(CLSID_IRASTransport, 0xfd853ce9, 0x7f86, 0x11d0, 0x82, 0x52, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  87. cpp_quote("// {8A950001-3CCF-11d0-81DF-00C04FD85AB4}")
  88. cpp_quote("DEFINE_GUID(IID_IRASTransport, 0x8a950001, 0x3ccf, 0x11d0, 0x81, 0xdf, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  89. cpp_quote("")
  90. cpp_quote("// {FD853CEA-7F86-11d0-8252-00C04FD85AB4}")
  91. cpp_quote("DEFINE_GUID(CLSID_IRangeList, 0xfd853cea, 0x7f86, 0x11d0, 0x82, 0x52, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  92. cpp_quote("// {8C438160-4EF6-11d0-874F-00AA00530EE9}")
  93. cpp_quote("DEFINE_GUID(IID_IRangeList, 0x8c438160, 0x4ef6, 0x11d0, 0x87, 0x4f, 0x0, 0xaa, 0x0, 0x53, 0xe, 0xe9);")
  94. cpp_quote("")
  95. cpp_quote("// {E9E9D8A3-4EDD-11d0-874F-00AA00530EE9}")
  96. cpp_quote("DEFINE_GUID(IID_IIMAPCallback, 0xe9e9d8a3, 0x4edd, 0x11d0, 0x87, 0x4f, 0x0, 0xaa, 0x0, 0x53, 0xe, 0xe9);")
  97. cpp_quote("")
  98. cpp_quote("// {FD853CEB-7F86-11d0-8252-00C04FD85AB4}")
  99. cpp_quote("DEFINE_GUID(CLSID_IIMAPTransport, 0xfd853ceb, 0x7f86, 0x11d0, 0x82, 0x52, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  100. cpp_quote("// {E9E9D8A8-4EDD-11d0-874F-00AA00530EE9}")
  101. cpp_quote("DEFINE_GUID(IID_IIMAPTransport, 0xe9e9d8a8, 0x4edd, 0x11d0, 0x87, 0x4f, 0x0, 0xaa, 0x0, 0x53, 0xe, 0xe9);")
  102. cpp_quote("")
  103. cpp_quote("// {DA8283C0-37C5-11d2-ACD9-0080C7B6E3C5}")
  104. cpp_quote("DEFINE_GUID(IID_IIMAPTransport2, 0xda8283c0, 0x37c5, 0x11d2, 0xac, 0xd9, 0x0, 0x80, 0xc7, 0xb6, 0xe3, 0xc5);")
  105. cpp_quote("")
  106. cpp_quote("// {07849A11-B520-11d0-85D5-00C04FD85AB4}")
  107. cpp_quote("DEFINE_GUID(IID_IBindMessageStream, 0x7849a11, 0xb520, 0x11d0, 0x85, 0xd5, 0x0, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
  108. cpp_quote("")
  109. cpp_quote("// {CA30F3FF-C9AC-11d1-9A3A-00C04FA309D4}")
  110. cpp_quote("DEFINE_GUID(IID_ITransportCallbackService, 0xca30f3ff, 0xc9ac, 0x11d1, 0x9a, 0x3a, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);")
  111. cpp_quote("")
  112. cpp_quote("// {19F6481C-E5F0-11d1-A86E-0000F8084F96}")
  113. cpp_quote("DEFINE_GUID(IID_IHTTPMailCallback, 0x19f6481c, 0xe5f0, 0x11d1, 0xa8, 0x6e, 0x0, 0x0, 0xf8, 0x8, 0x4f, 0x96);")
  114. cpp_quote("")
  115. cpp_quote("// {5A580C11-E5EB-11d1-A86E-0000F8084F96}")
  116. cpp_quote("DEFINE_GUID(CLSID_IHTTPMailTransport,0x5a580c11, 0xe5eb, 0x11d1, 0xa8, 0x6e, 0x0, 0x0, 0xf8, 0x8, 0x4f, 0x96);")
  117. cpp_quote("// {B8BDE03C-E548-11d1-A86E-0000F8084F96}")
  118. cpp_quote("DEFINE_GUID(IID_IHTTPMailTransport, 0xb8bde03c, 0xe548, 0x11d1, 0xa8, 0x6e, 0x0, 0x0, 0xf8, 0x8, 0x4f, 0x96);")
  119. cpp_quote("")
  120. cpp_quote("// {82758005-D38A-11d3-8E81-00C04F79E13B}")
  121. cpp_quote("DEFINE_GUID(IID_IHTTPMailTransport2, 0x82758005, 0xd38a, 0x11d3, 0x8e, 0x81, 0x0, 0xc0, 0x4f, 0x79, 0xe1, 0x3b);")
  122. cpp_quote("")
  123. cpp_quote("// {BB847B8A-054A-11d2-A894-0000F8084F96}")
  124. cpp_quote("DEFINE_GUID(CLSID_IPropFindRequest, 0xbb847b8a, 0x54a, 0x11d2, 0xa8, 0x94, 0x0, 0x0, 0xf8, 0x8, 0x4f, 0x96);")
  125. cpp_quote("// {5CFC6308-0544-11d2-A894-0000F8084F96}")
  126. cpp_quote("DEFINE_GUID(IID_IPropFindRequest, 0x5cfc6308, 0x544, 0x11d2, 0xa8, 0x94, 0x0, 0x0, 0xf8, 0x8, 0x4f, 0x96);")
  127. cpp_quote("")
  128. cpp_quote("// {0DEE87DE-0547-11d2-A894-0000F8084F96}")
  129. cpp_quote("DEFINE_GUID(IID_IPropFindMultiResponse, 0xdee87de, 0x547, 0x11d2, 0xa8, 0x94, 0x0, 0x0, 0xf8, 0x8, 0x4f, 0x96);")
  130. cpp_quote("")
  131. cpp_quote("// {8A523716-0548-11d2-A894-0000F8084F96}")
  132. cpp_quote("DEFINE_GUID(IID_IPropFindResponse, 0x8a523716, 0x548, 0x11d2, 0xa8, 0x94, 0x0, 0x0, 0xf8, 0x8, 0x4f, 0x96);")
  133. cpp_quote("")
  134. cpp_quote("// {72A58FF8-227D-11d2-A8B5-0000F8084F96}")
  135. cpp_quote("DEFINE_GUID(IID_IDAVNamespaceArbiter, 0x72a58ff8, 0x227d, 0x11d2, 0xa8, 0xb5, 0x0, 0x0, 0xf8, 0x8, 0x4f, 0x96);")
  136. cpp_quote("")
  137. cpp_quote("// {EA678830-235D-11d2-A8B6-0000F8084F96}")
  138. cpp_quote("DEFINE_GUID(CLSID_IPropPatchRequest, 0xea678830, 0x235d, 0x11d2, 0xa8, 0xb6, 0x0, 0x0, 0xf8, 0x8, 0x4f, 0x96);")
  139. cpp_quote("// {AB8B8D2A-227F-11d2-A8B5-0000F8084F96}")
  140. cpp_quote("DEFINE_GUID(IID_IPropPatchRequest, 0xab8b8d2a, 0x227f, 0x11d2, 0xa8, 0xb5, 0x0, 0x0, 0xf8, 0x8, 0x4f, 0x96);")
  141. cpp_quote("")
  142. cpp_quote("// --------------------------------------------------------------------------------")
  143. cpp_quote("// Errors")
  144. cpp_quote("// --------------------------------------------------------------------------------")
  145. //;begin_internal
  146. //
  147. // NOTE: All inetcomm error codes must reside between CC00 and CFFF (a 1k block).
  148. // This has been approved by Johann Posch (johannp)
  149. // We further subdivide this range as follows:
  150. // CC00-CCFF IMNXPORT results
  151. // CD00-CDFF IMNACCT results
  152. // CE00-CEFF MIMEOLE results
  153. // CF00-CFFF undefined, do not use
  154. // (t-erikne 03/24/97)
  155. //
  156. //;end_internal
  157. cpp_quote("#ifndef FACILITY_INTERNET")
  158. cpp_quote("#define FACILITY_INTERNET 12")
  159. cpp_quote("#endif")
  160. cpp_quote("#ifndef HR_E")
  161. cpp_quote("#define HR_E(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_INTERNET, n)")
  162. cpp_quote("#endif")
  163. cpp_quote("#ifndef HR_S")
  164. cpp_quote("#define HR_S(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_INTERNET, n)")
  165. cpp_quote("#endif")
  166. cpp_quote("#ifndef HR_CODE")
  167. cpp_quote("#define HR_CODE(hr) (INT)(hr & 0xffff)")
  168. cpp_quote("#endif")
  169. cpp_quote("")
  170. //;begin_internal
  171. // HRESULTS are even further subdivided in this file
  172. // NOTE: you should never progammatically rely on this ordering
  173. // it simply gives you a visual cue in the DOUTs
  174. // CC00-CC2F General
  175. // CC30-CC3F HTTPMail (first range)
  176. // CC40-CC5F WINSOCK
  177. // CC60-CC8F SMTP
  178. // CC90-CC9F POP3
  179. // CCA0-CCBF NNTP
  180. // CCC0-CCCF RAS
  181. // CCD0-CCEF IMAP
  182. // CCF0-CCFF HTTPMail (second range)
  183. //;end_internal
  184. cpp_quote("// --------------------------------------------------------------------------------")
  185. cpp_quote("// General Imnxport Return Values")
  186. cpp_quote("// --------------------------------------------------------------------------------")
  187. cpp_quote("#define IXP_E_LOAD_SICILY_FAILED HR_E(0xCC00)") // hrFailedToLoadSicily
  188. cpp_quote("#define IXP_E_INVALID_CERT_CN HR_E(0xCC01)") // hrInvalidCertCN
  189. cpp_quote("#define IXP_E_INVALID_CERT_DATE HR_E(0xCC02)") // hrInvalidCertDate
  190. cpp_quote("#define IXP_E_ALREADY_CONNECTED HR_E(0xCC03)") // hrAlreadyConnected
  191. cpp_quote("#define IXP_E_CONN HR_E(0xCC04)") // hrConn
  192. cpp_quote("#define IXP_E_NOT_CONNECTED HR_E(0xCC05)") // hrNotConnected
  193. cpp_quote("#define IXP_E_CONN_SEND HR_E(0xCC06)") // hrConnSend
  194. cpp_quote("#define IXP_E_WOULD_BLOCK HR_E(0xCC07)") // hrWouldBlock
  195. cpp_quote("#define IXP_E_INVALID_STATE HR_E(0xCC08)") // hrInvalidState
  196. cpp_quote("#define IXP_E_CONN_RECV HR_E(0xCC09)") // hrConnRecv
  197. cpp_quote("#define IXP_E_INCOMPLETE HR_E(0xCC0A)") // hrIncomplete
  198. cpp_quote("#define IXP_E_BUSY HR_E(0xCC0B)")
  199. cpp_quote("#define IXP_E_NOT_INIT HR_E(0xCC0C)")
  200. cpp_quote("#define IXP_E_CANT_FIND_HOST HR_E(0xCC0D)")
  201. cpp_quote("#define IXP_E_FAILED_TO_CONNECT HR_E(0xCC0E)")
  202. cpp_quote("#define IXP_E_CONNECTION_DROPPED HR_E(0xCC0F)")
  203. cpp_quote("#define IXP_E_INVALID_ADDRESS HR_E(0xCC10)")
  204. cpp_quote("#define IXP_E_INVALID_ADDRESS_LIST HR_E(0xCC11)")
  205. cpp_quote("#define IXP_E_SOCKET_READ_ERROR HR_E(0xCC12)")
  206. cpp_quote("#define IXP_E_SOCKET_WRITE_ERROR HR_E(0xCC13)")
  207. cpp_quote("#define IXP_E_SOCKET_INIT_ERROR HR_E(0xCC14)")
  208. cpp_quote("#define IXP_E_SOCKET_CONNECT_ERROR HR_E(0xCC15)")
  209. cpp_quote("#define IXP_E_INVALID_ACCOUNT HR_E(0xCC16)")
  210. cpp_quote("#define IXP_E_USER_CANCEL HR_E(0xCC17)")
  211. cpp_quote("#define IXP_E_SICILY_LOGON_FAILED HR_E(0xCC18)") // hrSicilyLogonFailed
  212. cpp_quote("#define IXP_E_TIMEOUT HR_E(0xCC19)")
  213. cpp_quote("#define IXP_E_SECURE_CONNECT_FAILED HR_E(0xCC1A)")
  214. cpp_quote("")
  215. cpp_quote("// --------------------------------------------------------------------------------")
  216. cpp_quote("// WINSOCK Errors")
  217. cpp_quote("// --------------------------------------------------------------------------------")
  218. cpp_quote("#define IXP_E_WINSOCK_WSASYSNOTREADY HR_E(0xCC40)")
  219. cpp_quote("#define IXP_E_WINSOCK_WSAVERNOTSUPPORTED HR_E(0xCC41)")
  220. cpp_quote("#define IXP_E_WINSOCK_WSAEPROCLIM HR_E(0xCC42)")
  221. cpp_quote("#define IXP_E_WINSOCK_WSAEFAULT HR_E(0xCC43)")
  222. cpp_quote("#define IXP_E_WINSOCK_FAILED_WSASTARTUP HR_E(0xCC44)")
  223. cpp_quote("#define IXP_E_WINSOCK_WSAEINPROGRESS HR_E(0xCC45)")
  224. cpp_quote("")
  225. cpp_quote("// --------------------------------------------------------------------------------")
  226. cpp_quote("// SMTP Command Response Values")
  227. cpp_quote("//--------------------------------------------------------------------------------")
  228. cpp_quote("#define IXP_E_SMTP_RESPONSE_ERROR HR_E(0xCC60)")
  229. cpp_quote("#define IXP_E_SMTP_UNKNOWN_RESPONSE_CODE HR_E(0xCC61)")
  230. cpp_quote("#define IXP_E_SMTP_500_SYNTAX_ERROR HR_E(0xCC62)")
  231. cpp_quote("#define IXP_E_SMTP_501_PARAM_SYNTAX HR_E(0xCC63)")
  232. cpp_quote("#define IXP_E_SMTP_502_COMMAND_NOTIMPL HR_E(0xCC64)")
  233. cpp_quote("#define IXP_E_SMTP_503_COMMAND_SEQ HR_E(0xCC65)")
  234. cpp_quote("#define IXP_E_SMTP_504_COMMAND_PARAM_NOTIMPL HR_E(0xCC66)")
  235. cpp_quote("#define IXP_E_SMTP_421_NOT_AVAILABLE HR_E(0xCC67)")
  236. cpp_quote("#define IXP_E_SMTP_450_MAILBOX_BUSY HR_E(0xCC68)")
  237. cpp_quote("#define IXP_E_SMTP_550_MAILBOX_NOT_FOUND HR_E(0xCC69)")
  238. cpp_quote("#define IXP_E_SMTP_451_ERROR_PROCESSING HR_E(0xCC6A)")
  239. cpp_quote("#define IXP_E_SMTP_551_USER_NOT_LOCAL HR_E(0xCC6B)")
  240. cpp_quote("#define IXP_E_SMTP_452_NO_SYSTEM_STORAGE HR_E(0xCC6C)")
  241. cpp_quote("#define IXP_E_SMTP_552_STORAGE_OVERFLOW HR_E(0xCC6D)")
  242. cpp_quote("#define IXP_E_SMTP_553_MAILBOX_NAME_SYNTAX HR_E(0xCC6E)")
  243. cpp_quote("#define IXP_E_SMTP_554_TRANSACT_FAILED HR_E(0xCC6F)")
  244. cpp_quote("")
  245. cpp_quote("#define IXP_S_SMTP_211_SYSTEM_STATUS HR_S(0xCC70)")
  246. cpp_quote("#define IXP_S_SMTP_214_HELP_MESSAGE HR_S(0xCC71)")
  247. cpp_quote("#define IXP_S_SMTP_220_READY HR_S(0xCC72)")
  248. cpp_quote("#define IXP_S_SMTP_221_CLOSING HR_S(0xCC73)")
  249. cpp_quote("#define IXP_S_SMTP_250_MAIL_ACTION_OKAY HR_S(0xCC74)")
  250. cpp_quote("#define IXP_S_SMTP_251_FORWARDING_MAIL HR_S(0xCC75)")
  251. cpp_quote("#define IXP_S_SMTP_354_START_MAIL_INPUT HR_S(0xCC76)")
  252. cpp_quote("#define IXP_S_SMTP_CONTINUE HR_S(0xCC77)")
  253. cpp_quote("#define IXP_S_SMTP_334_AUTH_READY_RESPONSE HR_S(0xCC78)")
  254. cpp_quote("#define IXP_S_SMTP_245_AUTH_SUCCESS HR_S(0xCC79)")
  255. cpp_quote("")
  256. cpp_quote("#define IXP_E_SMTP_REJECTED_SENDER HR_E(0xCC78)")
  257. cpp_quote("#define IXP_E_SMTP_REJECTED_RECIPIENTS HR_E(0xCC79)")
  258. cpp_quote("#define IXP_E_SMTP_NO_SENDER HR_E(0xCC7A)")
  259. cpp_quote("#define IXP_E_SMTP_NO_RECIPIENTS HR_E(0xCC7B)")
  260. cpp_quote("#define IXP_E_SMTP_530_STARTTLS_REQUIRED HR_E(0xCC7C)")
  261. cpp_quote("#define IXP_E_SMTP_NO_STARTTLS_SUPPORT HR_E(0xCC7D)")
  262. cpp_quote("#define IXP_S_SMTP_NO_DSN_SUPPORT HR_E(0xCC7E)")
  263. cpp_quote("#define IXP_E_SMTP_454_STARTTLS_FAILED HR_E(0xCC7F)")
  264. cpp_quote("")
  265. cpp_quote("// --------------------------------------------------------------------------------")
  266. cpp_quote("// POP3 Command Response Values")
  267. cpp_quote("// --------------------------------------------------------------------------------")
  268. cpp_quote("#define IXP_E_POP3_RESPONSE_ERROR HR_E(0xCC90)")
  269. cpp_quote("#define IXP_E_POP3_INVALID_USER_NAME HR_E(0xCC91)") // hrPOP3BadUserName
  270. cpp_quote("#define IXP_E_POP3_INVALID_PASSWORD HR_E(0xCC92)") // hrPOP3BadPassword
  271. cpp_quote("#define IXP_E_POP3_PARSE_FAILURE HR_E(0xCC93)")
  272. cpp_quote("#define IXP_E_POP3_NEED_STAT HR_E(0xCC94)")
  273. cpp_quote("#define IXP_E_POP3_NO_MESSAGES HR_E(0xCC95)")
  274. cpp_quote("#define IXP_E_POP3_NO_MARKED_MESSAGES HR_E(0xCC96)")
  275. cpp_quote("#define IXP_E_POP3_POPID_OUT_OF_RANGE HR_E(0xCC97)")
  276. cpp_quote("")
  277. cpp_quote("// --------------------------------------------------------------------------------")
  278. cpp_quote("// NNTP Command Response Values")
  279. cpp_quote("// --------------------------------------------------------------------------------")
  280. cpp_quote("#define IXP_E_NNTP_RESPONSE_ERROR HR_E(0xCCA0)") // hrInvalidResponse
  281. cpp_quote("#define IXP_E_NNTP_NEWGROUPS_FAILED HR_E(0xCCA1)")
  282. cpp_quote("#define IXP_E_NNTP_LIST_FAILED HR_E(0xCCA2)")
  283. cpp_quote("#define IXP_E_NNTP_LISTGROUP_FAILED HR_E(0xCCA3)")
  284. cpp_quote("#define IXP_E_NNTP_GROUP_FAILED HR_E(0xCCA4)")
  285. cpp_quote("#define IXP_E_NNTP_GROUP_NOTFOUND HR_E(0xCCA5)")
  286. cpp_quote("#define IXP_E_NNTP_ARTICLE_FAILED HR_E(0xCCA6)")
  287. cpp_quote("#define IXP_E_NNTP_HEAD_FAILED HR_E(0xCCA7)")
  288. cpp_quote("#define IXP_E_NNTP_BODY_FAILED HR_E(0xCCA8)")
  289. cpp_quote("#define IXP_E_NNTP_POST_FAILED HR_E(0xCCA9)")
  290. cpp_quote("#define IXP_E_NNTP_NEXT_FAILED HR_E(0xCCAA)")
  291. cpp_quote("#define IXP_E_NNTP_DATE_FAILED HR_E(0xCCAB)")
  292. cpp_quote("#define IXP_E_NNTP_HEADERS_FAILED HR_E(0xCCAC)")
  293. cpp_quote("#define IXP_E_NNTP_XHDR_FAILED HR_E(0xCCAD)")
  294. cpp_quote("#define IXP_E_NNTP_INVALID_USERPASS HR_E(0xCCAE)")
  295. cpp_quote("")
  296. cpp_quote("// --------------------------------------------------------------------------------")
  297. cpp_quote("// NNTP Server Response Values")
  298. cpp_quote("// --------------------------------------------------------------------------------")
  299. cpp_quote("#define IXP_NNTP_DATE_RESPONSE 111")
  300. cpp_quote("#define IXP_NNTP_POST_ALLOWED 200")
  301. cpp_quote("#define IXP_NNTP_POST_NOTALLOWED 201")
  302. cpp_quote("#define IXP_NNTP_GROUP_SELECTED 211")
  303. cpp_quote("#define IXP_NNTP_LIST_DATA_FOLLOWS 215")
  304. cpp_quote("#define IXP_NNTP_ARTICLE_FOLLOWS 220")
  305. cpp_quote("#define IXP_NNTP_HEAD_FOLLOWS 221")
  306. cpp_quote("#define IXP_NNTP_BODY_FOLLOWS 222")
  307. cpp_quote("#define IXP_NNTP_ARTICLE_RETRIEVED 223")
  308. cpp_quote("#define IXP_NNTP_OVERVIEW_FOLLOWS 224")
  309. cpp_quote("#define IXP_NNTP_NEWNEWSGROUPS_FOLLOWS 231")
  310. cpp_quote("#define IXP_NNTP_ARTICLE_POSTED_OK 240")
  311. cpp_quote("#define IXP_NNTP_AUTHORIZATION_ACCEPTED 250")
  312. cpp_quote("#define IXP_NNTP_AUTH_OK 281")
  313. cpp_quote("#define IXP_NNTP_SEND_ARTICLE_TO_POST 340")
  314. cpp_quote("#define IXP_NNTP_CONTINUE_AUTHORIZATION 350")
  315. cpp_quote("#define IXP_NNTP_PASSWORD_REQUIRED 381")
  316. cpp_quote("#define IXP_NNTP_NO_SUCH_NEWSGROUP 411")
  317. cpp_quote("#define IXP_NNTP_NO_NEXT_ARTICLE 421")
  318. cpp_quote("#define IXP_NNTP_NO_PREV_ARTICLE 422")
  319. cpp_quote("#define IXP_NNTP_NO_SUCH_ARTICLE_NUM 423")
  320. cpp_quote("#define IXP_NNTP_NO_SUCH_ARTICLE_FOUND 430")
  321. cpp_quote("#define IXP_NNTP_POSTING_NOT_ALLOWED 441")
  322. cpp_quote("#define IXP_NNTP_PROTOCOLS_SUPPORTED 485")
  323. cpp_quote("")
  324. cpp_quote("// --------------------------------------------------------------------------------")
  325. cpp_quote("// RAS Errors")
  326. cpp_quote("// --------------------------------------------------------------------------------")
  327. cpp_quote("#define IXP_S_RAS_NOT_NEEDED HR_S(0xCCC0)")
  328. cpp_quote("#define IXP_S_RAS_USING_CURRENT HR_S(0xCCC1)")
  329. cpp_quote("#define IXP_E_RAS_NOT_INSTALLED HR_E(0xCCC2)")
  330. cpp_quote("#define IXP_E_RAS_PROCS_NOT_FOUND HR_E(0xCCC3)")
  331. cpp_quote("#define IXP_E_RAS_ERROR HR_E(0xCCC4)")
  332. cpp_quote("#define IXP_E_RAS_INVALID_CONNECTOID HR_E(0xCCC5)")
  333. cpp_quote("#define IXP_E_RAS_GET_DIAL_PARAMS HR_E(0xCCC6)")
  334. cpp_quote("")
  335. cpp_quote("// --------------------------------------------------------------------------------")
  336. cpp_quote("// IMAP Return Codes")
  337. cpp_quote("// --------------------------------------------------------------------------------")
  338. cpp_quote("#define IXP_S_IMAP_UNRECOGNIZED_RESP HR_S(0xCCD0) // Did not recognize IMAP response CODE")
  339. cpp_quote("#define IXP_S_IMAP_VERBATIM_MBOX HR_S(0xCCE1) // Could not xlate mbox to target CP (or it's disabled): copying verbatim")
  340. cpp_quote("")
  341. cpp_quote("#define IXP_E_IMAP_LOGINFAILURE HR_E(0xCCD1) // LOGIN cmd failed")
  342. cpp_quote("#define IXP_E_IMAP_TAGGED_NO_RESPONSE HR_E(0xCCD2) // Received tagged NO response")
  343. cpp_quote("#define IXP_E_IMAP_BAD_RESPONSE HR_E(0xCCD3) // Received tagged BAD response")
  344. cpp_quote("#define IXP_E_IMAP_SVR_SYNTAXERR HR_E(0xCCD4) // Syntax error in svr response")
  345. cpp_quote("#define IXP_E_IMAP_NOTIMAPSERVER HR_E(0xCCD5) // This is not an IMAP server")
  346. cpp_quote("#define IXP_E_IMAP_BUFFER_OVERFLOW HR_E(0xCCD6) // Buffer overflow occurred")
  347. cpp_quote("#define IXP_E_IMAP_RECVR_ERROR HR_E(0xCCD7) // An error occurred in the recvr code")
  348. cpp_quote("#define IXP_E_IMAP_INCOMPLETE_LINE HR_E(0xCCD8) // Received incomplete line")
  349. cpp_quote("#define IXP_E_IMAP_CONNECTION_REFUSED HR_E(0xCCD9) // Received BYE on greeting")
  350. cpp_quote("#define IXP_E_IMAP_UNRECOGNIZED_RESP HR_E(0xCCDA) // Did not recognize IMAP response")
  351. cpp_quote("#define IXP_E_IMAP_CHANGEDUID HR_E(0xCCDB) // UID changed unexpectedly!")
  352. cpp_quote("#define IXP_E_IMAP_UIDORDER HR_E(0xCCDC) // UIDs not strictly ascending!")
  353. cpp_quote("#define IXP_E_IMAP_UNSOLICITED_BYE HR_E(0xCCDD) // Server issued UNSOLICITED BYE")
  354. cpp_quote("#define IXP_E_IMAP_IMPROPER_SVRSTATE HR_E(0xCCDE) // eg, Attempt to send FETCH before SELECT finishes")
  355. cpp_quote("#define IXP_E_IMAP_AUTH_NOT_POSSIBLE HR_E(0xCCDF) // No common authentication methods btwn client/svr")
  356. cpp_quote("#define IXP_E_IMAP_OUT_OF_AUTH_METHODS HR_E(0xCCE0) // We tried >= 1 auth method, no more left to try")
  357. cpp_quote("")
  358. cpp_quote("// --------------------------------------------------------------------------------")
  359. cpp_quote("// HTTPMail Return Codes")
  360. cpp_quote("// --------------------------------------------------------------------------------")
  361. cpp_quote("// http errors are discontiguous.")
  362. cpp_quote("#define IXP_E_HTTP_USE_PROXY HR_E(0xCC30) // http status 305")
  363. cpp_quote("#define IXP_E_HTTP_BAD_REQUEST HR_E(0xCC31) // http status 400")
  364. cpp_quote("#define IXP_E_HTTP_UNAUTHORIZED HR_E(0xCC32) // http status 401")
  365. cpp_quote("#define IXP_E_HTTP_FORBIDDEN HR_E(0xCC33) // http status 403")
  366. cpp_quote("#define IXP_E_HTTP_NOT_FOUND HR_E(0xCC34) // http status 404")
  367. cpp_quote("#define IXP_E_HTTP_METHOD_NOT_ALLOW HR_E(0xCC35) // http status 405")
  368. cpp_quote("#define IXP_E_HTTP_NOT_ACCEPTABLE HR_E(0xCC36) // http status 406")
  369. cpp_quote("#define IXP_E_HTTP_PROXY_AUTH_REQ HR_E(0xCC37) // http status 407")
  370. cpp_quote("#define IXP_E_HTTP_REQUEST_TIMEOUT HR_E(0xCC38) // http status 408")
  371. cpp_quote("#define IXP_E_HTTP_CONFLICT HR_E(0xCC39) // http status 409")
  372. cpp_quote("#define IXP_E_HTTP_GONE HR_E(0xCC3A) // http status 410")
  373. cpp_quote("#define IXP_E_HTTP_LENGTH_REQUIRED HR_E(0xCC3B) // http status 411")
  374. cpp_quote("#define IXP_E_HTTP_PRECOND_FAILED HR_E(0xCC3C) // http status 412")
  375. cpp_quote("#define IXP_E_HTTP_INTERNAL_ERROR HR_E(0xCC3D) // http status 500")
  376. cpp_quote("#define IXP_E_HTTP_NOT_IMPLEMENTED HR_E(0xCC3E) // http status 501")
  377. cpp_quote("#define IXP_E_HTTP_BAD_GATEWAY HR_E(0xCC3F) // http status 502")
  378. cpp_quote("// begin second range")
  379. cpp_quote("#define IXP_E_HTTP_SERVICE_UNAVAIL HR_E(0xCCF0) // http status 503")
  380. cpp_quote("#define IXP_E_HTTP_GATEWAY_TIMEOUT HR_E(0xCCF1) // http status 504")
  381. cpp_quote("#define IXP_E_HTTP_VERS_NOT_SUP HR_E(0xCCF2) // http status 505")
  382. cpp_quote("#define IXP_E_HTTP_INSUFFICIENT_STORAGE HR_E(0xCCF3) // http status 425 or 507")
  383. cpp_quote("#define IXP_E_HTTP_ROOT_PROP_NOT_FOUND HR_E(0xCCF4) // see IHTTPMailTransport::GetProperty")
  384. cpp_quote("#define IXP_E_HTTP_NOT_MODIFIED HR_E(0xCCF5) // http status 304")
  385. cpp_quote("")
  386. cpp_quote("// --------------------------------------------------------------------------------")
  387. cpp_quote("// String Length Constants")
  388. cpp_quote("// --------------------------------------------------------------------------------")
  389. cpp_quote("")
  390. cpp_quote("// --------------------------------------------------------------------------------")
  391. cpp_quote("// LIBID_IMNXPORT")
  392. cpp_quote("// --------------------------------------------------------------------------------")
  393. [
  394. uuid(C9E686F1-3339-11d0-81CF-00C04FD85AB4),
  395. helpstring("Microsoft Internet Mail and News Transport API Type Library 1.0"),
  396. version(1.0)
  397. ]
  398. library IMNXPORT
  399. {
  400. importlib("stdole2.tlb");
  401. // ---------------------------------------------------------------------------------------
  402. // All of the transports in this library work in an asyncronous mode. It is assumed that
  403. // the client application has a message pump on the thread in which a transport object
  404. // is created.
  405. // ---------------------------------------------------------------------------------------
  406. // ---------------------------------------------------------------------------------------
  407. // String Lengths
  408. // ---------------------------------------------------------------------------------------
  409. const SHORT CCHMAX_DOMAIN = 256;
  410. const SHORT CCHMAX_PHONE_NUMBER = 128; // RAS_MaxPhoneNumber
  411. // ---------------------------------------------------------------------------------------
  412. // Default Port Numbers
  413. // ---------------------------------------------------------------------------------------
  414. const DWORD DEFAULT_IMAP_PORT = 143;
  415. const DWORD DEFAULT_POP3_PORT = 110;
  416. const DWORD DEFAULT_SMTP_PORT = 25;
  417. const DWORD DEFAULT_NNTP_PORT = 119;
  418. // ---------------------------------------------------------------------------------------
  419. // Internet Address Type
  420. //
  421. // There are only two address types because the SMTP protocol only distinguishes
  422. // between a sender (ADDR_FROM) and recipients. ADDR_TO should include all Bcc, Cc and
  423. // To recipients.
  424. //
  425. // additional DSN flags may be anded in and will result in a DSN request only if the
  426. // SMTP server supports DSNs (rfc1891) and the transport connected with an EHLO command
  427. // ---------------------------------------------------------------------------------------
  428. typedef enum tagINETADDRTYPE {
  429. ADDR_TO, // Recipient of the message (To, CC, Bcc, etc)
  430. ADDR_FROM, // Sender of the message
  431. ADDR_DSN_NEVER = 16, // suppress all delivery status notification
  432. ADDR_DSN_SUCCESS = 32, // request DSN on successful delivery
  433. ADDR_DSN_FAILURE = 64, // request DSN on delivery failure
  434. ADDR_DSN_DELAY = 128 // request DSN if delivery is delayed
  435. } INETADDRTYPE;
  436. const DWORD ADDR_TOFROM_MASK = 0x1; // INETADDRTYPE & ADDR_TOFROM_MASK gives raw type
  437. const DWORD ADDR_DSN_MASK = 0xf0;
  438. // ---------------------------------------------------------------------------------------
  439. // DSNRET
  440. // controls what whether full message or headers only will be returned with DSNs
  441. // ---------------------------------------------------------------------------------------
  442. typedef enum tagDSNRET {
  443. DSNRET_DEFAULT, // use SMTP server default
  444. DSNRET_HDRS, // return 822 headers only
  445. DSNRET_FULL, // return full message - headers + body
  446. } DSNRET;
  447. // ---------------------------------------------------------------------------------------
  448. // Internet Address
  449. // ---------------------------------------------------------------------------------------
  450. typedef struct tagINETADDR {
  451. INETADDRTYPE addrtype;
  452. CHAR szEmail[CCHMAX_EMAIL_ADDRESS]; // A person's e-mail address
  453. } INETADDR, *LPINETADDR;
  454. // ---------------------------------------------------------------------------------------
  455. // Internet Address List
  456. // ---------------------------------------------------------------------------------------
  457. typedef struct tagINETADDRLIST {
  458. ULONG cAddress; // Number of elements in prgInetAddr
  459. LPINETADDR prgAddress; // Array of internet addresses
  460. } INETADDRLIST, *LPINETADDRLIST;
  461. // -----------------------------------------------------------------------------------
  462. // RAS Connection Type
  463. // -----------------------------------------------------------------------------------
  464. typedef enum tagRASCONNTYPE {
  465. RAS_CONNECT_LAN,
  466. RAS_CONNECT_MANUAL,
  467. RAS_CONNECT_RAS
  468. } RASCONNTYPE;
  469. // -----------------------------------------------------------------------------------
  470. // HTTPMAIL Root Property Types
  471. // -----------------------------------------------------------------------------------
  472. typedef enum tagHTTPMAILPROPTYPE {
  473. HTTPMAIL_PROP_INVALID,
  474. HTTPMAIL_PROP_ADBAR,
  475. HTTPMAIL_PROP_CONTACTS,
  476. HTTPMAIL_PROP_INBOX,
  477. HTTPMAIL_PROP_OUTBOX,
  478. HTTPMAIL_PROP_SENDMSG,
  479. HTTPMAIL_PROP_SENTITEMS,
  480. HTTPMAIL_PROP_DELETEDITEMS,
  481. HTTPMAIL_PROP_DRAFTS,
  482. HTTPMAIL_PROP_MSGFOLDERROOT,
  483. HTTPMAIL_PROP_SIG,
  484. HTTPMAIL_PROP_MAXPOLLINGINTERVAL,
  485. HTTPMAIL_PROP_LAST
  486. } HTTPMAILPROPTYPE;
  487. // -----------------------------------------------------------------------------------
  488. // HTTPMAIL Special Folder Types
  489. // -----------------------------------------------------------------------------------
  490. typedef enum tagHTTPMAILSPECIALFOLDER {
  491. HTTPMAIL_SF_NONE = 0,
  492. HTTPMAIL_SF_UNRECOGNIZED,
  493. HTTPMAIL_SF_INBOX,
  494. HTTPMAIL_SF_DELETEDITEMS,
  495. HTTPMAIL_SF_DRAFTS,
  496. HTTPMAIL_SF_OUTBOX,
  497. HTTPMAIL_SF_SENTITEMS,
  498. HTTPMAIL_SF_CONTACTS,
  499. HTTPMAIL_SF_CALENDAR,
  500. HTTPMAIL_SF_MSNPROMO,
  501. HTTPMAIL_SF_BULKMAIL,
  502. HTTPMAIL_SF_LAST
  503. } HTTPMAILSPECIALFOLDER;
  504. // -----------------------------------------------------------------------------------
  505. // HTTPMAIL Contact Types
  506. // -----------------------------------------------------------------------------------
  507. typedef enum tagHTTPMAILCONTACTTYPE {
  508. HTTPMAIL_CT_CONTACT = 0, // default
  509. HTTPMAIL_CT_GROUP,
  510. HTTPMAIL_CT_LAST
  511. } HTTPMAILCONTACTTYPE;
  512. // -----------------------------------------------------------------------------------
  513. // DAV Namespaces
  514. // -----------------------------------------------------------------------------------
  515. const DWORD DAVNAMESPACE_UNKNOWN = 0xFFFFFFFF;
  516. const DWORD DAVNAMESPACE_DAV = 0;
  517. const DWORD DAVNAMESPACE_HOTMAIL = 1;
  518. const DWORD DAVNAMESPACE_HTTPMAIL = 2;
  519. const DWORD DAVNAMESPACE_MAIL = 3;
  520. const DWORD DAVNAMESPACE_CONTACTS = 4;
  521. // ---------------------------------------------------------------------------------------
  522. // Internet Server Flags...
  523. // ---------------------------------------------------------------------------------------
  524. cpp_quote("#define ISF_SMTP_USEIPFORHELO 0x00000001 // For HELO or EHLO Command")
  525. cpp_quote("#define ISF_ALWAYSPROMPTFORPASSWORD 0x00000002 // For HELO or EHLO Command") // Never save password (boolean)
  526. cpp_quote("#define ISF_SSLONSAMEPORT 0x00000004 // For SMTP Only - use STARTTLS") // For STARTTLS Support
  527. cpp_quote("#define ISF_QUERYDSNSUPPORT 0x00000008 // For SMTP Only - issue EHLO on connect and check for DSN")
  528. cpp_quote("#define ISF_QUERYAUTHSUPPORT 0x00000010 // For SMTP Only - issue EHLO on connect and check for AUTH")
  529. // ---------------------------------------------------------------------------------------
  530. // Internet Server Information...
  531. // ---------------------------------------------------------------------------------------
  532. typedef struct INETSERVER {
  533. CHAR szAccount[CCHMAX_ACCOUNT_NAME]; // IMN Account Name
  534. CHAR szUserName[CCHMAX_USERNAME]; // User's connection name
  535. CHAR szPassword[CCHMAX_PASSWORD]; // User's password
  536. CHAR szServerName[CCHMAX_SERVER_NAME]; // Server name (or IP address string)
  537. CHAR szConnectoid[CCHMAX_CONNECTOID]; // RAS Connection Name
  538. RASCONNTYPE rasconntype; // RAS connection type
  539. DWORD dwPort; // Port name
  540. BOOL fSSL; // Using SSL
  541. BOOL fTrySicily; // Try using sicily authentication
  542. DWORD dwTimeout; // Timeout in seconds
  543. DWORD dwFlags; // ISF_xxx Flags (above)
  544. } INETSERVER, *LPINETSERVER;
  545. // -----------------------------------------------------------------------------------
  546. // Internet Transport Types
  547. // -----------------------------------------------------------------------------------
  548. typedef enum tagIXPTYPE {
  549. IXP_NNTP, // NNTP (News)
  550. IXP_SMTP, // SMTP (Send)
  551. IXP_POP3, // POP3 (Recv)
  552. IXP_IMAP, // IMAP (Recv / remote store)
  553. IXP_RAS,
  554. IXP_HTTPMail // HTTPMail (Recv / remote store)
  555. } IXPTYPE;
  556. // -----------------------------------------------------------------------------------
  557. // IXPSTATUS - Transport Status Types
  558. //
  559. // These values are returned in the ITransportCallback::OnStatus callback method
  560. // and in the IInternetTransport::GetStatus member.
  561. // -----------------------------------------------------------------------------------
  562. typedef enum tagIXPSTATUS
  563. {
  564. IXP_FINDINGHOST, // Attempting to find host (IP/host name resolution)
  565. IXP_CONNECTING, // TCP/IP connection is in progress
  566. IXP_SECURING, // TCP/IP socket connection has been established, securing an SSL connection
  567. IXP_CONNECTED, // TCP/IP socket connection has been established, waiting for protcol response
  568. IXP_AUTHORIZING, // Performing authorization with the server
  569. IXP_AUTHRETRY, // Retrying authorization
  570. IXP_AUTHORIZED, // Authorization successful (transient state, heads directly to IXP_CONNECTED after)
  571. IXP_DISCONNECTING, // The connection is being closed
  572. IXP_DISCONNECTED, // The transport has been disconnected from the server
  573. IXP_LAST // Last status value (for boundschecking purposes)
  574. } IXPSTATUS;
  575. // DEPTH_INFINITY : this constant can be passed to any member of IHTTPMailTransport
  576. // that takes a DWORD parameter to specify depth in a propfind request.
  577. const DWORD DEPTH_INFINITY = 0xFFFFFFFE;
  578. // IHTTPMailTransport::MemberInfo Flags.
  579. typedef DWORD MEMBERINFOFLAGS;
  580. const MEMBERINFOFLAGS HTTP_MEMBERINFO_COMMONPROPS = 0x00000000;
  581. const MEMBERINFOFLAGS HTTP_MEMBERINFO_FOLDERPROPS = 0x00000001; // common props and folder props
  582. const MEMBERINFOFLAGS HTTP_MEMBERINFO_MESSAGEPROPS = 0x00000002; // common props and message props
  583. const MEMBERINFOFLAGS HTTP_MEMBERINFO_ALLPROPS = (HTTP_MEMBERINFO_FOLDERPROPS | HTTP_MEMBERINFO_MESSAGEPROPS);
  584. // ***NB: You have to be careful when changing IMAP_MSGFLAGS.
  585. // The function, IMAPMsgFlagsToARF in imapfldr.cpp will have to be updated.
  586. typedef DWORD IMAP_MSGFLAGS; // Message flags returned by FLAGS response,
  587. // PERMANENTFLAGS response code and FETCH
  588. const IMAP_MSGFLAGS IMAP_MSG_NOFLAGS = 0x00000000;
  589. const IMAP_MSGFLAGS IMAP_MSG_ANSWERED = 0x00000001;
  590. const IMAP_MSGFLAGS IMAP_MSG_FLAGGED = 0x00000002;
  591. const IMAP_MSGFLAGS IMAP_MSG_DELETED = 0x00000004;
  592. const IMAP_MSGFLAGS IMAP_MSG_SEEN = 0x00000008;
  593. const IMAP_MSGFLAGS IMAP_MSG_DRAFT = 0x00000010;
  594. const IMAP_MSGFLAGS IMAP_MSG_ALLFLAGS = 0x0000001F; // Keep this updated
  595. // ---------------------------------------------------------------------------------------
  596. // IID_ITransportCallbackService
  597. // ---------------------------------------------------------------------------------------
  598. [
  599. uuid(CA30F3FF-C9AC-11d1-9A3A-00C04FA309D4),
  600. ]
  601. interface ITransportCallbackService : IUnknown
  602. {
  603. HRESULT GetParentWindow(
  604. [in] DWORD dwReserved,
  605. [out] HWND *phwndParent);
  606. HRESULT GetAccount(
  607. [out] LPDWORD pdwServerType, // SRV_xxx Bit
  608. [out] IImnAccount **ppAccount);
  609. }
  610. // ---------------------------------------------------------------------------------------
  611. // IID_ITransportCallback
  612. // ---------------------------------------------------------------------------------------
  613. [
  614. uuid(0DF2C7E1-3435-11d0-81D0-00C04FD85AB4),
  615. helpstring("Base Transport Callback Interface"),
  616. ]
  617. interface ITransportCallback : IUnknown
  618. {
  619. // -----------------------------------------------------------------------------------
  620. // IXPRESULT
  621. //
  622. // This structure holds information about a server response or a transport result /
  623. // error.
  624. // -----------------------------------------------------------------------------------
  625. typedef struct tagIXPRESULT {
  626. HRESULT hrResult; // Error Code
  627. LPSTR pszResponse; // Last server response
  628. UINT uiServerError; // Server generated error number
  629. HRESULT hrServerError; // Associated HRESULT of server error
  630. DWORD dwSocketError; // Socket error as defined in winsock.h
  631. LPSTR pszProblem; // Additional information
  632. } IXPRESULT, *LPIXPRESULT;
  633. // -----------------------------------------------------------------------------------
  634. // OnTimeout
  635. //
  636. // Description:
  637. // This method is called by a transport when a timeout period has expired. A timeout
  638. // is defined as a period of time in which no activity has occurred. A client
  639. // can specify a timeout in the INETSERVER structure that is passed to the
  640. // IInternetTransport::Connect method.
  641. //
  642. // When this method is called, the client MUST return a value that indicates
  643. // whether the transport should wait another dwTimeout (seconds), or should
  644. // terminate the connection to the server.
  645. //
  646. // Parameters:
  647. // pdwTimeout Specifies the current timeout value in seconds. A
  648. // client can reset this value to a new timeout value,
  649. // and return S_OK in which case the client will
  650. // continue waiting for the new timeout period.
  651. // pTransport The transport that generated the timeout
  652. //
  653. // Returns:
  654. // S_OK Tells the transport to wait another timeout period
  655. // as specified by the value of *pdwTimeout (seconds).
  656. // S_FALSE Tells the transport to terminate it's connection and
  657. // return to the disconnected state.
  658. //
  659. // -----------------------------------------------------------------------------------
  660. HRESULT OnTimeout(
  661. [in,out]
  662. DWORD *pdwTimeout,
  663. [in]
  664. IInternetTransport *pTransport);
  665. // -----------------------------------------------------------------------------------
  666. // OnLogonPrompt
  667. //
  668. // Description:
  669. // This method is called when the transport requires logon information. The client
  670. // is expected to prompt the user and fill the szUserName, szPassword fields of
  671. // the INETSERVER structure passed in. The client should not attempt to change
  672. // any other fields in this structure, they should be used only for display.
  673. //
  674. // Parameters:
  675. // pInetServer Information about the current internet server.
  676. // pTransport The transport that generated the timeout
  677. //
  678. // Returns:
  679. // S_OK The user entered new logon information and the
  680. // transport should try to re-connect.
  681. // S_FALSE The user wants to cancel the current logon attempt.
  682. // If this value is returned, the transport returns
  683. // to the disconnected state.
  684. //
  685. // -----------------------------------------------------------------------------------
  686. HRESULT OnLogonPrompt(
  687. [in,out]
  688. LPINETSERVER pInetServer,
  689. [in]
  690. IInternetTransport *pTransport);
  691. // -----------------------------------------------------------------------------------
  692. // OnPrompt
  693. //
  694. // Description:
  695. // This method is called when the transport requires user input. This method is called
  696. // in the following cases:
  697. //
  698. // 1) hrError == IXP_E_INVALID_CERT_CN, Invalid certificate, SSL error
  699. // 2) hrError == IXP_E_INVALID_CERT_DATE, Invalid certificate date, SSL error
  700. //
  701. // Parameters:
  702. // hrError HRESULT of reason for user prompt, usually an error
  703. // pszText Suggested text of question to be displayed
  704. // pszCaption Suggested caption of messagebox
  705. // uType Same parameter as passed into MessageBox (Yes, no, etc)
  706. // pTransport The transport object that generated the OnPrompt
  707. //
  708. // Returns
  709. // INT This method should return the same value as the
  710. // standard windows MessageBox API function.
  711. //
  712. // -----------------------------------------------------------------------------------
  713. INT OnPrompt(
  714. [in]
  715. HRESULT hrError,
  716. [in]
  717. LPCTSTR pszText,
  718. [in]
  719. LPCTSTR pszCaption,
  720. [in]
  721. UINT uType,
  722. [in]
  723. IInternetTransport *pTransport);
  724. // -----------------------------------------------------------------------------------
  725. // OnStatus
  726. //
  727. // Description:
  728. // This method is called to allow the client to provide a user with a high level
  729. // progress indicator.
  730. //
  731. // Parameters:
  732. // ixpstatus Current status of the transport, described above
  733. // pTransport Transport object that generated the OnStatus call
  734. //
  735. // Returns:
  736. // HRESULT A client should always return S_OK
  737. //
  738. // -----------------------------------------------------------------------------------
  739. HRESULT OnStatus(
  740. [in]
  741. IXPSTATUS ixpstatus,
  742. [in]
  743. IInternetTransport *pTransport);
  744. // -----------------------------------------------------------------------------------
  745. // OnError
  746. //
  747. // Description:
  748. // This method is called when a transport encounters a fatal error that will most
  749. // likely result is a disconnection from the server. Normal protocol errors are
  750. // returned through each transports OnResponse metho. This method is used to handle
  751. // high-level errors such eas TCP/IP and connection failures.
  752. //
  753. // Parameters:
  754. // ixpstatus Current status of the transport (described above)
  755. // pResult Error information
  756. // pTransport Transport object that generated the OnError call
  757. //
  758. // Return Values:
  759. // HRESULT A client should always return S_OK
  760. //
  761. // -----------------------------------------------------------------------------------
  762. HRESULT OnError(
  763. [in]
  764. IXPSTATUS ixpstatus,
  765. [in]
  766. LPIXPRESULT pResult,
  767. [in]
  768. IInternetTransport *pTransport);
  769. // -----------------------------------------------------------------------------------
  770. // OnCommand
  771. //
  772. // Description:
  773. // This method is called for every command send to the server and for every respsonse
  774. // received from the server. This method is provided ONLY for logging and debugging
  775. // purposes. If you pass FALSE for fCommandLogging in the call to
  776. // IInternetTransport::Connect, this method will not be called. There is a small
  777. // amount of overhead when this function is called.
  778. //
  779. // Parameters:
  780. // cmdtype Is this a Send Line or a Response Line
  781. // pszLine Data send to or received from the server
  782. // hrResponse HRESULT of response code (see codes above). If this
  783. // is a failure code, then it indicates that the
  784. // transport just received an error from the server
  785. // and the current operation is going to fail, possible.
  786. // pTransport Transport that generated the call to OnCommand
  787. //
  788. // Returns:
  789. // S_OK The client should always return S_OK
  790. //
  791. // -----------------------------------------------------------------------------------
  792. typedef enum tagCMDTYPE {
  793. CMD_SEND,
  794. CMD_RESP
  795. } CMDTYPE;
  796. HRESULT OnCommand(
  797. [in]
  798. CMDTYPE cmdtype,
  799. [in]
  800. LPSTR pszLine,
  801. [in]
  802. HRESULT hrResponse,
  803. [in]
  804. IInternetTransport *pTransport);
  805. }
  806. // ---------------------------------------------------------------------------------------
  807. // IID_IInternetTransport
  808. // ---------------------------------------------------------------------------------------
  809. [
  810. uuid(1F636C01-364E-11d0-81D3-00C04FD85AB4),
  811. helpstring("Internet Transport Interface"),
  812. ]
  813. interface IInternetTransport : IUnknown
  814. {
  815. // Interface Constants
  816. const boolean iitAUTHENTICATE = TRUE;
  817. const boolean iitDONT_AUTHENTICATE = FALSE;
  818. const boolean iitENABLE_ONCOMMAND = TRUE;
  819. const boolean iitDISABLE_ONCOMMAND = FALSE;
  820. // -----------------------------------------------------------------------------------
  821. // GetServerInfo
  822. //
  823. // Description:
  824. // Allows the client to retreive server information for the transport. The data in
  825. // this structure is valid only after a call to IInternetTransport::Connect.
  826. //
  827. // Parameters:
  828. // pInetServer Current server information for the transport
  829. //
  830. // Returns:
  831. // E_INVALIDARG pInetServer is NULL
  832. //
  833. // -----------------------------------------------------------------------------------
  834. HRESULT GetServerInfo(
  835. [in,out]
  836. LPINETSERVER pInetServer);
  837. // -----------------------------------------------------------------------------------
  838. // GetIXPType
  839. //
  840. // Description:
  841. // This method returns the IXPTYPE of the transport.
  842. //
  843. // Parameters:
  844. // None
  845. //
  846. // Returns:
  847. // IXPTYPE Internet Transport Type
  848. //
  849. // -----------------------------------------------------------------------------------
  850. IXPTYPE GetIXPType(void);
  851. // -----------------------------------------------------------------------------------
  852. // IsState
  853. //
  854. // Description:
  855. // This method allows a client to query the transport for validity of different states.
  856. //
  857. // Parameters:
  858. // isstate The State in which to query
  859. //
  860. // Returns:
  861. // IXP_E_NOT_INIT The transport has not been initialized
  862. // IXP_E_NOT_CONNECTED The transport is not connected (return if isstate != IXP_IS_CONNECTED)
  863. // S_OK The IXP_IS_xxx state is true
  864. // S_FALSE The IXP_IS_xxx state is false
  865. //
  866. // -----------------------------------------------------------------------------------
  867. typedef enum tagIXPISSTATE {
  868. IXP_IS_CONNECTED, // Is the transport currently connected
  869. IXP_IS_BUSY, // Is the transport currently processing a command
  870. IXP_IS_READY, // Is the transport ready for input
  871. IXP_IS_AUTHENTICATED, // Has the transport performed authentication
  872. } IXPISSTATE;
  873. HRESULT IsState(
  874. [in]
  875. IXPISSTATE isstate);
  876. // -----------------------------------------------------------------------------------
  877. // InetServerFromAccount
  878. //
  879. // Description:
  880. // This method takes an Internet Mail and News Account object and returns a filled
  881. // INETSERVER structure.
  882. //
  883. // Parameters:
  884. // pAccount Internet Mail and News Account
  885. // pInetServer Upon successful return contains server information
  886. // required to call IInternetTransport::Connect.
  887. //
  888. // Return Values:
  889. // E_INVALIDARG pAccount is NULL or pInetServer is NULL
  890. //
  891. // -----------------------------------------------------------------------------------
  892. HRESULT InetServerFromAccount(
  893. [in]
  894. IImnAccount *pAccount,
  895. [in,out]
  896. LPINETSERVER pInetServer);
  897. // -----------------------------------------------------------------------------------
  898. // Connect
  899. //
  900. // Description:
  901. // Connects the transport to the server specified in pInetServer struct. This call
  902. // is asyncronous. Each transport defines that terminal connect state. For example,
  903. // for SMTP, the connect state (::Connect is done) is defined by the SMTP_CONNECTED,
  904. // state.
  905. //
  906. // Parameters:
  907. // pInetServer Internet Server connection information.
  908. // fAuthenticate Tells the transport whether of or not to perform
  909. // authentication with the server. If you client
  910. // passes FALSE, it is responsible for authentication.
  911. // fCommandLogging If you pass FALSE, the ITransportCallback::OnCommand
  912. // method will never be called.
  913. //
  914. // Returns:
  915. // E_INVALIDARG pInetServer is NULL, or a member of it is invalid
  916. // E_OUTOFMEMORY An memory allocation failed
  917. // E_FAIL Socket initialization or connection failed.
  918. // IXP_E_ALREADY_CONNECTED The transport is currently connected and busy
  919. // IXP_E_NOT_INIT The transport has not been Initialized
  920. // IXP_E_SOCKET_INIT_ERROR Unable to initilize the TCP/IP socket connection
  921. // IXP_E_SOCKET_CONNECT_ERROR Unable to connect the TCP/IP socket
  922. //
  923. // In general this function succeeds, even if the server does not exist. If the
  924. // server can not be found, the client will receive error information through
  925. // ITransportCallback::OnError, and the terminal connection state can be detected
  926. // when ITransportCallback::OnStatus(IXP_DISCONNECTED) is called.
  927. //
  928. // -----------------------------------------------------------------------------------
  929. HRESULT Connect(
  930. [in]
  931. LPINETSERVER pInetServer,
  932. [in]
  933. boolean fAuthenticate,
  934. [in]
  935. boolean fCommandLogging);
  936. // -----------------------------------------------------------------------------------
  937. // HandsOffCallback
  938. //
  939. // Description:
  940. // This method forces the Transport to release the callback interface that was
  941. // passed into the InitNew method of the transport. After this method is called,
  942. // no more calls will be made to the callback function. This method is provided
  943. // so that clients can resolve possible circurlar references.
  944. //
  945. // Parameters:
  946. // None
  947. //
  948. // Returns:
  949. // S_OK The callback was release
  950. // S_FALSE There is currently no callback registered
  951. //
  952. // -----------------------------------------------------------------------------------
  953. HRESULT HandsOffCallback(void);
  954. // -----------------------------------------------------------------------------------
  955. // Disconnect
  956. //
  957. // Description:
  958. // This method disconnects the transport. This method may cause the transport to
  959. // send a command, such as the QUIT command, to the server. This is the clean
  960. // method of terminating the connection to the server, as opposed to DropConnection.
  961. //
  962. // Parameters:
  963. // None
  964. //
  965. // Returns:
  966. // S_OK The connection has been dropped.
  967. // IXP_E_NOT_INIT The transport has not been Initialized
  968. // IXP_E_NOT_CONNECTED The transport is not connected.
  969. //
  970. // -----------------------------------------------------------------------------------
  971. HRESULT Disconnect(void);
  972. // -----------------------------------------------------------------------------------
  973. // DropConnection
  974. //
  975. // Description:
  976. // This method disconnects the transport. This is an un-clean way, but guaranteed
  977. // method of dropping the connection between the client and the server. To allow
  978. // the protocol to shutdown in a normal fashion, call Disconnect.
  979. //
  980. // Parameters:
  981. // None
  982. //
  983. // Returns:
  984. // S_OK The connection has been dropped.
  985. // IXP_E_NOT_INIT The transport has not been Initialized
  986. // IXP_E_NOT_CONNECTED The transport is not connected.
  987. //
  988. // -----------------------------------------------------------------------------------
  989. HRESULT DropConnection(void);
  990. // -----------------------------------------------------------------------------------
  991. // GetStatus
  992. //
  993. // Description:
  994. // This function returns the current status of the transport.
  995. //
  996. // Parameters:
  997. // IXPSTATUS *pCurrentStatus [out] - current status of the transport is returned here.
  998. //
  999. // Returns:
  1000. // HRESULT indicating success or failure.
  1001. // -----------------------------------------------------------------------------------
  1002. HRESULT GetStatus([out]IXPSTATUS *pCurrentStatus);
  1003. }
  1004. // ---------------------------------------------------------------------------------------
  1005. // IID_ISMTPCallback
  1006. // ---------------------------------------------------------------------------------------
  1007. [
  1008. uuid(1F636C02-364E-11d0-81D3-00C04FD85AB4),
  1009. helpstring("SMTP Callback Interface"),
  1010. ]
  1011. interface ISMTPCallback : ITransportCallback
  1012. {
  1013. // -----------------------------------------------------------------------------------
  1014. // SMTPCOMMAND
  1015. // -----------------------------------------------------------------------------------
  1016. typedef enum tagSMTPCOMMAND {
  1017. SMTP_NONE,
  1018. SMTP_BANNER,
  1019. SMTP_CONNECTED,
  1020. SMTP_SEND_MESSAGE,
  1021. SMTP_AUTH,
  1022. SMTP_EHLO,
  1023. SMTP_HELO,
  1024. SMTP_MAIL,
  1025. SMTP_RCPT,
  1026. SMTP_RSET,
  1027. SMTP_QUIT,
  1028. SMTP_DATA,
  1029. SMTP_DOT,
  1030. SMTP_SEND_STREAM,
  1031. SMTP_CUSTOM
  1032. } SMTPCOMMAND;
  1033. // -----------------------------------------------------------------------------------
  1034. // SMTPSTREAM return OnResponse - command == SMTP_SEND_STREAM
  1035. // -----------------------------------------------------------------------------------
  1036. typedef struct tagSMTPSTREAM {
  1037. DWORD cbIncrement;
  1038. DWORD cbCurrent;
  1039. DWORD cbTotal;
  1040. } SMTPSTREAM, *LPSMTPSTREAM;
  1041. // -----------------------------------------------------------------------------------
  1042. // SMTPRESPONSE
  1043. //
  1044. // Description:
  1045. // command SMTPCOMMAND that generated the response
  1046. // fDone Is the command finished. If TRUE, the client
  1047. // can issue another command through ISMTPTransport,
  1048. // otherwise, the client should continue to pump
  1049. // messages until fDone = TRUE is received.
  1050. // rIxpResult Result Information for the response. If
  1051. // rIxpResult::hrResult specifies a FAILED result,
  1052. // the structure contains other information.
  1053. // pTransport Transport that generated the OnResponse call.
  1054. //
  1055. // -----------------------------------------------------------------------------------
  1056. typedef struct tagSMTPRESPONSE {
  1057. SMTPCOMMAND command; // Command in which the response was generated for
  1058. BOOL fDone; // Is this an SMTP continuation response?
  1059. IXPRESULT rIxpResult; // Result Information
  1060. ISMTPTransport *pTransport; // Pointer to the SMTP transport that generated the response
  1061. // This is a union of response information based on the command
  1062. [switch_type(SMTPCOMMAND), switch_is((SMTPCOMMAND)command)]
  1063. union {
  1064. [case(SMTP_SEND_STREAM)] SMTPSTREAM rStreamInfo;
  1065. [default];
  1066. };
  1067. } SMTPRESPONSE, *LPSMTPRESPONSE;
  1068. // -----------------------------------------------------------------------------------
  1069. // OnResponse
  1070. //
  1071. // Description:
  1072. // Called by ISMTPTransport when a command response is received from the SMTP server.
  1073. //
  1074. // Parameters:
  1075. // pResponse Response information
  1076. //
  1077. // Return Values:
  1078. // S_OK The client should always return S_OK
  1079. //
  1080. // -----------------------------------------------------------------------------------
  1081. HRESULT OnResponse(
  1082. [in]
  1083. LPSMTPRESPONSE pResponse);
  1084. }
  1085. // ---------------------------------------------------------------------------------------
  1086. // IID_ISMTPTransport
  1087. // ---------------------------------------------------------------------------------------
  1088. [
  1089. uuid(0DF2C7E2-3435-11d0-81D0-00C04FD85AB4),
  1090. helpstring("SMTP Transport Interface"),
  1091. ]
  1092. interface ISMTPTransport : IInternetTransport
  1093. {
  1094. // -----------------------------------------------------------------------------------
  1095. // SMTPMESSAGE
  1096. // -----------------------------------------------------------------------------------
  1097. typedef struct tagSMTPMESSAGE {
  1098. ULONG cbSize; // Size of the message in bytes
  1099. LPSTREAM pstmMsg; // Stream containing ANSI MIME/rfc822 message stream
  1100. INETADDRLIST rAddressList; // Internet Address List containing sender and recipients
  1101. } SMTPMESSAGE, *LPSMTPMESSAGE;
  1102. // -----------------------------------------------------------------------------------
  1103. // InitNew
  1104. //
  1105. // Description:
  1106. // This method Initializes the internet transport. This method be called before
  1107. // the transport can doing anything.
  1108. //
  1109. // Parameters:
  1110. // pszLogFilePath Full file path in which to log the protocol commands.
  1111. // NULL is a valid value (no logging)
  1112. // pCallback(required) Specifies the Transport callback interface.
  1113. //
  1114. // Returns:
  1115. // E_INVALIDARG An invalid parameter was passed in
  1116. // E_OUTOFMEMORY An memory allocation failed
  1117. //
  1118. // -----------------------------------------------------------------------------------
  1119. HRESULT InitNew(
  1120. [in]
  1121. LPSTR pszLogFilePath,
  1122. [in]
  1123. ISMTPCallback *pCallback);
  1124. // -----------------------------------------------------------------------------------
  1125. // SendMessage
  1126. //
  1127. // Description:
  1128. // This method initiates the sending process. IInternetTransport::Connect must have
  1129. // been called before this method is called (i.e. the transport must be in the
  1130. // ready state). This method calls OnProgress throughout the transmission of
  1131. // pMessage->pstmMsg so that the client can display progress. When the message is
  1132. // fisnished, or if an error ocurrs, ITransportCallback::OnComplete is called.
  1133. //
  1134. // Parameters:
  1135. // pMessage(required) Contains the information for the message to send. This
  1136. // method duplicates the contents of pMessage and AddRefs,
  1137. // pMessage->pstmMsg so that the client can free pMessage
  1138. // immediately after calling this method.
  1139. //
  1140. // Returns:
  1141. // E_INVALIDARG pMessage is invalid or one of its members is invalid
  1142. // E_OUTOFMEMORY A memory allocation failed
  1143. // IXP_E_BUSY The transport is busy
  1144. // IXP_E_INVALID_ADDRESS_LIST SMTPMESSAGE::rInetAddrList contains invalid entries
  1145. // IXP_E_NOT_CONNECTED IInternetTransport::Connect has not been called, or
  1146. // the current connection has been lost. The transport
  1147. // will not automatically re-connect.
  1148. //
  1149. // -----------------------------------------------------------------------------------
  1150. HRESULT SendMessage(
  1151. [in]
  1152. LPSMTPMESSAGE pMessage);
  1153. // -----------------------------------------------------------------------------------
  1154. // CommandMAIL
  1155. // -----------------------------------------------------------------------------------
  1156. HRESULT CommandMAIL(
  1157. [in]
  1158. LPSTR pszEmailFrom);
  1159. // -----------------------------------------------------------------------------------
  1160. // CommandRCPT
  1161. // -----------------------------------------------------------------------------------
  1162. HRESULT CommandRCPT(
  1163. [in]
  1164. LPSTR pszEmailTo);
  1165. // -----------------------------------------------------------------------------------
  1166. // CommandEHLO
  1167. // -----------------------------------------------------------------------------------
  1168. HRESULT CommandEHLO(void);
  1169. // -----------------------------------------------------------------------------------
  1170. // CommandHELO
  1171. // -----------------------------------------------------------------------------------
  1172. HRESULT CommandHELO(void);
  1173. // -----------------------------------------------------------------------------------
  1174. // CommandHELO
  1175. // -----------------------------------------------------------------------------------
  1176. HRESULT CommandAUTH(
  1177. [in]
  1178. LPSTR pszAuthType);
  1179. // -----------------------------------------------------------------------------------
  1180. // CommandQUIT
  1181. // -----------------------------------------------------------------------------------
  1182. HRESULT CommandQUIT(void);
  1183. // -----------------------------------------------------------------------------------
  1184. // CommandRSET
  1185. // -----------------------------------------------------------------------------------
  1186. HRESULT CommandRSET(void);
  1187. // -----------------------------------------------------------------------------------
  1188. // CommandDATA
  1189. // -----------------------------------------------------------------------------------
  1190. HRESULT CommandDATA(void);
  1191. // -----------------------------------------------------------------------------------
  1192. // CommandDOT
  1193. // -----------------------------------------------------------------------------------
  1194. HRESULT CommandDOT(void);
  1195. // -----------------------------------------------------------------------------------
  1196. // SendDataStream - This method does a CommandDOT when it is finished.
  1197. // -----------------------------------------------------------------------------------
  1198. HRESULT SendDataStream(
  1199. [in]
  1200. IStream *pStream,
  1201. [in]
  1202. ULONG cbSize);
  1203. }
  1204. // ---------------------------------------------------------------------------------------
  1205. // IID_ISMTPTransport2
  1206. // ---------------------------------------------------------------------------------------
  1207. [
  1208. uuid(0DF2C7EC-3435-11d0-81D0-00C04FD85AB4),
  1209. helpstring("SMTP Transport Interface"),
  1210. ]
  1211. interface ISMTPTransport2 : ISMTPTransport
  1212. {
  1213. // -----------------------------------------------------------------------------------
  1214. // SMTPMESSAGE2
  1215. //
  1216. // Adds DSN (rfc1891) support. To receive DSNs the SMTP server must implement rfc1891
  1217. // and the SMTP transport must be initialized with an EHLO command
  1218. // -----------------------------------------------------------------------------------
  1219. typedef struct tagSMTPMESSAGE2 {
  1220. SMTPMESSAGE smtpMsg; // SMTPMESSAGE structure
  1221. LPSTR pszDSNENVID; // value for MAIL ENVID paramter
  1222. DSNRET dsnRet; // value for MAIL RET parameter
  1223. DWORD dwReserved;
  1224. DWORD dwReserved2;
  1225. } SMTPMESSAGE2, *LPSMTPMESSAGE2;
  1226. //***************************************************************************
  1227. // Function: SetWindow
  1228. //
  1229. // Purpose:
  1230. // This function creates a new window for async winsock processing
  1231. //
  1232. // Returns:
  1233. // HRESULT indicating success or failure.
  1234. //***************************************************************************
  1235. HRESULT SetWindow(void);
  1236. //***************************************************************************
  1237. // Function: ResetWindow
  1238. //
  1239. // Purpose:
  1240. // This function closes a window for async winsock processing
  1241. //
  1242. // Returns:
  1243. // HRESULT indicating success or failure.
  1244. //***************************************************************************
  1245. HRESULT ResetWindow(void);
  1246. // -----------------------------------------------------------------------------------
  1247. // SendMessage2
  1248. //
  1249. // Description:
  1250. // This method initiates the sending process. IInternetTransport::Connect must have
  1251. // been called before this method is called (i.e. the transport must be in the
  1252. // ready state). This method calls OnProgress throughout the transmission of
  1253. // pMessage->pstmMsg so that the client can display progress. When the message is
  1254. // fisnished, or if an error ocurrs, ITransportCallback::OnComplete is called.
  1255. //
  1256. // Parameters:
  1257. // pMessage(required) Contains the information for the message to send. This
  1258. // method duplicates the contents of pMessage and AddRefs,
  1259. // pMessage->pstmMsg so that the client can free pMessage
  1260. // immediately after calling this method.
  1261. //
  1262. // Returns:
  1263. // E_INVALIDARG pMessage is invalid or one of its members is invalid
  1264. // E_OUTOFMEMORY A memory allocation failed
  1265. // IXP_E_BUSY The transport is busy
  1266. // IXP_E_INVALID_ADDRESS_LIST SMTPMESSAGE::rInetAddrList contains invalid entries
  1267. // IXP_E_NOT_CONNECTED IInternetTransport::Connect has not been called, or
  1268. // the current connection has been lost. The transport
  1269. // will not automatically re-connect.
  1270. //
  1271. // -----------------------------------------------------------------------------------
  1272. HRESULT SendMessage2(
  1273. [in]
  1274. LPSMTPMESSAGE2 pMessage);
  1275. // -----------------------------------------------------------------------------------
  1276. // CommandRCPT2
  1277. // -----------------------------------------------------------------------------------
  1278. HRESULT CommandRCPT2(
  1279. [in]
  1280. LPSTR pszEmailTo,
  1281. [in]
  1282. INETADDRTYPE atDSN);
  1283. }
  1284. // ---------------------------------------------------------------------------------------
  1285. // IID_IDAVNamespaceArbiter
  1286. // ---------------------------------------------------------------------------------------
  1287. [
  1288. uuid(72A58FF8-227D-11d2-A8B5-0000F8084F96),
  1289. helpstring("DAV Namespace Arbiter"),
  1290. ]
  1291. interface IDAVNamespaceArbiter : IUnknown
  1292. {
  1293. HRESULT AddNamespace(
  1294. [in]
  1295. LPCSTR pszNamespace,
  1296. [out]
  1297. DWORD *pdwNamespaceID);
  1298. HRESULT GetNamespaceID(
  1299. [in]
  1300. LPCSTR pszNamespace,
  1301. [out]
  1302. DWORD *pdwNamespaceID);
  1303. HRESULT GetNamespacePrefix(
  1304. [in]
  1305. DWORD dwNamespaceID,
  1306. [out]
  1307. LPSTR *ppszNamespacePrefix);
  1308. }
  1309. // ---------------------------------------------------------------------------------------
  1310. // IID_IPropPatchRequest
  1311. // ---------------------------------------------------------------------------------------
  1312. [
  1313. uuid(AB8B8D2A-227F-11d2-A8B5-0000F8084F96),
  1314. helpstring("DAV PropPatch Request"),
  1315. ]
  1316. interface IPropPatchRequest : IDAVNamespaceArbiter
  1317. {
  1318. HRESULT SetProperty(
  1319. [in]
  1320. DWORD dwNamespaceID,
  1321. [in]
  1322. LPCSTR pszPropertyName,
  1323. [in]
  1324. LPCSTR pszNewValue);
  1325. HRESULT RemoveProperty(
  1326. [in]
  1327. DWORD dwNamespaceID,
  1328. [in]
  1329. LPCSTR pszPropertyName);
  1330. HRESULT GenerateXML(
  1331. [out]
  1332. LPSTR *pszXML);
  1333. }
  1334. // ---------------------------------------------------------------------------------------
  1335. // IID_IPropFindRequest
  1336. // ---------------------------------------------------------------------------------------
  1337. [
  1338. uuid(5CFC6308-0544-11d2-A894-0000F8084F96),
  1339. helpstring("DAV PropFind Request"),
  1340. ]
  1341. interface IPropFindRequest : IDAVNamespaceArbiter
  1342. {
  1343. HRESULT AddProperty(
  1344. [in]
  1345. DWORD dwNamespaceID,
  1346. [in]
  1347. LPCSTR pszPropertyName);
  1348. HRESULT GenerateXML(
  1349. [out]
  1350. LPSTR *pszXML);
  1351. }
  1352. // ---------------------------------------------------------------------------------------
  1353. // IID_IPropFindMultiResponse
  1354. // ---------------------------------------------------------------------------------------
  1355. [
  1356. uuid(0DEE87DE-0547-11d2-A894-0000F8084F96),
  1357. helpstring("DAV PropFind MultiResponse"),
  1358. ]
  1359. interface IPropFindMultiResponse : IUnknown
  1360. {
  1361. BOOL IsComplete(void);
  1362. HRESULT GetLength(
  1363. [out]
  1364. ULONG *pulLength);
  1365. HRESULT GetResponse(
  1366. [in]
  1367. ULONG ulIndex,
  1368. [out]
  1369. IPropFindResponse **ppResponse);
  1370. }
  1371. // ---------------------------------------------------------------------------------------
  1372. // IID_IPropFindResponse
  1373. // ---------------------------------------------------------------------------------------
  1374. [
  1375. uuid(8A523716-0548-11d2-A894-0000F8084F96),
  1376. helpstring("DAV PropFind Response"),
  1377. ]
  1378. interface IPropFindResponse : IUnknown
  1379. {
  1380. BOOL IsComplete(void);
  1381. HRESULT GetHref(
  1382. [out]
  1383. LPSTR *ppszHref);
  1384. HRESULT GetProperty(
  1385. [in]
  1386. DWORD dwNamespaceID,
  1387. [in]
  1388. LPCSTR pszPropertyName,
  1389. [out]
  1390. LPSTR *ppszPropertyValue);
  1391. }
  1392. // ---------------------------------------------------------------------------------------
  1393. // IID_IHTTPMailCallback
  1394. // ---------------------------------------------------------------------------------------
  1395. [
  1396. uuid(19F6481C-E5F0-11d1-A86E-0000F8084F96),
  1397. helpstring("HTTPMail Callback Interface"),
  1398. ]
  1399. interface IHTTPMailCallback : ITransportCallback
  1400. {
  1401. // -----------------------------------------------------------------------------------
  1402. // HTTPMAILCOMMAND
  1403. // -----------------------------------------------------------------------------------
  1404. typedef enum tagHTTPMAILCOMMAND
  1405. {
  1406. HTTPMAIL_NONE,
  1407. HTTPMAIL_GETPROP,
  1408. HTTPMAIL_GET,
  1409. HTTPMAIL_PUT,
  1410. HTTPMAIL_POST,
  1411. HTTPMAIL_DELETE,
  1412. HTTPMAIL_BDELETE,
  1413. HTTPMAIL_PROPFIND,
  1414. HTTPMAIL_PROPPATCH,
  1415. HTTPMAIL_MKCOL,
  1416. HTTPMAIL_COPY,
  1417. HTTPMAIL_BCOPY,
  1418. HTTPMAIL_MOVE,
  1419. HTTPMAIL_BMOVE,
  1420. HTTPMAIL_MEMBERINFO,
  1421. HTTPMAIL_FINDFOLDERS,
  1422. HTTPMAIL_MARKREAD,
  1423. HTTPMAIL_SENDMESSAGE,
  1424. HTTPMAIL_LISTCONTACTS,
  1425. HTTPMAIL_CONTACTINFO,
  1426. HTTPMAIL_POSTCONTACT,
  1427. HTTPMAIL_PATCHCONTACT
  1428. } HTTPMAILCOMMAND;
  1429. // -----------------------------------------------------------------------------------
  1430. // HTTPMAILGETPROP
  1431. // -----------------------------------------------------------------------------------
  1432. typedef struct tagHTTPMAILGETPROP
  1433. {
  1434. HTTPMAILPROPTYPE type;
  1435. LPSTR pszProp;
  1436. DWORD dwProp;
  1437. } HTTPMAILGETPROP, *LPHTTPMAILGETPROP;
  1438. // -----------------------------------------------------------------------------------
  1439. // HTTPMAILGET
  1440. // -----------------------------------------------------------------------------------
  1441. typedef struct tagHTTPMAILGET
  1442. {
  1443. BOOL fTotalKnown; // server provided a content-length (cbTotal is valid)
  1444. DWORD cbIncrement; // bytes in this response
  1445. DWORD cbCurrent; // bytes downloaded so far
  1446. DWORD cbTotal; // total bytes in the response (if fTotalKnown == TRUE)
  1447. LPVOID pvBody; // content bytes
  1448. LPSTR pszContentType;
  1449. } HTTPMAILGET, *LPHTTPMAILGET;
  1450. // -----------------------------------------------------------------------------------
  1451. // HTTPMAILPOST
  1452. // -----------------------------------------------------------------------------------
  1453. typedef struct tagHTTPMAILPOST
  1454. {
  1455. LPSTR pszLocation;
  1456. BOOL fResend;
  1457. DWORD cbIncrement;
  1458. DWORD cbCurrent;
  1459. DWORD cbTotal;
  1460. } HTTPMAILPOST, *LPHTTPMAILPOST;
  1461. // -----------------------------------------------------------------------------------
  1462. // HTTPMAILPROPFIND
  1463. // -----------------------------------------------------------------------------------
  1464. typedef struct tagHTTPMAILPROPFIND
  1465. {
  1466. IPropFindMultiResponse *pMultiResponse; // parsed propfind response
  1467. } HTTPMAILPROPFIND, *LPHTTPMAILPROPFIND;
  1468. // -----------------------------------------------------------------------------------
  1469. // HTTPMAILLOCATION
  1470. // -----------------------------------------------------------------------------------
  1471. typedef struct tagHTTPMAILLOCATION
  1472. {
  1473. LPSTR pszLocation;
  1474. } HTTPMAILLOCATION, *LPHTTPMAILLOCATION;
  1475. // -----------------------------------------------------------------------------------
  1476. // HTTPMAILBCOPYMOVE
  1477. // -----------------------------------------------------------------------------------
  1478. typedef struct tagHTTPMAILBCOPYMOVE
  1479. {
  1480. LPSTR pszHref;
  1481. LPSTR pszLocation;
  1482. HRESULT hrResult;
  1483. } HTTPMAILBCOPYMOVE, *LPHTTPMAILBCOPYMOVE;
  1484. // -----------------------------------------------------------------------------------
  1485. // HTTPMAILBCOPYMOVELIST
  1486. // -----------------------------------------------------------------------------------
  1487. typedef struct tagHTTPMAILBCOPYMOVELIST
  1488. {
  1489. ULONG cBCopyMove;
  1490. LPHTTPMAILBCOPYMOVE prgBCopyMove;
  1491. } HTTPMAILBCOPYMOVELIST, *LPHTTPMAILBCOPYMOVELIST;
  1492. // -----------------------------------------------------------------------------------
  1493. // HTTPMAILMEMBERINFO
  1494. // -----------------------------------------------------------------------------------
  1495. typedef struct tagHTTPMEMBERINFO
  1496. {
  1497. // common properties
  1498. LPSTR pszHref;
  1499. BOOL fIsFolder;
  1500. // folder properties
  1501. LPSTR pszDisplayName;
  1502. BOOL fHasSubs;
  1503. BOOL fNoSubs;
  1504. DWORD dwUnreadCount;
  1505. DWORD dwVisibleCount;
  1506. HTTPMAILSPECIALFOLDER tySpecial;
  1507. // message properties
  1508. BOOL fRead;
  1509. BOOL fHasAttachment;
  1510. LPSTR pszTo;
  1511. LPSTR pszFrom;
  1512. LPSTR pszSubject;
  1513. LPSTR pszDate;
  1514. DWORD dwContentLength;
  1515. } HTTPMEMBERINFO, *LPHTTPMEMBERINFO;
  1516. // -----------------------------------------------------------------------------------
  1517. // HTTPMEMBERINFOLIST
  1518. // -----------------------------------------------------------------------------------
  1519. typedef struct tagHTTPMEMBERINFOLIST
  1520. {
  1521. ULONG cMemberInfo; // count of elements in prgMemberInfo
  1522. LPHTTPMEMBERINFO prgMemberInfo; // array of HTTPMEMBERINFO
  1523. LPSTR pszRootTimeStamp;
  1524. LPSTR pszFolderTimeStamp;
  1525. } HTTPMEMBERINFOLIST, *LPHTTPMEMBERINFOLIST;
  1526. // -----------------------------------------------------------------------------------
  1527. // HTTPMEMBERERROR
  1528. // -----------------------------------------------------------------------------------
  1529. typedef struct tagHTTPMEMBERERROR
  1530. {
  1531. LPSTR pszHref;
  1532. HRESULT hrResult;
  1533. } HTTPMEMBERERROR, *LPHTTPMEMBERERROR;
  1534. // -----------------------------------------------------------------------------------
  1535. // HTTPMEMBERERRORLIST
  1536. // -----------------------------------------------------------------------------------
  1537. typedef struct tagHTTPMEMBERERRORLIST
  1538. {
  1539. ULONG cMemberError;
  1540. LPHTTPMEMBERERROR prgMemberError;
  1541. } HTTPMEMBERERRORLIST, *LPHTTPMEMBERERRORLIST;
  1542. // -----------------------------------------------------------------------------------
  1543. // HTTPCONTACTID
  1544. // -----------------------------------------------------------------------------------
  1545. typedef struct tagHTTPCONTACTID
  1546. {
  1547. LPSTR pszHref;
  1548. LPSTR pszId;
  1549. HTTPMAILCONTACTTYPE tyContact;
  1550. LPSTR pszModified;
  1551. } HTTPCONTACTID, *LPHTTPCONTACTID;
  1552. // -----------------------------------------------------------------------------------
  1553. // HTTPCONTACTIDLIST
  1554. // -----------------------------------------------------------------------------------
  1555. typedef struct tagHTTPCONTACTIDLIST
  1556. {
  1557. ULONG cContactId; // number of elements in prgContactId
  1558. LPHTTPCONTACTID prgContactId; // array cf contact ids
  1559. } HTTPCONTACTIDLIST, *LPHTTPCONTACTIDLIST;
  1560. // -----------------------------------------------------------------------------------
  1561. // HTTPCONTACTINFO
  1562. // -----------------------------------------------------------------------------------
  1563. typedef struct tagHTTPCONTACTINFO
  1564. {
  1565. LPSTR pszHref;
  1566. LPSTR pszId;
  1567. HTTPMAILCONTACTTYPE tyContact;
  1568. LPSTR pszModified;
  1569. LPSTR pszDisplayName;
  1570. LPSTR pszGivenName;
  1571. LPSTR pszSurname;
  1572. LPSTR pszNickname;
  1573. LPSTR pszEmail;
  1574. LPSTR pszHomeStreet;
  1575. LPSTR pszHomeCity;
  1576. LPSTR pszHomeState;
  1577. LPSTR pszHomePostalCode;
  1578. LPSTR pszHomeCountry;
  1579. LPSTR pszCompany;
  1580. LPSTR pszWorkStreet;
  1581. LPSTR pszWorkCity;
  1582. LPSTR pszWorkState;
  1583. LPSTR pszWorkPostalCode;
  1584. LPSTR pszWorkCountry;
  1585. LPSTR pszHomePhone;
  1586. LPSTR pszHomeFax;
  1587. LPSTR pszWorkPhone;
  1588. LPSTR pszWorkFax;
  1589. LPSTR pszMobilePhone;
  1590. LPSTR pszOtherPhone;
  1591. LPSTR pszBday;
  1592. LPSTR pszPager;
  1593. } HTTPCONTACTINFO, *LPHTTPCONTACTINFO;
  1594. // -----------------------------------------------------------------------------------
  1595. // HTTPCONTACTINFOLIST
  1596. // -----------------------------------------------------------------------------------
  1597. typedef struct tagHTTPCONTACTINFOLIST
  1598. {
  1599. ULONG cContactInfo;
  1600. LPHTTPCONTACTINFO prgContactInfo;
  1601. } HTTPCONTACTINFOLIST, *LPHTTPCONTACTINFOLIST;
  1602. // -----------------------------------------------------------------------------------
  1603. // HTTPMAILRESPONSE
  1604. // -----------------------------------------------------------------------------------
  1605. typedef struct tagHTTPMAILRESPONSE
  1606. {
  1607. HTTPMAILCOMMAND command; // Command for which the response was generated
  1608. DWORD dwContext; // Client context
  1609. BOOL fDone; // Is this the last response for the command
  1610. IXPRESULT rIxpResult; // Result information
  1611. IHTTPMailTransport *pTransport; // Pointer to the HTTPMail transport that generated the response
  1612. // This is a union of response information based on the command
  1613. [switch_type(HTTPMAILCOMMAND), switch_is((HTTPMAILCOMMAND)command)]
  1614. union
  1615. {
  1616. [case(HTTPMAIL_GETPROP)] HTTPMAILGETPROP rGetPropInfo;
  1617. [case(HTTPMAIL_GET)] HTTPMAILGET rGetInfo;
  1618. [case(HTTPMAIL_PUT)] HTTPMAILPOST rPutInfo;
  1619. [case(HTTPMAIL_POST)] HTTPMAILPOST rPostInfo;
  1620. [case(HTTPMAIL_PROPFIND)] HTTPMAILPROPFIND rPropFindInfo;
  1621. [case(HTTPMAIL_MKCOL)]HTTPMAILLOCATION rMkColInfo;
  1622. [case(HTTPMAIL_COPY)]HTTPMAILLOCATION rCopyMoveInfo;
  1623. [case(HTTPMAIL_BCOPY)]HTTPMAILBCOPYMOVELIST rBCopyMoveList;
  1624. [case(HTTPMAIL_MEMBERINFO)] HTTPMEMBERINFOLIST rMemberInfoList; // response for MemberInfo, FindFolders
  1625. [case(HTTPMAIL_MARKREAD)] HTTPMEMBERERRORLIST rMemberErrorList; // response for MarkRead, BDELETE
  1626. [case(HTTPMAIL_SENDMESSAGE)] HTTPMAILPOST rSendMessageInfo;
  1627. [case(HTTPMAIL_LISTCONTACTS)] HTTPCONTACTIDLIST rContactIdList;
  1628. [case(HTTPMAIL_CONTACTINFO)] HTTPCONTACTINFOLIST rContactInfoList;
  1629. [case(HTTPMAIL_POSTCONTACT)] HTTPCONTACTID rPostContactInfo;
  1630. [case(HTTPMAIL_PATCHCONTACT)] HTTPCONTACTID rPatchContactInfo;
  1631. [default];
  1632. };
  1633. } HTTPMAILRESPONSE, *LPHTTPMAILRESPONSE;
  1634. // -----------------------------------------------------------------------------------
  1635. // OnResponse
  1636. //
  1637. // Description
  1638. // Called by IHTTPMailTransport when a command response is received from the HTTP server
  1639. //
  1640. // Paramters
  1641. // pResponse Response information
  1642. //
  1643. // Return values:
  1644. // S_OK The client should always return S_OK
  1645. //
  1646. // -----------------------------------------------------------------------------------
  1647. HRESULT OnResponse(
  1648. [in]
  1649. LPHTTPMAILRESPONSE pResponse);
  1650. HRESULT GetParentWindow(
  1651. [out]
  1652. HWND *phwndParent);
  1653. }
  1654. // ---------------------------------------------------------------------------------------
  1655. // IID_IHTTPMailTransport
  1656. // ---------------------------------------------------------------------------------------
  1657. [
  1658. uuid(B8BDE03C-E548-11d1-A86E-0000F8084F96),
  1659. helpstring("HTTPMail Internet Transport Interface"),
  1660. ]
  1661. interface IHTTPMailTransport : IInternetTransport
  1662. {
  1663. typedef struct tagHTTPTARGETLIST
  1664. {
  1665. ULONG cTarget;
  1666. LPCSTR *prgTarget;
  1667. } HTTPTARGETLIST, *LPHTTPTARGETLIST;
  1668. // -----------------------------------------------------------------------------------
  1669. // InitNew
  1670. //
  1671. // Description:
  1672. // This method Initializes the internet transport. This method be called before
  1673. // the transport can doing anything.
  1674. //
  1675. // Parameters:
  1676. // pszUserAgent User agent string sent in http queries
  1677. //
  1678. // pszLogFilePath Full file path in which to log the protocol commands.
  1679. // NULL is a valid value (no logging)
  1680. // pCallback(required) Specifies the Transport callback interface.
  1681. //
  1682. // Returns:
  1683. // E_INVALIDARG An invalid parameter was passed in
  1684. // E_OUTOFMEMORY An memory allocation failed
  1685. //
  1686. // -----------------------------------------------------------------------------------
  1687. HRESULT InitNew(
  1688. [in]
  1689. LPCSTR pszUserAgent,
  1690. [in]
  1691. LPCSTR pszLogFilePath,
  1692. [in]
  1693. IHTTPMailCallback *pCallback);
  1694. // -----------------------------------------------------------------------------------
  1695. // CommandGET
  1696. // rgszAcceptTypes is a null terminated list of accept types.
  1697. // -----------------------------------------------------------------------------------
  1698. HRESULT CommandGET(
  1699. [in]
  1700. LPCSTR pszPath,
  1701. [in]
  1702. LPCSTR *rgszAcceptTypes,
  1703. [in]
  1704. BOOL fTranslate,
  1705. [in]
  1706. DWORD dwContext);
  1707. // -----------------------------------------------------------------------------------
  1708. // CommandPUT
  1709. // -----------------------------------------------------------------------------------
  1710. HRESULT CommandPUT(
  1711. [in]
  1712. LPCSTR pszPath,
  1713. [in]
  1714. LPVOID lpvData,
  1715. [in]
  1716. ULONG cbSize,
  1717. [in]
  1718. DWORD dwContext);
  1719. // -----------------------------------------------------------------------------------
  1720. // CommandPOST
  1721. // -----------------------------------------------------------------------------------
  1722. HRESULT CommandPOST(
  1723. [in]
  1724. LPCSTR pszPath,
  1725. [in]
  1726. IStream *pStream,
  1727. [in]
  1728. LPCSTR pszContentType,
  1729. [in]
  1730. DWORD dwContext);
  1731. // -----------------------------------------------------------------------------------
  1732. // CommandDELETE
  1733. // -----------------------------------------------------------------------------------
  1734. HRESULT CommandDELETE(
  1735. [in]
  1736. LPCSTR pszPath,
  1737. [in]
  1738. DWORD dwContext);
  1739. // -----------------------------------------------------------------------------------
  1740. // CommandBDELETE
  1741. // -----------------------------------------------------------------------------------
  1742. HRESULT CommandBDELETE(
  1743. [in]
  1744. LPCSTR pszSourceCollection,
  1745. [in]
  1746. LPHTTPTARGETLIST pTargets,
  1747. [in]
  1748. DWORD dwContext);
  1749. // -----------------------------------------------------------------------------------
  1750. // CommandPROPFIND
  1751. // -----------------------------------------------------------------------------------
  1752. HRESULT CommandPROPFIND(
  1753. [in]
  1754. LPCSTR pszPath,
  1755. [in]
  1756. IPropFindRequest *pRequest,
  1757. [in]
  1758. DWORD dwDepth,
  1759. [in]
  1760. DWORD dwContext);
  1761. // -----------------------------------------------------------------------------------
  1762. // CommandPROPPATCH
  1763. // -----------------------------------------------------------------------------------
  1764. HRESULT CommandPROPPATCH(
  1765. [in]
  1766. LPCSTR pszPath,
  1767. [in]
  1768. IPropPatchRequest *pRequest,
  1769. [in]
  1770. DWORD dwContext);
  1771. // -----------------------------------------------------------------------------------
  1772. // CommandMKCOL
  1773. // -----------------------------------------------------------------------------------
  1774. HRESULT CommandMKCOL(
  1775. [in]
  1776. LPCSTR pszPath,
  1777. [in]
  1778. DWORD dwContext);
  1779. // -----------------------------------------------------------------------------------
  1780. // CommandCOPY
  1781. // -----------------------------------------------------------------------------------
  1782. HRESULT CommandCOPY(
  1783. [in]
  1784. LPCSTR pszPath,
  1785. [in]
  1786. LPCSTR pszDestination,
  1787. [in]
  1788. BOOL fAllowRename,
  1789. [in]
  1790. DWORD dwContext);
  1791. // -----------------------------------------------------------------------------------
  1792. // CommandBCOPY
  1793. // -----------------------------------------------------------------------------------
  1794. HRESULT CommandBCOPY(
  1795. [in]
  1796. LPCSTR pszSourceCollection,
  1797. [in]
  1798. LPHTTPTARGETLIST pTargets,
  1799. [in]
  1800. LPCSTR pszDestCollection,
  1801. [in]
  1802. LPHTTPTARGETLIST pDestinations,
  1803. [in]
  1804. BOOL fAllowRename,
  1805. [in]
  1806. DWORD dwContext);
  1807. // -----------------------------------------------------------------------------------
  1808. // CommandMOVE
  1809. // -----------------------------------------------------------------------------------
  1810. HRESULT CommandMOVE(
  1811. [in]
  1812. LPCSTR pszPath,
  1813. [in]
  1814. LPCSTR pszDestination,
  1815. [in]
  1816. BOOL fAllowRename,
  1817. [in]
  1818. DWORD dwContext);
  1819. // -----------------------------------------------------------------------------------
  1820. // CommandBMOVE
  1821. // -----------------------------------------------------------------------------------
  1822. HRESULT CommandBMOVE(
  1823. [in]
  1824. LPCSTR pszSourceCollection,
  1825. [in]
  1826. LPHTTPTARGETLIST pTargets,
  1827. [in]
  1828. LPCSTR pszDestCollection,
  1829. [in]
  1830. LPHTTPTARGETLIST pDestinations,
  1831. [in]
  1832. BOOL fAllowRename,
  1833. [in]
  1834. DWORD dwContext);
  1835. // -----------------------------------------------------------------------------------
  1836. // GetProperty
  1837. // Retrieves the requested account property synchronously or asynchronously.
  1838. // If the property is immediately available, it is returned synchronously,
  1839. // and the result of the function is S_OK. In the sync case, it is the caller's
  1840. // responsibility to free the property string by calling CoTaskMemFree.
  1841. // If the property is not available immediately, the function result is
  1842. // E_PENDING, and the result is returned via a call to the callback's
  1843. // OnResponse method.
  1844. //
  1845. // The caller can force the call to return async by passing a null ppszProp.
  1846. // The call CANNOT force the call to return sync.
  1847. //
  1848. // Returns: if requesting the root props succeeded, and the server returned
  1849. // xml that did not contain the specific root property requested by the client,
  1850. // the return value will be IXP_E_HTTP_ROOT_PROP_NOT_FOUND.
  1851. // -----------------------------------------------------------------------------------
  1852. HRESULT GetProperty(
  1853. [in]
  1854. HTTPMAILPROPTYPE proptype,
  1855. [out]
  1856. LPSTR *ppszProp);
  1857. // -----------------------------------------------------------------------------------
  1858. // MemberInfo
  1859. //
  1860. // Description:
  1861. // This method is called to discover folders, messages, and specific properties
  1862. // of folders and messages.
  1863. //
  1864. // Parameters:
  1865. //
  1866. // pszPath null terminated string that is the complete path
  1867. // to the resource (or collection)
  1868. // examples:
  1869. // a message: "http://www.hotmail.com/inbox/msg12345
  1870. // a folder: "http://www.hotmail.com/inbox/"
  1871. // MEMBERINFOFLAGS flags that define which properties should be requested
  1872. // dwDepth maps to the DAV depth header. Can be an integer or the
  1873. // constant DEPTH_INFINITY. A depth of 0 means request
  1874. // properties on the resource at pszPath. A depth of
  1875. // 1 means request properties on the resource at pszPath
  1876. // and at all of its first-level children, etc.
  1877. // fIncludeRoot boolean indicating whether or not to include the item
  1878. // at pszPath in the response. Maps to the "noroot" token
  1879. // optionally included in the DAV depth header. To request
  1880. // properties on all of the first-level members of a
  1881. // resource, and omit the resource itself from the response,
  1882. // set dwDepth = 1 and fIncludeRoot = FALSE.
  1883. // -----------------------------------------------------------------------------------
  1884. HRESULT MemberInfo(
  1885. [in]
  1886. LPCSTR pszPath,
  1887. [in]
  1888. MEMBERINFOFLAGS flags,
  1889. [in]
  1890. DWORD dwDepth,
  1891. [in]
  1892. BOOL fIncludeRoot,
  1893. [in]
  1894. DWORD dwContext);
  1895. // -----------------------------------------------------------------------------------
  1896. // FindFolders
  1897. //
  1898. // Description:
  1899. // This method is called to discover the collection hierarchy that exists underneath
  1900. // the pszPath URL. The response is identical to the MemberInfo response. This method
  1901. // causes a non-DAV 1.0 verb (SEARCH) to be sent to the server. Callers should be
  1902. // prepared to fallback to other forms of folder discovery if this method fails.
  1903. //
  1904. // Parameters:
  1905. //
  1906. // pszPath null terminated string that is the complete path
  1907. // to the root of the folder hiearchy. The collection at
  1908. // pszPath will not be included in the response.
  1909. //
  1910. // dwContext context provided by caller.
  1911. // -----------------------------------------------------------------------------------
  1912. HRESULT FindFolders(
  1913. [in]
  1914. LPCSTR pszPath,
  1915. [in]
  1916. DWORD dwContext);
  1917. // -----------------------------------------------------------------------------------
  1918. // MarkRead
  1919. // -----------------------------------------------------------------------------------
  1920. HRESULT MarkRead(
  1921. [in]
  1922. LPCSTR pszPath,
  1923. [in]
  1924. LPHTTPTARGETLIST pTargets,
  1925. [in]
  1926. BOOL fMarkRead,
  1927. [in]
  1928. DWORD dwContext);
  1929. // -----------------------------------------------------------------------------------
  1930. // SendMessage:
  1931. // Send a message using an http server that supports the http-based RFC821
  1932. // send protocol.
  1933. //
  1934. // Parameters:
  1935. //
  1936. // pszPath "sendmsg" url. server url that can receive
  1937. // "POST" commands with request bodies that
  1938. // conform to the http mail spec.
  1939. // pszFrom The "from" address associated with the outbound
  1940. // mail. This address must be of the form:
  1941. // [email protected]
  1942. // pTargets List of e-mail address that will receive
  1943. // copies of the message. This list should include
  1944. // all direct recipients as well as "cc" and "bcc"
  1945. // recipients. Addresses must be of the form:
  1946. // [email protected]
  1947. // fSaveInSent Indicates whether or not the server should save
  1948. // a copy of the outbound message in the users
  1949. // "Sent Items" folder. It is up to the server
  1950. // to determine the specific behavior associated
  1951. // with saving an outboundmessage.
  1952. // pMessageStream A stream that contains an rfc822 compliant
  1953. // message. The contents of this stream are not
  1954. // validated by this API. It is the responsibility
  1955. // of the caller to insure that the message is
  1956. // rfc822 compliant.
  1957. // dwContext A dword which indentifies the specific request.
  1958. // This dword will be included in all async responses,
  1959. // and enables the caller to uniquely identify the request.
  1960. // -----------------------------------------------------------------------------------
  1961. HRESULT SendMessage(
  1962. [in]
  1963. LPCSTR pszPath,
  1964. [in]
  1965. LPCSTR pszFrom,
  1966. [in]
  1967. LPHTTPTARGETLIST pTargets,
  1968. [in]
  1969. BOOL fSaveInSent,
  1970. [in]
  1971. IStream *pMessageStream,
  1972. [in]
  1973. DWORD dwContext);
  1974. // -----------------------------------------------------------------------------------
  1975. // ListContacts
  1976. // -----------------------------------------------------------------------------------
  1977. HRESULT ListContacts(
  1978. [in]
  1979. LPCSTR pszPath,
  1980. [in]
  1981. DWORD dwContext);
  1982. // -----------------------------------------------------------------------------------
  1983. // ListContactInfos : temporary method. pszPath is assumed to be a collection.
  1984. // returns all contacts in the specified collection. this method will go away
  1985. // when the hotmail server supports bpropfind. response is contained in the
  1986. // rContactInfoList and the command is the same as ContactInfo.
  1987. // -----------------------------------------------------------------------------------
  1988. HRESULT ListContactInfos(
  1989. [in]
  1990. LPCSTR pszCollectionPath,
  1991. [in]
  1992. DWORD dwContext);
  1993. // -----------------------------------------------------------------------------------
  1994. // ContactInfo
  1995. // -----------------------------------------------------------------------------------
  1996. HRESULT ContactInfo(
  1997. [in]
  1998. LPCSTR pszPath,
  1999. [in]
  2000. DWORD dwContext);
  2001. // -----------------------------------------------------------------------------------
  2002. // PostContact
  2003. // -----------------------------------------------------------------------------------
  2004. HRESULT PostContact(
  2005. [in]
  2006. LPCSTR pszPath,
  2007. [in]
  2008. LPHTTPCONTACTINFO pciInfo,
  2009. [in]
  2010. DWORD dwContext);
  2011. // -----------------------------------------------------------------------------------
  2012. // PatchContact
  2013. // -----------------------------------------------------------------------------------
  2014. HRESULT PatchContact(
  2015. [in]
  2016. LPCSTR pszPath,
  2017. [in]
  2018. LPHTTPCONTACTINFO pciInfo,
  2019. [in]
  2020. DWORD dwContext);
  2021. //------------------------------------------------------------------------------------
  2022. // GetPropertyDw
  2023. // This behaves similar to GetProperty but retrieves a dword property
  2024. //------------------------------------------------------------------------------------
  2025. HRESULT GetPropertyDw(
  2026. [in]
  2027. HTTPMAILPROPTYPE proptype,
  2028. [out]
  2029. LPDWORD lpdwProp);
  2030. }
  2031. //------------------------------------------------------------------------------------
  2032. // IID_IHTTPMailTransport2
  2033. //------------------------------------------------------------------------------------
  2034. [
  2035. uuid(82758005-D38A-11d3-8E81-00C04F79E13B),
  2036. helpstring("HTTPMail Internet Transport Interface2"),
  2037. ]
  2038. interface IHTTPMailTransport2 : IUnknown
  2039. {
  2040. HRESULT RootMemberInfo(
  2041. [in]
  2042. LPCSTR pszPath,
  2043. [in]
  2044. MEMBERINFOFLAGS flags,
  2045. [in]
  2046. DWORD dwDepth,
  2047. [in]
  2048. BOOL fIncludeRoot,
  2049. [in]
  2050. DWORD dwContext,
  2051. [in]
  2052. LPSTR pszRootTimeStamp,
  2053. [in]
  2054. LPSTR pszInboxTimeStamp);
  2055. HRESULT FolderMemberInfo(
  2056. [in]
  2057. LPCSTR pszPath,
  2058. [in]
  2059. MEMBERINFOFLAGS flags,
  2060. [in]
  2061. DWORD dwDepth,
  2062. [in]
  2063. BOOL fIncludeRoot,
  2064. [in]
  2065. DWORD dwContext,
  2066. [in]
  2067. LPSTR pszFolderTimeStamp,
  2068. [in]
  2069. LPSTR pszFolderName);
  2070. }
  2071. // ---------------------------------------------------------------------------------------
  2072. // IID_IPOP3Callback
  2073. // ---------------------------------------------------------------------------------------
  2074. [
  2075. uuid(0DF2C7E3-3435-11d0-81D0-00C04FD85AB4),
  2076. helpstring("POP3 Callback Interface"),
  2077. ]
  2078. interface IPOP3Callback : ITransportCallback
  2079. {
  2080. // -----------------------------------------------------------------------------------
  2081. // POP3COMMAND
  2082. // -----------------------------------------------------------------------------------
  2083. typedef enum tagPOP3COMMAND {
  2084. POP3_NONE,
  2085. POP3_BANNER,
  2086. POP3_CONNECTED,
  2087. POP3_USER,
  2088. POP3_PASS,
  2089. POP3_AUTH,
  2090. POP3_UIDL,
  2091. POP3_STAT,
  2092. POP3_LIST,
  2093. POP3_DELE,
  2094. POP3_RETR,
  2095. POP3_TOP,
  2096. POP3_NOOP,
  2097. POP3_QUIT,
  2098. POP3_RSET,
  2099. POP3_CUSTOM
  2100. } POP3COMMAND;
  2101. // -----------------------------------------------------------------------------------
  2102. // POP3RETR
  2103. // -----------------------------------------------------------------------------------
  2104. typedef struct tagPOP3RETR {
  2105. BOOL fHeader; // The full rfc/mime header has been downloaded.
  2106. BOOL fBody; // The body has been downloaded.
  2107. DWORD dwPopId; // POP session message id
  2108. DWORD cbSoFar; // Number of bytes downloaded since start of download
  2109. LPSTR pszLines; // Lines of the message (do not free this).
  2110. ULONG cbLines; // Number of bytes in pszLines
  2111. } POP3RETR, *LPPOP3RETR;
  2112. // -----------------------------------------------------------------------------------
  2113. // POP3TOP
  2114. // -----------------------------------------------------------------------------------
  2115. typedef struct tagPOP3TOP {
  2116. BOOL fHeader; // The header has been downloaded.
  2117. BOOL fBody; // The body has been downloaded.
  2118. DWORD dwPopId; // POP session message id
  2119. DWORD cPreviewLines; // Number of lines being previewed
  2120. DWORD cbSoFar; // Number of bytes downloaded since start of download
  2121. LPSTR pszLines; // Header lines
  2122. ULONG cbLines; // Number of bytes in pszLines
  2123. } POP3TOP, *LPPOP3TOP;
  2124. // -----------------------------------------------------------------------------------
  2125. // POP3LIST
  2126. // -----------------------------------------------------------------------------------
  2127. typedef struct tagPOP3LIST {
  2128. DWORD dwPopId; // POP session message id
  2129. DWORD cbSize; // Message Size
  2130. } POP3LIST, *LPPOP3LIST;
  2131. // -----------------------------------------------------------------------------------
  2132. // POP3UIDL
  2133. // -----------------------------------------------------------------------------------
  2134. typedef struct tagPOP3UIDL {
  2135. DWORD dwPopId; // POP session message id
  2136. LPSTR pszUidl; // POP UIDL
  2137. } POP3UIDL, *LPPOP3UIDL;
  2138. // -----------------------------------------------------------------------------------
  2139. // POP3STAT
  2140. // -----------------------------------------------------------------------------------
  2141. typedef struct tagPOP3STAT {
  2142. DWORD cMessages; // Number of messages on the server
  2143. DWORD cbMessages; // Number of bytes of messages on the server
  2144. } POP3STAT, *LPPOP3STAT;
  2145. // -----------------------------------------------------------------------------------
  2146. // POP3RESPONSE
  2147. // -----------------------------------------------------------------------------------
  2148. typedef struct tagPOP3RESPONSE {
  2149. POP3COMMAND command; // Command in which the response was generated for
  2150. BOOL fDone; // Was this the last response for this command
  2151. IXPRESULT rIxpResult; // Result Information
  2152. IPOP3Transport *pTransport; // Pointer to the POP3 transport that generated the response
  2153. BOOL fValidInfo; // The data in the union below is valid. This can be FALSE due to the
  2154. // fact that the fDone == TRUE response can be received with
  2155. // no data.
  2156. // This is a union of response information based on the command
  2157. [switch_type(POP3COMMAND), switch_is((POP3COMMAND)command)]
  2158. union {
  2159. [case(POP3_UIDL)] POP3UIDL rUidlInfo;
  2160. [case(POP3_STAT)] POP3STAT rStatInfo;
  2161. [case(POP3_LIST)] POP3LIST rListInfo;
  2162. [case(POP3_DELE)] DWORD dwPopId;
  2163. [case(POP3_RETR)] POP3RETR rRetrInfo;
  2164. [case(POP3_TOP)] POP3TOP rTopInfo;
  2165. [default];
  2166. };
  2167. } POP3RESPONSE, *LPPOP3RESPONSE;
  2168. // -----------------------------------------------------------------------------------
  2169. // OnResponse
  2170. // -----------------------------------------------------------------------------------
  2171. HRESULT OnResponse(
  2172. [in]
  2173. LPPOP3RESPONSE pResponse);
  2174. }
  2175. // ---------------------------------------------------------------------------------------
  2176. // IID_IPOP3Transport
  2177. // ---------------------------------------------------------------------------------------
  2178. [
  2179. uuid(0DF2C7E4-3435-11d0-81D0-00C04FD85AB4),
  2180. helpstring("POP3 Internet Transport Interface"),
  2181. ]
  2182. interface IPOP3Transport : IInternetTransport
  2183. {
  2184. // -----------------------------------------------------------------------------------
  2185. // POP3 Group/List/Single Item commands
  2186. // -----------------------------------------------------------------------------------
  2187. typedef enum tagPOP3CMDTYPE {
  2188. POP3CMD_GET_POPID,
  2189. POP3CMD_GET_MARKED,
  2190. POP3CMD_GET_ALL
  2191. } POP3CMDTYPE;
  2192. // -----------------------------------------------------------------------------------
  2193. // InitNew
  2194. //
  2195. // Description:
  2196. // This method Initializes the internet transport. This method be called before
  2197. // the transport can doing anything.
  2198. //
  2199. // Parameters:
  2200. // pszLogFilePath Full file path in which to log the protocol commands.
  2201. // NULL is a valid value (no logging)
  2202. // pCallback(required) Specifies the Transport callback interface.
  2203. //
  2204. // Returns:
  2205. // E_INVALIDARG An invalid parameter was passed in
  2206. // E_OUTOFMEMORY An memory allocation failed
  2207. //
  2208. // -----------------------------------------------------------------------------------
  2209. HRESULT InitNew(
  2210. [in]
  2211. LPSTR pszLogFilePath,
  2212. [in]
  2213. IPOP3Callback *pCallback);
  2214. // -----------------------------------------------------------------------------------
  2215. // MarkItem
  2216. // -----------------------------------------------------------------------------------
  2217. typedef enum tagPOP3MARKTYPE {
  2218. POP3_MARK_FOR_TOP = 0x00000001,
  2219. POP3_MARK_FOR_RETR = 0x00000002,
  2220. POP3_MARK_FOR_DELE = 0x00000004,
  2221. POP3_MARK_FOR_UIDL = 0x00000008,
  2222. POP3_MARK_FOR_LIST = 0x00000010
  2223. } POP3MARKTYPE;
  2224. HRESULT MarkItem(
  2225. [in]
  2226. POP3MARKTYPE marktype,
  2227. [in]
  2228. DWORD dwPopId,
  2229. [in]
  2230. boolean fMarked);
  2231. // -----------------------------------------------------------------------------------
  2232. // CommandAUTH
  2233. // -----------------------------------------------------------------------------------
  2234. HRESULT CommandAUTH(
  2235. [in]
  2236. LPSTR pszAuthType);
  2237. // -----------------------------------------------------------------------------------
  2238. // CommandUSER
  2239. // -----------------------------------------------------------------------------------
  2240. HRESULT CommandUSER(
  2241. [in]
  2242. LPSTR pszUserName);
  2243. // -----------------------------------------------------------------------------------
  2244. // CommandPass
  2245. // -----------------------------------------------------------------------------------
  2246. HRESULT CommandPASS(
  2247. [in]
  2248. LPSTR pszPassword);
  2249. // -----------------------------------------------------------------------------------
  2250. // CommandLIST
  2251. // -----------------------------------------------------------------------------------
  2252. HRESULT CommandLIST(
  2253. [in]
  2254. POP3CMDTYPE cmdtype,
  2255. [in]
  2256. DWORD dwPopId);
  2257. // -----------------------------------------------------------------------------------
  2258. // CommandTOP
  2259. // -----------------------------------------------------------------------------------
  2260. HRESULT CommandTOP(
  2261. [in]
  2262. POP3CMDTYPE cmdtype,
  2263. [in]
  2264. DWORD dwPopId,
  2265. [in]
  2266. DWORD cPreviewLines);
  2267. // -----------------------------------------------------------------------------------
  2268. // CommandQUIT
  2269. // -----------------------------------------------------------------------------------
  2270. HRESULT CommandQUIT(void);
  2271. // -----------------------------------------------------------------------------------
  2272. // CommandSTAT
  2273. // -----------------------------------------------------------------------------------
  2274. HRESULT CommandSTAT(void);
  2275. // -----------------------------------------------------------------------------------
  2276. // CommandNOOP
  2277. // -----------------------------------------------------------------------------------
  2278. HRESULT CommandNOOP(void);
  2279. // -----------------------------------------------------------------------------------
  2280. // CommandRSET
  2281. // -----------------------------------------------------------------------------------
  2282. HRESULT CommandRSET(void);
  2283. // -----------------------------------------------------------------------------------
  2284. // CommandUIDL
  2285. // -----------------------------------------------------------------------------------
  2286. HRESULT CommandUIDL(
  2287. [in]
  2288. POP3CMDTYPE cmdtype,
  2289. [in]
  2290. DWORD dwPopId);
  2291. // -----------------------------------------------------------------------------------
  2292. // CommandDELE
  2293. // -----------------------------------------------------------------------------------
  2294. HRESULT CommandDELE(
  2295. [in]
  2296. POP3CMDTYPE cmdtype,
  2297. [in]
  2298. DWORD dwPopId);
  2299. // -----------------------------------------------------------------------------------
  2300. // CommandRETR
  2301. // -----------------------------------------------------------------------------------
  2302. HRESULT CommandRETR(
  2303. [in]
  2304. POP3CMDTYPE cmdtype,
  2305. [in]
  2306. DWORD dwPopId);
  2307. }
  2308. // ---------------------------------------------------------------------------------------
  2309. // IID_INNTPCallback
  2310. // ---------------------------------------------------------------------------------------
  2311. [
  2312. uuid(0DF2C7E6-3435-11d0-81D0-00C04FD85AB4),
  2313. helpstring("NNTP Callback Interface"),
  2314. ]
  2315. interface INNTPCallback : ITransportCallback
  2316. {
  2317. // -----------------------------------------------------------------------------------
  2318. // NNTPSTATE - These are the various states the NNTP Transport can be in. These
  2319. // states are also used to determine which type of data is being returned
  2320. // in the client's OnResponse() callback.
  2321. // -----------------------------------------------------------------------------------
  2322. typedef enum tagNNTPSTATE {
  2323. NS_DISCONNECTED, // not connected
  2324. NS_CONNECT, // awaiting connect response
  2325. NS_AUTHINFO, // awaiting authorization
  2326. NS_POST, // awaiting CommandPOST() to complete
  2327. NS_IDLE, // connected (& authorized if necessary)
  2328. NS_LIST, // awaiting LIST data
  2329. NS_LISTGROUP, // awaiting LISTGROUP data
  2330. NS_NEWGROUPS, // awaiting NEWGROUPS data
  2331. NS_GROUP, // awaiting GROUP response
  2332. NS_LAST, // awaiting LAST response
  2333. NS_NEXT, // awaiting NEXT response
  2334. NS_STAT, // awaiting STAT response
  2335. NS_ARTICLE, // awaiting ARTICLE data
  2336. NS_HEAD, // awaiting HEAD data
  2337. NS_BODY, // awaiting BODY data
  2338. NS_DATE, // awaiting DATE response
  2339. NS_MODE, // awaiting MODE response
  2340. NS_QUIT, // awaiting QUIT response
  2341. NS_HEADERS, // awaiting XOVER or XHDR data from GetHeaders()
  2342. NS_XHDR // awaiting XHDR data
  2343. } NNTPSTATE;
  2344. // -----------------------------------------------------------------------------------
  2345. // NNTPGROUP - This is the response from the CommandGROUP() function. The data is
  2346. // the current status of the group that was switched to.
  2347. // -----------------------------------------------------------------------------------
  2348. typedef struct tagNNTPGROUP {
  2349. DWORD dwCount; // Estimated number of articles in the group
  2350. DWORD dwFirst; // First article number in the group
  2351. DWORD dwLast; // Last article number in the group
  2352. LPSTR pszGroup; // Name of the group
  2353. } NNTPGROUP, *LPNNTPGROUP;
  2354. // -----------------------------------------------------------------------------------
  2355. // NNTPNEXT - This structure will be used for the response from CommandNEXT(),
  2356. // CommandLAST(), and CommandSTAT(). The data returned is the article
  2357. // number and message id for the article that is selected by the command
  2358. // that was issued.
  2359. // -----------------------------------------------------------------------------------
  2360. typedef struct tagNNTPNEXT {
  2361. DWORD dwArticleNum; // Article number
  2362. LPSTR pszMessageId; // Message ID
  2363. } NNTPNEXT, *LPNNTPNEXT;
  2364. // -----------------------------------------------------------------------------------
  2365. // NNTPARTICLE - This structure returns the data from a CommandARTICLE() function.
  2366. // Depending on the size of the article being retrieved, the callback
  2367. // may recieve multiple calls for a single article. When fDone is TRUE
  2368. // then all of the article data has been retrieved. pszLines is not
  2369. // accumulated over all of the callbacks, it is the client's
  2370. // responsibility to assemble all of the pszLines that are returned to
  2371. // build the message.
  2372. // -----------------------------------------------------------------------------------
  2373. typedef struct tagNNTPARTICLE {
  2374. DWORD dwArticleNum; // Article number
  2375. LPSTR pszMessageId; // Message ID
  2376. LPSTR pszLines; // Lines of the message
  2377. ULONG cbLines; // Number of bytes in pszLines
  2378. ULONG cLines; // Number of lines in pszLines
  2379. DWORD dwReserved; // Reserved for system use
  2380. } NNTPARTICLE, *LPNNTPARTICLE;
  2381. // -----------------------------------------------------------------------------------
  2382. // NNTPLIST - This structure is the data returned from the CommandLIST() function.
  2383. // Since the NNTP LIST command can have multiple extensions, the data
  2384. // returned is relatively unparsed to provide greater flexibility to the
  2385. // client. The data is returned in array of NULL terminated strings that
  2386. // contain the lines returned from the server. When fDone is TRUE, then
  2387. // all of the data has been retrieved. rgszLines is not accumulated by
  2388. // the transport between calls to OnResponse(). It is the client's
  2389. // responsibility to store this information as it comes in.
  2390. // -----------------------------------------------------------------------------------
  2391. typedef struct tagNNTPLIST {
  2392. DWORD cLines; // Number of lines returned
  2393. LPSTR *rgszLines; // Array of lines returned by the LIST command. The
  2394. // number of lines in rgszLines is cLines. The recipient
  2395. // must call INNTPCallback::FreeListResponse() to free
  2396. // this structure.
  2397. } NNTPLIST, *LPNNTPLIST;
  2398. // -----------------------------------------------------------------------------------
  2399. // NNTPLISTGROUP - This structure is sent in response to a CommandLISTGROUP() call.
  2400. // rgArticles is an array of article numbers that are contained in
  2401. // the newsgroup. Since there can be quite a few articles,
  2402. // OnResponse() may be called multiple times with the data as it
  2403. // arrives. rgArticles is not accumulated between calls to
  2404. // OnResponse() so it is up to the client to store this information
  2405. // as it arrives. fDone will be TRUE when all the information has
  2406. // been returned.
  2407. // -----------------------------------------------------------------------------------
  2408. typedef struct tagNNTPLISTGROUP {
  2409. DWORD cArticles; // Number of article numbers in rgArticles
  2410. DWORD *rgArticles; // Array of article numbers available in the group
  2411. } NNTPLISTGROUP, *LPNNTPLISTGROUP;
  2412. // -----------------------------------------------------------------------------------
  2413. // NNTPHEADER - This structure contains the parsed information for a single header
  2414. // returned from the GetHeaders() command. An array of these headers
  2415. // is contained in the NNTPHEADERRESP struct.
  2416. // -----------------------------------------------------------------------------------
  2417. typedef struct tagNNTPHEADER {
  2418. DWORD dwArticleNum; // Article number
  2419. LPSTR pszSubject; // Article subject
  2420. LPSTR pszFrom; // Who the article is from
  2421. LPSTR pszDate; // Date the article was posted
  2422. LPSTR pszMessageId; // Message id
  2423. LPSTR pszReferences; // References
  2424. DWORD dwBytes; // Size of the message in bytes (might not be filled in)
  2425. DWORD dwLines; // Size of the message in lines
  2426. LPSTR pszXref; // XREF: header for cross post managment
  2427. } NNTPHEADER, *LPNNTPHEADER;
  2428. // -----------------------------------------------------------------------------------
  2429. // NNTPHEADERRESP - This structure will be returned in response to the GetHeaders()
  2430. // command. Since the number of headers requested may be large,
  2431. // OnResponse() may be called multiple times in response to this
  2432. // command. rgHeaders is not accumulated by the transport between
  2433. // calls to OnResponse() therefore it is the responsibility of the
  2434. // caller to store this information as it is retrieved. When all
  2435. // the data is retrieved, then fDone will be set to TRUE. Since
  2436. // not all servers provide the XREF: header in their XOVER records,
  2437. // fSupportsXRef will be set to TRUE if the pszXref field in
  2438. // NNTPHEADER is valid. If this is FALSE, the client can retrieve
  2439. // this header with a call to CommandXHDR().
  2440. // -----------------------------------------------------------------------------------
  2441. typedef struct tagNNTPHEADERRESP {
  2442. DWORD cHeaders; // Number of headers in rgHeaders
  2443. LPNNTPHEADER rgHeaders; // Array of header structures
  2444. BOOL fSupportsXRef; // TRUE if the headers have a valid pszXref value.
  2445. // Otherwise, the client needs to issue an XHdr to
  2446. // retrieve that value if they're interested.
  2447. DWORD_PTR dwReserved; // Reserved for system use
  2448. } NNTPHEADERRESP, *LPNNTPHEADERRESP;
  2449. // -----------------------------------------------------------------------------------
  2450. // NNTPXHDR - An array of these structures will be returned in the NNTPXHDRRESP
  2451. // structure.
  2452. // -----------------------------------------------------------------------------------
  2453. typedef struct tagNNTPXHDR {
  2454. DWORD dwArticleNum; // Article number this header is for
  2455. LPSTR pszHeader; // Requested article header for this article
  2456. } NNTPXHDR, *LPNNTPXHDR;
  2457. // -----------------------------------------------------------------------------------
  2458. // NNTPXHDRRESP - This will be returned in response to a CommandXHDR() call. Since
  2459. // the number of headers returned is potentially large, OnResponse()
  2460. // may be called multiple times in response to this command. rgHeaders
  2461. // is not accumulated between calls to OnResponse(), therefore it is
  2462. // up to the client to store this data as it arrives. fDone will be
  2463. // set to TRUE when all of the headers have been returned.
  2464. // -----------------------------------------------------------------------------------
  2465. typedef struct tagNNTPXHDRRESP {
  2466. DWORD cHeaders; // Number of header values in rgHeaders
  2467. LPNNTPXHDR rgHeaders; // Array of NNTPXHDR structs containing the requested headers
  2468. DWORD_PTR dwReserved; // Reserved for system use
  2469. } NNTPXHDRRESP, *LPNNTPXHDRRESP;
  2470. // -----------------------------------------------------------------------------------
  2471. // NNTPRESPONSE - This structure is the general holder for all of the data returned
  2472. // from the INNTPTransport commands. The state member tells the
  2473. // receiver which command this data is in response to. If fMustRelease
  2474. // is TRUE, then when the client is done with this data, it should
  2475. // call INNTPTransport::ReleaseResponse() to free that memory. See
  2476. // the explanation of the various structures to see the details on
  2477. // each type of response.
  2478. // -----------------------------------------------------------------------------------
  2479. typedef struct tagNNTPRESPONSE {
  2480. NNTPSTATE state; // Command in which the response was generated for
  2481. BOOL fMustRelease; // TRUE if the data contained within this struct must be
  2482. // freed with a call to INNTPTransport::ReleaseResponse()
  2483. BOOL fDone; // TRUE when there is no more data that will arrive for this
  2484. // command
  2485. IXPRESULT rIxpResult; // Result Information
  2486. INNTPTransport *pTransport; // Pointer to the NNTP transport that generated the response
  2487. // This is a union of response information based on the command
  2488. [switch_type(NNTPSTATE), switch_is((NNTPSTATE) state)]
  2489. union {
  2490. [case(NS_GROUP)] NNTPGROUP rGroup;
  2491. [case(NS_LAST)] NNTPNEXT rLast;
  2492. [case(NS_NEXT)] NNTPNEXT rNext;
  2493. [case(NS_STAT)] NNTPNEXT rStat;
  2494. [case(NS_ARTICLE)] NNTPARTICLE rArticle;
  2495. [case(NS_HEAD)] NNTPARTICLE rHead;
  2496. [case(NS_BODY)] NNTPARTICLE rBody;
  2497. [case(NS_LIST)] NNTPLIST rList;
  2498. [case(NS_LISTGROUP)] NNTPLISTGROUP rListGroup;
  2499. [case(NS_NEWGROUPS)] NNTPLIST rNewgroups;
  2500. [case(NS_DATE)] SYSTEMTIME rDate;
  2501. [case(NS_HEADERS)] NNTPHEADERRESP rHeaders;
  2502. [case(NS_XHDR)] NNTPXHDRRESP rXhdr;
  2503. [default];
  2504. };
  2505. } NNTPRESPONSE, *LPNNTPRESPONSE;
  2506. // -----------------------------------------------------------------------------------
  2507. // OnResponse
  2508. // -----------------------------------------------------------------------------------
  2509. HRESULT OnResponse(
  2510. [in]
  2511. LPNNTPRESPONSE pResponse);
  2512. }
  2513. // ---------------------------------------------------------------------------------------
  2514. // IID_INNTPTransport
  2515. // ---------------------------------------------------------------------------------------
  2516. [
  2517. uuid(0DF2C7E5-3435-11d0-81D0-00C04FD85AB4),
  2518. helpstring("NNTP Internet Transport Interface"),
  2519. ]
  2520. interface INNTPTransport : IInternetTransport
  2521. {
  2522. // -----------------------------------------------------------------------------------
  2523. // AUTHTYPE
  2524. // -----------------------------------------------------------------------------------
  2525. typedef enum tagAUTHTYPE {
  2526. AUTHTYPE_USERPASS,
  2527. AUTHTYPE_SIMPLE,
  2528. AUTHTYPE_SASL
  2529. } AUTHTYPE;
  2530. // -----------------------------------------------------------------------------------
  2531. // AUTHINFO - This structure is used to specify the type of authentication to use
  2532. // in the CommandAUTHINFO() command. For AUTHTYPE_USERPASS and
  2533. // AUTHTYPE_SIMPLE, pszUser and pszPass are the user name and password
  2534. // to send with the command.
  2535. // -----------------------------------------------------------------------------------
  2536. typedef struct tagNNTPAUTHINFO {
  2537. AUTHTYPE authtype;
  2538. LPSTR pszUser;
  2539. LPSTR pszPass;
  2540. } NNTPAUTHINFO, *LPNNTPAUTHINFO;
  2541. // -----------------------------------------------------------------------------------
  2542. // ARTICLEIDTYPE
  2543. // -----------------------------------------------------------------------------------
  2544. typedef enum tagARTICLEIDTYPE {
  2545. AID_MSGID,
  2546. AID_ARTICLENUM
  2547. } ARTICLEIDTYPE;
  2548. // -----------------------------------------------------------------------------------
  2549. // ARTICLEID
  2550. //
  2551. // This structure is used to specify an article id to the various NNTP commands that
  2552. // require one (i.e. ARTICLE, BODY, STAT). These commands accept either a message-id
  2553. // or if the user is current in a the context of a newsgroup the article number within
  2554. // that group. When filling in this structure the user should set idType to either
  2555. // AID_MSGID of pszMessageId is valid, or AID_ARTICLENUM if dwArticleNum.
  2556. // -----------------------------------------------------------------------------------
  2557. typedef struct ARTICLEID {
  2558. ARTICLEIDTYPE idType;
  2559. [switch_type(ARTICLEIDTYPE), switch_is((ARTICLEIDTYPE)idType)]
  2560. union {
  2561. [case(AID_MSGID)]
  2562. LPSTR pszMessageId;
  2563. [case(AID_ARTICLENUM)]
  2564. DWORD_PTR dwArticleNum;
  2565. [default];
  2566. };
  2567. } ARTICLEID, *LPARTICLEID;
  2568. // -----------------------------------------------------------------------------------
  2569. // NNTPMESSAGE
  2570. //
  2571. // This structure provides the information needed to post a message to the news server
  2572. // using the POST command.
  2573. // -----------------------------------------------------------------------------------
  2574. typedef struct tagNNTPMESSAGE {
  2575. ULONG cbSize; // Size of the message in bytes
  2576. LPSTREAM pstmMsg; // Stream containing a ANSI MIME/rfc822/rfc1036 message stream
  2577. } NNTPMESSAGE, *LPNNTPMESSAGE;
  2578. // -----------------------------------------------------------------------------------
  2579. // RANGE
  2580. //
  2581. // The range structure allows the caller to provide arguments for commands that allow
  2582. // a range of headers to be retrieved. The range structure can be used to specify a
  2583. // single number (ie XOVER 2010), or bounded range (ie XOVER 2000-2010) to request all
  2584. // of the headers within that range [inclusive]. Use the idType field to specify
  2585. // which range you are requesting.
  2586. // -----------------------------------------------------------------------------------
  2587. typedef enum tagRANGETYPE {
  2588. RT_SINGLE, // num
  2589. RT_RANGE, // num-num
  2590. } RANGETYPE;
  2591. typedef struct tagRANGE {
  2592. RANGETYPE idType;
  2593. DWORD dwFirst;
  2594. DWORD dwLast;
  2595. } RANGE, *LPRANGE;
  2596. // -----------------------------------------------------------------------------------
  2597. // InitNew
  2598. //
  2599. // Description:
  2600. // This method Initializes the internet transport. This method be called before
  2601. // the transport can doing anything.
  2602. //
  2603. // Parameters:
  2604. // pszLogFilePath Full file path in which to log the protocol commands.
  2605. // NULL is a valid value (no logging)
  2606. // pCallback(required) Specifies the Transport callback interface.
  2607. //
  2608. // Returns:
  2609. // E_INVALIDARG An invalid parameter was passed in
  2610. // E_OUTOFMEMORY An memory allocation failed
  2611. //
  2612. // -----------------------------------------------------------------------------------
  2613. HRESULT InitNew(
  2614. [in]
  2615. LPSTR pszLogFilePath,
  2616. [in]
  2617. INNTPCallback *pCallback);
  2618. // -----------------------------------------------------------------------------------
  2619. // CommandAUTHINFO
  2620. //
  2621. // Description:
  2622. // The function issues an NNTPAUTHINFO command to the server along with the information
  2623. // provided in the pszAuth parameter. RFC 977 provides the following formats as
  2624. // valid AUTHINFO commands:
  2625. //
  2626. // AUTHINFO USER name|PASS password
  2627. // AUTHINFO SIMPLE
  2628. // user password
  2629. //
  2630. //
  2631. // Parameters:
  2632. // pAuthInfo
  2633. //
  2634. // Returns:
  2635. // E_INVALIDARG An invalid parameter was passed in
  2636. // E_OUTOFMEMORY An memory allocation failed
  2637. //
  2638. // -----------------------------------------------------------------------------------
  2639. HRESULT CommandAUTHINFO(
  2640. [in]
  2641. LPNNTPAUTHINFO pAuthInfo);
  2642. // -----------------------------------------------------------------------------------
  2643. // CommandGROUP
  2644. //
  2645. // Description:
  2646. // The function issues an GROUP command to the server. The server's response string
  2647. // will be returned to the INNTPCallback::OnResponse().
  2648. //
  2649. // Parameters:
  2650. // pszGroup Name of the newsgroup to enter.
  2651. //
  2652. // Returns:
  2653. // E_INVALIDARG pszGroup is not a valid string pointer
  2654. // E_OUTOFMEMORY An memory allocation failed
  2655. //
  2656. // -----------------------------------------------------------------------------------
  2657. HRESULT CommandGROUP(
  2658. [in]
  2659. LPSTR pszGroup);
  2660. // -----------------------------------------------------------------------------------
  2661. // CommandLAST
  2662. //
  2663. // Description:
  2664. // This function issues the LAST command to the server. This has the effect of
  2665. // moving the current article pointer to the article immediately preceeding the
  2666. // current article pointer in the newsgroup. This command is only valid if a GROUP
  2667. // command has been issued previously. The article number and message-id pointed to
  2668. // by the new current article pointer are returned in INNTPCallback::OnResponse().
  2669. //
  2670. // Returns:
  2671. // S_OK
  2672. // E_OUTOFMEMORY
  2673. // IXP_E_NOT_INIT
  2674. // IXP_E_NOT_CONNECTED
  2675. // IXP_E_BUSY
  2676. //
  2677. // -----------------------------------------------------------------------------------
  2678. HRESULT CommandLAST(void);
  2679. // -----------------------------------------------------------------------------------
  2680. // CommandNEXT
  2681. //
  2682. // Description:
  2683. // This function issues the NEXT command to the server. This has the effect of
  2684. // moving the current article pointer to the article immediately after the current
  2685. // article pointer in the newsgroup. This command is only valid if a GROUP command
  2686. // has been issued previously. The article number and message-id pointed to by the
  2687. // new current article pointer are returned in INNTPCallback::OnResponse().
  2688. //
  2689. // Returns:
  2690. // S_OK
  2691. // E_OUTOFMEMORY
  2692. // IXP_E_NOT_INIT
  2693. // IXP_E_NOT_CONNECTED
  2694. // IXP_E_BUSY
  2695. //
  2696. // -----------------------------------------------------------------------------------
  2697. HRESULT CommandNEXT(void);
  2698. // -----------------------------------------------------------------------------------
  2699. // CommandSTAT
  2700. //
  2701. // Description:
  2702. // The function issues a STAT command to the server. If an article is specified
  2703. // then this command has the effect of moving the current article pointer to the
  2704. // specified message and returns the article number and message-id of the new current
  2705. // article. Otherwise, the function will return the article number and message-id
  2706. // of the current article.
  2707. //
  2708. // Parameters:
  2709. // pArticleId (optional) Article number or message-id of the article to
  2710. // retrieve status for. If a message-id is specified
  2711. // the current article pointer will NOT be updated.
  2712. //
  2713. // Returns:
  2714. // E_INVALIDARG pArticleId is not valid
  2715. // E_OUTOFMEMORY An memory allocation failed
  2716. // IXP_E_NOT_INIT
  2717. // IXP_E_NOT_CONNECTED
  2718. // IXP_E_BUSY
  2719. //
  2720. // -----------------------------------------------------------------------------------
  2721. HRESULT CommandSTAT(
  2722. [in]
  2723. LPARTICLEID pArticleId);
  2724. // -----------------------------------------------------------------------------------
  2725. // CommandARTICLE
  2726. //
  2727. // Description:
  2728. // This function is used to request an article from the server. If the caller has
  2729. // previously issued a GROUP command then the article can be specified by either
  2730. // article number or message-id. If the GROUP command has not been issued, then the
  2731. // article can only be requested by message-id.
  2732. //
  2733. // Parameters:
  2734. // pArticleId Either the article number or message-id of the article
  2735. // to retrieve.
  2736. //
  2737. // Returns:
  2738. // E_INVALIDARG An invalid parameter was passed in
  2739. // E_OUTOFMEMORY An memory allocation failed
  2740. //
  2741. // -----------------------------------------------------------------------------------
  2742. HRESULT CommandARTICLE(
  2743. [in]
  2744. LPARTICLEID pArticleId);
  2745. // -----------------------------------------------------------------------------------
  2746. // CommandHEAD
  2747. //
  2748. // Description:
  2749. // This function retrieves just the header for the requested article. If the caller
  2750. // has previously issued a GROUP command, then the article can be specified by either
  2751. // article number or message-id. Otherwise, the article must be requested by
  2752. // message-id. The provided stream will be filled and returned to the caller in
  2753. // INNTPCallback::OnResponse().
  2754. //
  2755. // Parameters:
  2756. // pArticleId Structure specifying the article to retreive the
  2757. // header for.
  2758. //
  2759. // Returns:
  2760. // E_INVALIDARG An invalid parameter was passed in
  2761. // E_OUTOFMEMORY An memory allocation failed
  2762. //
  2763. // -----------------------------------------------------------------------------------
  2764. HRESULT CommandHEAD(
  2765. [in]
  2766. LPARTICLEID pArticleId);
  2767. // -----------------------------------------------------------------------------------
  2768. // CommandBODY
  2769. //
  2770. // Description:
  2771. // This function retrieves just the body for the requested article. If the caller
  2772. // has previously issued a GROUP command, then the article can be specified by either
  2773. // article number or message-id. Otherwise, the article must be requested by
  2774. // message-id. The provided stream will be filled and returned to the caller in
  2775. // INNTPCallback::OnResponse().
  2776. //
  2777. // Parameters:
  2778. // pArticleId Structure specifying the article to retreive the
  2779. // body for.
  2780. //
  2781. // Returns:
  2782. // E_INVALIDARG An invalid parameter was passed in
  2783. // E_OUTOFMEMORY An memory allocation failed
  2784. //
  2785. // -----------------------------------------------------------------------------------
  2786. HRESULT CommandBODY(
  2787. [in]
  2788. LPARTICLEID pArticleId);
  2789. // -----------------------------------------------------------------------------------
  2790. // CommandPOST
  2791. //
  2792. // Description:
  2793. // Posts the specified message to the server.
  2794. //
  2795. // Parameters:
  2796. // pMessage Specifies a stream that contains a valid RFC1036
  2797. // message.
  2798. //
  2799. // Returns:
  2800. // E_INVALIDARG An invalid parameter was passed in
  2801. // E_OUTOFMEMORY An memory allocation failed
  2802. //
  2803. // -----------------------------------------------------------------------------------
  2804. HRESULT CommandPOST(
  2805. [in]
  2806. LPNNTPMESSAGE pMessage);
  2807. // -----------------------------------------------------------------------------------
  2808. // CommandLIST
  2809. //
  2810. // Description:
  2811. // Sends a LIST command to the news server. If pszArgs is NULL, then the command will
  2812. // retrieve a list of newsgroups available on the news server. The pszArgs parameter
  2813. // can be used to issue one of the various extensions to the LIST command, ie.
  2814. // LIST NEWSGROUPS, LIST ACTIVE, LIST OVERVIEW.FMT, or LIST SUBSCRIPTIONS. See
  2815. // RFC 977 at http://ds.internic.net/rfc/rfc977.txt for a full list of extensions.
  2816. //
  2817. // Parameters:
  2818. // pszArgs Any optional parameters that the user wants to
  2819. // send with the LIST command. See the "Description"
  2820. // above for more details.
  2821. //
  2822. // Returns:
  2823. // E_INVALIDARG An invalid parameter was passed in
  2824. // E_OUTOFMEMORY An memory allocation failed
  2825. //
  2826. // -----------------------------------------------------------------------------------
  2827. HRESULT CommandLIST(
  2828. [in]
  2829. LPSTR pszArgs);
  2830. // -----------------------------------------------------------------------------------
  2831. // CommandLISTGROUP
  2832. //
  2833. // Description:
  2834. // Retrieves a list of all the article numbers in a particular news group. If the
  2835. // caller specifies a newsgroup name, then the articles are listed for the specified
  2836. // newsgroup. Otherwise, the currently selected newsgroup is listed. NOTE - this
  2837. // command will reset the current article pointer is reset to the first article in
  2838. // the newsgroup that was specified.
  2839. //
  2840. // Parameters:
  2841. // pszGroup Optional newsgroup name to list articles for.
  2842. //
  2843. // Returns:
  2844. // E_INVALIDARG An invalid parameter was passed in
  2845. // E_OUTOFMEMORY An memory allocation failed
  2846. //
  2847. // -----------------------------------------------------------------------------------
  2848. HRESULT CommandLISTGROUP(
  2849. [in]
  2850. LPSTR pszGroup);
  2851. // -----------------------------------------------------------------------------------
  2852. // CommandNEWGROUPS
  2853. //
  2854. // Description:
  2855. // Retrieves the list of newsgroups which have been added to the server since the
  2856. // date specified in stLast. The caller can restrict the list by specifying a list
  2857. // of distributions in pszDist. For example:
  2858. //
  2859. // CommandNEWGROUPS(&stLast, "alt.tv")
  2860. //
  2861. // will return the list of newsgroups that begin with "alt.tv" that have been added
  2862. // to the server since the time in stLast.
  2863. //
  2864. // Parameters:
  2865. // pstLast The time to specify as the last time groups were checked.
  2866. // pszDist Distributions to check. This can be a single dist
  2867. // such as "alt" or a list of dists such as "alt.tv,comp".
  2868. // The list of distributions must be separated by commas.
  2869. //
  2870. // Returns:
  2871. // E_INVALIDARG An invalid parameter was passed in
  2872. // E_OUTOFMEMORY An memory allocation failed
  2873. //
  2874. // -----------------------------------------------------------------------------------
  2875. HRESULT CommandNEWGROUPS(
  2876. [in]
  2877. SYSTEMTIME *pstLast,
  2878. [in]
  2879. LPSTR pszDist);
  2880. // -----------------------------------------------------------------------------------
  2881. // CommandDATE
  2882. //
  2883. // Description:
  2884. // Retrieves the date and time from the news server.
  2885. //
  2886. // Returns:
  2887. // E_INVALIDARG An invalid parameter was passed in
  2888. // E_OUTOFMEMORY An memory allocation failed
  2889. //
  2890. // -----------------------------------------------------------------------------------
  2891. HRESULT CommandDATE(void);
  2892. // -----------------------------------------------------------------------------------
  2893. // CommandMODE
  2894. //
  2895. // Description:
  2896. // Issues a MODE command to the server. pszMode is a required argument, an example
  2897. // of which are "MODE READER" to tell the server that the connection is for a user
  2898. // instead of another server. Refer to RFC977 for more details.
  2899. //
  2900. // Parameters:
  2901. // pszMode Required argument to the MODE command.
  2902. //
  2903. // Returns:
  2904. // E_INVALIDARG An invalid parameter was passed in
  2905. // E_OUTOFMEMORY An memory allocation failed
  2906. //
  2907. // -----------------------------------------------------------------------------------
  2908. HRESULT CommandMODE(
  2909. [in]
  2910. LPSTR pszMode);
  2911. // -----------------------------------------------------------------------------------
  2912. // CommandXHDR
  2913. //
  2914. // Description:
  2915. // Issues an XHDR command to the server. This command can specify a range of
  2916. // messages or a single message to retrieve the header from. If pRange is NULL and
  2917. // pszMessageId is NULL the the header is retrieved from the message pointed to by
  2918. // the server's current message pointer (see STAT, NEXT, LAST).
  2919. //
  2920. // Parameters:
  2921. // pszHeader Which header to retrieve. IE "subject" or "xref"
  2922. // pRange (optional) Range of messages to retrieve the header from
  2923. // pszMessageId (optional) Message ID of the mesage to retrieve the header from
  2924. //
  2925. // Returns:
  2926. //
  2927. // -----------------------------------------------------------------------------------
  2928. HRESULT CommandXHDR(
  2929. [in]
  2930. LPSTR pszHeader,
  2931. [in]
  2932. LPRANGE pRange,
  2933. [in]
  2934. LPSTR pszMessageId);
  2935. // -----------------------------------------------------------------------------------
  2936. // CommandQUIT()
  2937. //
  2938. // Description:
  2939. // Issues a QUIT command to the server and terminates the connect.
  2940. //
  2941. // Returns:
  2942. // E_OUTOFMEMORY An memory allocation failed
  2943. //
  2944. // -----------------------------------------------------------------------------------
  2945. HRESULT CommandQUIT(void);
  2946. // -----------------------------------------------------------------------------------
  2947. // GetHeaders
  2948. //
  2949. // Description:
  2950. // Retrieves an array of headers from the server. If a GROUP command has not been
  2951. // previously sent this command is not valid.
  2952. //
  2953. // This function will first try to retrieve the specifed range of headers using
  2954. // the XOVER command. If the server doesn't support XOVER, then the function will
  2955. // try other methods such as a series of XHDR commands.
  2956. //
  2957. // Parameters:
  2958. // pRange The range of headers to request. See the
  2959. // documentation for the RANGE structure above to see
  2960. // how to specify a range.
  2961. //
  2962. // Returns:
  2963. // E_INVALIDARG An invalid parameter was passed in
  2964. // E_OUTOFMEMORY An memory allocation failed
  2965. //
  2966. // -----------------------------------------------------------------------------------
  2967. HRESULT GetHeaders(
  2968. [in]
  2969. LPRANGE pRange);
  2970. // -----------------------------------------------------------------------------------
  2971. // ReleaseResponse()
  2972. //
  2973. // Description:
  2974. // This function is used to free data returned to the client's OnResponse() callback.
  2975. //
  2976. // Parameters:
  2977. // pResponse A pointer to the NNTPRESPONSE structure passed to the
  2978. // OnResponse() callback.
  2979. //
  2980. // Returns:
  2981. // E_INVALIDARG An invalid parameter was passed in
  2982. //
  2983. // -----------------------------------------------------------------------------------
  2984. HRESULT ReleaseResponse(
  2985. [in]
  2986. LPNNTPRESPONSE pResponse);
  2987. }
  2988. // ---------------------------------------------------------------------------------------
  2989. // IID_INNTPTransport2
  2990. // ---------------------------------------------------------------------------------------
  2991. [
  2992. uuid(0DF2C7ED-3435-11d0-81D0-00C04FD85AB4),
  2993. helpstring("NNTP Transport 2 Interface"),
  2994. ]
  2995. interface INNTPTransport2 : INNTPTransport
  2996. {
  2997. //***************************************************************************
  2998. // Function: SetWindow
  2999. //
  3000. // Purpose:
  3001. // This function creates a new window for async winsock processing
  3002. //
  3003. // Returns:
  3004. // HRESULT indicating success or failure.
  3005. //***************************************************************************
  3006. HRESULT SetWindow(void);
  3007. //***************************************************************************
  3008. // Function: ResetWindow
  3009. //
  3010. // Purpose:
  3011. // This function closes a window for async winsock processing
  3012. //
  3013. // Returns:
  3014. // HRESULT indicating success or failure.
  3015. //***************************************************************************
  3016. HRESULT ResetWindow(void);
  3017. }
  3018. // ---------------------------------------------------------------------------------------
  3019. // IID_IRASCallback
  3020. // ---------------------------------------------------------------------------------------
  3021. [
  3022. uuid(36D88911-3CD6-11d0-81DF-00C04FD85AB4),
  3023. helpstring("RAS Callback Interface"),
  3024. ]
  3025. interface IRASCallback : IUnknown
  3026. {
  3027. // -----------------------------------------------------------------------------------
  3028. // OnReconnect
  3029. // -----------------------------------------------------------------------------------
  3030. HRESULT OnReconnect(
  3031. [in]
  3032. LPSTR pszCurrentConnectoid,
  3033. [in]
  3034. LPSTR pszNewConnectoid,
  3035. [in]
  3036. IRASTransport *pTransport);
  3037. // -----------------------------------------------------------------------------------
  3038. // OnLogonPrompt
  3039. // -----------------------------------------------------------------------------------
  3040. typedef struct tagIXPRASLOGON {
  3041. CHAR szConnectoid[CCHMAX_CONNECTOID];
  3042. CHAR szUserName[CCHMAX_USERNAME];
  3043. CHAR szPassword[CCHMAX_PASSWORD];
  3044. CHAR szDomain[CCHMAX_DOMAIN];
  3045. CHAR szPhoneNumber[CCHMAX_PHONE_NUMBER];
  3046. BOOL fSavePassword;
  3047. } IXPRASLOGON, *LPIXPRASLOGON;
  3048. HRESULT OnLogonPrompt(
  3049. [in,out]
  3050. LPIXPRASLOGON pRasLogon,
  3051. [in]
  3052. IRASTransport *pTransport);
  3053. // -----------------------------------------------------------------------------------
  3054. // OnRasDialStatus
  3055. // -----------------------------------------------------------------------------------
  3056. cpp_quote("#ifndef RASCONNSTATE")
  3057. typedef DWORD RASCONNSTATE;
  3058. cpp_quote("#endif")
  3059. HRESULT OnRasDialStatus(
  3060. [in]
  3061. RASCONNSTATE rasconnstate,
  3062. [in]
  3063. DWORD dwError,
  3064. [in]
  3065. IRASTransport *pTransport);
  3066. // -----------------------------------------------------------------------------------
  3067. // OnDisconnect
  3068. //
  3069. // Description:
  3070. // This method allows the client to decide if the current RAS connection should
  3071. // be hungup. This is useful, especially on application shutdown, in which case
  3072. // the user may want to leave their RAS connection established even after the
  3073. // application using the connection goes away. This client could show UI on this
  3074. // callback to prompt the user.
  3075. //
  3076. // Parameters:
  3077. // pTransport The RAS transport that generated the OnDisconnect call
  3078. //
  3079. // Returns:
  3080. // S_OK The client can return S_OK to "hangup" the current
  3081. // RAS connnection.
  3082. // S_FALSE The client can return S_FALSE to leave the connection
  3083. // established.
  3084. // -----------------------------------------------------------------------------------
  3085. HRESULT OnDisconnect(
  3086. [in]
  3087. LPSTR pszCurrentConnectoid,
  3088. [in]
  3089. boolean fConnectionOwner,
  3090. [in]
  3091. IRASTransport *pTransport);
  3092. }
  3093. // ---------------------------------------------------------------------------------------
  3094. // IID_IRASTransport
  3095. // ---------------------------------------------------------------------------------------
  3096. [
  3097. uuid(8A950001-3CCF-11d0-81DF-00C04FD85AB4),
  3098. helpstring("RAS Transport Interface"),
  3099. ]
  3100. interface IRASTransport : IInternetTransport
  3101. {
  3102. // -----------------------------------------------------------------------------------
  3103. // InitNew
  3104. // -----------------------------------------------------------------------------------
  3105. HRESULT InitNew(
  3106. [in]
  3107. IRASCallback *pCallback);
  3108. // -----------------------------------------------------------------------------------
  3109. // GetCurrentConnectoid - Returns Connectoid name of the current RAS Connection.
  3110. // If not connected, IXP_E_NOT_CONNECTED is returned. cchMax must be greater than or
  3111. // equal to CCHMAX_CONNECTOID, or E_INVALIDARG will be returned.
  3112. // -----------------------------------------------------------------------------------
  3113. HRESULT GetCurrentConnectoid(
  3114. [in,ref]
  3115. LPSTR pszConnectoid,
  3116. [in]
  3117. ULONG cchMax);
  3118. // ----------------------------------------------------------
  3119. // GetRasErrorString
  3120. // ----------------------------------------------------------
  3121. HRESULT GetRasErrorString (
  3122. [in]
  3123. UINT uRasErrorValue,
  3124. [in,ref]
  3125. LPSTR pszErrorString,
  3126. [in]
  3127. ULONG cchMax,
  3128. [out]
  3129. DWORD *pdwRASResult);
  3130. // ----------------------------------------------------------
  3131. // FillConnectoidCombo
  3132. // ----------------------------------------------------------
  3133. HRESULT FillConnectoidCombo(
  3134. [in]
  3135. HWND hwndComboBox,
  3136. [in]
  3137. boolean fUpdateOnly,
  3138. [out]
  3139. DWORD *pdwRASResult);
  3140. // ----------------------------------------------------------
  3141. // EditConnectoid
  3142. // ----------------------------------------------------------
  3143. HRESULT EditConnectoid(
  3144. [in]
  3145. HWND hwndParent,
  3146. [in]
  3147. LPSTR pszConnectoid,
  3148. [out]
  3149. DWORD *pdwRASResult);
  3150. // ----------------------------------------------------------
  3151. // CreateConnectoid
  3152. // ----------------------------------------------------------
  3153. HRESULT CreateConnectoid(
  3154. [in]
  3155. HWND hwndParent,
  3156. [out]
  3157. DWORD *pdwRASResult);
  3158. }
  3159. // ***************************************************************************************
  3160. // ---------------------------------------------------------------------------------------
  3161. // IID_IRangeList
  3162. // ---------------------------------------------------------------------------------------
  3163. [
  3164. uuid(8C438160-4EF6-11d0-874F-00AA00530EE9),
  3165. helpstring("Rangelist Interface: used to represent a range of messages."),
  3166. ]
  3167. interface IRangeList : IUnknown
  3168. {
  3169. // ----------------------------------
  3170. // IID_IRangeList Interface Constants
  3171. // ----------------------------------
  3172. const ULONG RL_RANGE_ERROR = ((ULONG)-1); // [out] Indicates that no match could be found
  3173. const ULONG RL_LAST_MESSAGE = ((ULONG)-1); // [in] Equivalent to "*" in an IMAP range list
  3174. // ----------------------------------
  3175. // IID_IRangeList Interface Functions
  3176. // ----------------------------------
  3177. //***********************************************************************
  3178. // Function: Clear
  3179. // Purpose: Clears all entries in the rangelist. Note that no memory
  3180. // is freed by this operation.
  3181. // Returns: S_OK. This function cannot fail.
  3182. //***********************************************************************
  3183. HRESULT Clear(void);
  3184. //***********************************************************************
  3185. // Function: IsInRange
  3186. // Purpose: Determines whether the given value is in the rangelist.
  3187. // Arguments:
  3188. // [in] const ULONG value - the value to test against the rangelist.
  3189. //
  3190. // Returns: S_OK if given value is in the rangelist, else S_FALSE.
  3191. //***********************************************************************
  3192. HRESULT IsInRange([in] const ULONG value);
  3193. //***********************************************************************
  3194. // Function: Min
  3195. // Arguments:
  3196. // [out] ULONG *pulMin - the minimum value in the rangelist is returned
  3197. // here. For example, for the rangelist "10-20,31,44,50-65", this
  3198. // function returns 10. If the rangelist is empty, a value of
  3199. // RL_RANGE_ERROR is returned.
  3200. // Returns: S_OK. This function cannot fail.
  3201. //***********************************************************************
  3202. HRESULT Min([out] ULONG *pulMin);
  3203. //***********************************************************************
  3204. // Function: Max
  3205. // Arguments:
  3206. // [out] ULONG *pulMax - the maximum value in the rangelist is returned
  3207. // here. For example, for the rangelist "10-20,31,44,50-65", this
  3208. // function returns 65. If the rangelist is empty, a value of
  3209. // RL_RANGE_ERROR is returned.
  3210. // Returns: S_OK. This function cannot fail.
  3211. //***********************************************************************
  3212. HRESULT Max([out] ULONG *pulMax); // return the maximum in-range value
  3213. //***********************************************************************
  3214. // Function: Save
  3215. // Purpose: This function returns a copy of the internal rangelist
  3216. // representation which may be loaded later via the Load() function.
  3217. // NOTE THAT THE INTERNAL RANGELIST REPRESENTATION IS NOT SUITABLE FOR
  3218. // NETWORK TRANSMITTAL.
  3219. // Arguments:
  3220. // [out] byte **ppbDestination - if successful, this function returns
  3221. // a pointer to a copy of the internal rangelist representation
  3222. // suitable for use with the Load() command (but not for
  3223. // network transmittal).
  3224. // [out] ULONG *pulSizeOfDestination - if successful, this function
  3225. // returns the size of the data pointed to by *ppbDestination.
  3226. //
  3227. // Returns: HRESULT indicating success or failure. Failure to allocate
  3228. // memory is typically the reason for failure.
  3229. //***********************************************************************
  3230. HRESULT Save([out] byte **ppbDestination,
  3231. [out] ULONG *pulSizeOfDestination);
  3232. //***********************************************************************
  3233. // Function: Load
  3234. // Purpose: This function loads the given internal rangelist
  3235. // representation, obtained via the Save() function, thus restoring
  3236. // the rangelist which was saved.
  3237. // Arguments:
  3238. // [in] byte *pbSource - a pointer to the internal rangelist
  3239. // representation obtained using the Save() function.
  3240. // [in] ULONG ulSizeOfSource - the size of the data pointed to by
  3241. // pbSource.
  3242. //
  3243. // Returns: HRESULT indicating success or failure.
  3244. //***********************************************************************
  3245. HRESULT Load([in, size_is(ulSizeOfSource)] byte *pbSource,
  3246. [in] const ULONG ulSizeOfSource);
  3247. //***********************************************************************
  3248. // Function: AddRange
  3249. // Purpose: This function adds a range of values to the rangelist.
  3250. // For example, to add 19-99 to the rangelist, call AddRange(19,99).
  3251. // Arguments:
  3252. // [in] ULONG low - low number of the range to add to the rangelist.
  3253. // [in] ULONG high - high number of the range to add to the rangelist.
  3254. //
  3255. // Returns: HRESULT indicating success or failure.
  3256. //***********************************************************************
  3257. HRESULT AddRange([in] const ULONG low,
  3258. [in] const ULONG high);
  3259. //***********************************************************************
  3260. // Function: AddSingleValue
  3261. // Purpose: This function adds a single value to the rangelist.
  3262. // For example, to add 69 to the rangelist, call AddRange(69).
  3263. // Arguments:
  3264. // [in] ULONG value - the single value to add to the rangelist.
  3265. //
  3266. // Returns: HRESULT indicating success or failure.
  3267. //***********************************************************************
  3268. HRESULT AddSingleValue([in] const ULONG value);
  3269. //***********************************************************************
  3270. // Function: AddRangeList
  3271. // Purpose: This function adds a rangelist to the rangelist.
  3272. // Arguments:
  3273. // [in] IRangeList *prl - the rangelist to add to the rangelist.
  3274. //
  3275. // Returns: HRESULT indicating success or failure.
  3276. //***********************************************************************
  3277. HRESULT AddRangeList([in] const IRangeList *prl);
  3278. //***********************************************************************
  3279. // Function: DeleteRange
  3280. // Purpose: This function deletes a range of values from the rangelist.
  3281. // For example, to remove 7-11 from the rangelist, call DeleteRange(7,11).
  3282. // Arguments:
  3283. // [in] ULONG low - low number of the range to remove from the rangelist.
  3284. // [in] ULONG high - high number of the range to remove from the rangelist.
  3285. //
  3286. // Returns: HRESULT indicating success or failure.
  3287. //***********************************************************************
  3288. HRESULT DeleteRange([in] const ULONG low,
  3289. [in] const ULONG high);
  3290. //***********************************************************************
  3291. // Function: DeleteSingleValue
  3292. // Purpose: This function removes a single value from the rangelist.
  3293. // For example, to remove 42 to the rangelist, call DeleteRange(42).
  3294. // Arguments:
  3295. // [in] ULONG value - the single value to remove from the rangelist.
  3296. //
  3297. // Returns: HRESULT indicating success or failure.
  3298. //***********************************************************************
  3299. HRESULT DeleteSingleValue([in] const ULONG value);
  3300. //***********************************************************************
  3301. // Function: DeleteRangeList
  3302. // Purpose: This function removes a rangelist from the rangelist.
  3303. // Arguments:
  3304. // [in] IRangeList *prl - the rangelist to remove from the rangelist.
  3305. //
  3306. // Returns: HRESULT indicating success or failure.
  3307. //***********************************************************************
  3308. HRESULT DeleteRangeList([in] const IRangeList *prl);
  3309. //***********************************************************************
  3310. // Function: MinOfRange
  3311. // Purpose: This function finds the range that the given value belongs
  3312. // to, and returns the minimum of that range. For example, for the
  3313. // rangelist "10-20,30,40-50", MinOfRange(45) returns 40.
  3314. // Arguments:
  3315. // [in] ULONG value - a value in the range for which you would like to
  3316. // find the minimum.
  3317. // [out] ULONG *pulMinOfRange - the minimum value in the range of which
  3318. // "value" is a member is returned here. If "value" is not in
  3319. // the rangelist, a value of RL_RANGE_ERROR is returned.
  3320. // Returns: S_OK. This function cannot fail.
  3321. //***********************************************************************
  3322. HRESULT MinOfRange([in] const ULONG value,
  3323. [out] ULONG *pulMinOfRange);
  3324. //***********************************************************************
  3325. // Function: MaxOfRange
  3326. // Purpose: This function finds the range that the given value belongs
  3327. // to, and returns the maximum of that range. For example, for the
  3328. // rangelist "10-20,30,40-50", MaxOfRange(15) returns 20.
  3329. // Arguments:
  3330. // [in] ULONG value - a value in the range for which you would like to
  3331. // find the maximum.
  3332. // [out] ULONG *pulMaxOfRange - the maximum value in the range of which
  3333. // "value" is a member is returned here. If "value" is not in the
  3334. // rangelist, a value of RL_RANGE_ERROR is returned.
  3335. // Returns: S_OK. This function cannot fail.
  3336. //***********************************************************************
  3337. HRESULT MaxOfRange([in] const ULONG value,
  3338. [out] ULONG *pulMaxOfRange);
  3339. //***********************************************************************
  3340. // Function: RangeToIMAPString
  3341. // Purpose: This function outputs the rangelist as an IMAP message set,
  3342. // as specified by the "set" terminal in RFC 1730/2060 (IMAP).
  3343. // Arguments:
  3344. // [out] LPSTR *ppszDestination - an IMAP message set string is
  3345. // returned here. It is the responsibility of the caller to CoTaskMemFree
  3346. // this buffer when he is done with it. Pass in NULL if not interested.
  3347. // [out] LPDWORD pdwLengthOfDestination - the length of the IMAP
  3348. // message set string returned by this function (does not include
  3349. // null-terminator). Pass in NULL if not interested.
  3350. // Returns: HRESULT indicating success or failure.
  3351. //***********************************************************************
  3352. HRESULT RangeToIMAPString([out] LPSTR *ppszDestination,
  3353. [out] LPDWORD pdwLengthOfDestination);
  3354. //***********************************************************************
  3355. // Function: Next
  3356. // Purpose: This function returns the smallest value in the rangelist
  3357. // which is greater than the given value. For instance, for a rangelist
  3358. // 5-10, the call Next(7) would return 8.
  3359. // Arguments:
  3360. // [in] ULONG current - the value for which you'd like to find the next
  3361. // number in the rangelist.
  3362. // [out] ULONG *pulNext - the smallest number in the rangelist greater
  3363. // than "value" is returned here, or RL_RANGE_ERROR if no such
  3364. // number could be found.
  3365. // Returns: S_OK. This function cannot fail.
  3366. //***********************************************************************
  3367. HRESULT Next([in] const ULONG current, [out] ULONG *pulNext);
  3368. //***********************************************************************
  3369. // Function: Prev
  3370. // Purpose: This function returns the largest value in the rangelist
  3371. // which is smaller than the given value. For instance, for a rangelist
  3372. // 5-10, the call Prev(7) would return 6.
  3373. // Arguments:
  3374. // [in] ULONG current - the value for which you'd like to find the
  3375. // previous number in the rangelist.
  3376. // [out] ULONG *pulPrev - the largest number in the rangelist smaller
  3377. // than "value" is returned here, or RL_RANGE_ERROR if no such
  3378. // number could be found.
  3379. // Returns: S_OK. This function cannot fail.
  3380. //***********************************************************************
  3381. HRESULT Prev([in] const ULONG current, [out] ULONG *pulPrev);
  3382. //***********************************************************************
  3383. // Function: Cardinality
  3384. // Purpose: This function counts the members in the rangelist set. For
  3385. // example, for the rangelist 1-11, Cardinality() returns 11.
  3386. // Arguments:
  3387. // [out] ULONG *pulCardinality - The number of members in the
  3388. // rangelist set is returned here.
  3389. // Returns: S_OK. This function cannot fail.
  3390. //***********************************************************************
  3391. HRESULT Cardinality(ULONG *pulCardinality);
  3392. //***********************************************************************
  3393. // Function: CardinalityFrom
  3394. // Purpose: This function counts the members in the rangelist set which
  3395. // are larger than the given starting point. For example, for the
  3396. // rangelist 1-11, Cardinality(10) returns 2.
  3397. // Arguments:
  3398. // [in] ULONG ulStartPoint - represents 1 less than the lowest number
  3399. // which should be considered in the cardinality count.
  3400. // [out] ULONG *pulCardinalityFrom - The number of members in the
  3401. // rangelist set which are larger than the given starting point
  3402. // is returned here.
  3403. // Returns: S_OK. This function cannot fail.
  3404. //***********************************************************************
  3405. HRESULT CardinalityFrom([in] const ULONG ulStartPoint,
  3406. [out] ULONG *pulCardinalityFrom);
  3407. } // interface IRangeList
  3408. // ***************************************************************************************
  3409. // ---------------------------------------------------------------------------------------
  3410. // IID_IIMAPCallback
  3411. // ---------------------------------------------------------------------------------------
  3412. [
  3413. uuid(E9E9D8A3-4EDD-11d0-874F-00AA00530EE9),
  3414. helpstring("IMAP Callback Interface: used to notify an IID_IIMAPTransport client of IMAP server events."),
  3415. ]
  3416. interface IIMAPCallback : ITransportCallback
  3417. {
  3418. // -------------------------------------
  3419. // IID_IIMAPCallback Interface Constants
  3420. // -------------------------------------
  3421. typedef DWORD IMAP_MBOXFLAGS; // Mailbox flags returned by the LIST/LSUB command
  3422. const IMAP_MBOXFLAGS IMAP_MBOX_NOFLAGS = 0x00000000;
  3423. const IMAP_MBOXFLAGS IMAP_MBOX_MARKED = 0x00000001;
  3424. const IMAP_MBOXFLAGS IMAP_MBOX_NOINFERIORS = 0x00000002;
  3425. const IMAP_MBOXFLAGS IMAP_MBOX_NOSELECT = 0x00000004;
  3426. const IMAP_MBOXFLAGS IMAP_MBOX_UNMARKED = 0x00000008;
  3427. const IMAP_MBOXFLAGS IMAP_MBOX_ALLFLAGS = 0x0000000F; // Keep this updated
  3428. // --------------------------------------
  3429. // IID_IIMAPCallback Interface Data Types
  3430. // --------------------------------------
  3431. // The following enumeration identifies the types of IMAP_RESPONSE structures
  3432. typedef enum tagIMAP_RESPONSE_TYPE {
  3433. irtERROR_NOTIFICATION, // Indicates an error has been encountered during response parsing
  3434. irtCOMMAND_COMPLETION, // Indicates this IMAP command is completed
  3435. irtSERVER_ALERT, // ALERT response (see IMAP spec)
  3436. irtPARSE_ERROR, // PARSE response (see IMAP spec)
  3437. irtMAILBOX_UPDATE, // EXISTS, RECENT, or UNSEEN responses (see IMAP spec)
  3438. irtDELETED_MSG, // EXPUNGE response (see IMAP spec)
  3439. irtFETCH_BODY, // Partial body from a message, returned via FETCH
  3440. irtUPDATE_MSG, // FETCH response (see IMAP spec)
  3441. irtAPPLICABLE_FLAGS, // FLAGS response (see IMAP spec)
  3442. irtPERMANENT_FLAGS, // PERMANENTFLAGS response code (see IMAP spec)
  3443. irtUIDVALIDITY, // UIDVALIDITY response code (see IMAP spec)
  3444. irtREADWRITE_STATUS, // READ-WRITE or READ-ONLY response code (see IMAP spec)
  3445. irtTRYCREATE, // TRYCREATE response code (see IMAP spec)
  3446. irtSEARCH, // SEARCH response (see IMAP spec)
  3447. irtMAILBOX_LISTING, // LIST or LSUB response (see IMAP spec)
  3448. irtMAILBOX_STATUS, // STATUS response (see IMAP spec)
  3449. irtAPPEND_PROGRESS, // Progress of APPEND stream upload
  3450. irtUPDATE_MSG_EX // Extended FETCH response (see IMAP spec)
  3451. } IMAP_RESPONSE_TYPE;
  3452. // Fetch body part - body parts requested by the client are returned piece-by-piece
  3453. // as they are received from the server, using this structure. After the entire FETCH
  3454. // response is received, the client will also receive a FETCH_CMD_RESULTS structure
  3455. // (see below) with the remaining requested information.
  3456. typedef struct tagFETCH_BODY_PART {
  3457. DWORD dwMsgSeqNum; // Message sequence number to which this FETCH resp applies
  3458. LPSTR pszBodyTag; // Pointer to the IMAP tag identifying this body part (eg,
  3459. // "RFC822.PEEK", or "BODY[2.2]<0.2048>"). NOTE that we terminate
  3460. // the tag at the FIRST SPACE. This means that even though you sent
  3461. // "BODY[HEADER.FIELDS (foo bar)]", the tag returned will only be
  3462. // "BODY[HEADER.FIELDS".
  3463. DWORD dwTotalBytes; // Total number of bytes expected for this body part
  3464. DWORD dwSizeOfData; // The number of bytes pointed to by pszData
  3465. DWORD dwOffset; // Offset of the start of this data buffer
  3466. BOOL fDone; // TRUE when this is the last data buffer
  3467. LPSTR pszData; // A pointer to the body part data
  3468. LPARAM lpFetchCookie1; // User-settable values, initially set to 0. These will persist
  3469. LPARAM lpFetchCookie2; // throughout the FETCH response, ie, for all FETCH_BODY_PART
  3470. // responses (even if multiple body parts are fetched), and for
  3471. // the final FETCH_CMD_RESULTS structure.
  3472. } FETCH_BODY_PART;
  3473. // Fetch results structure - holds data from a FETCH response. Since FETCH
  3474. // responses can be unsolicited, the recipient must check that a data item is
  3475. // valid before attempting to use it.
  3476. typedef struct tagFETCH_CMD_RESULTS {
  3477. DWORD dwMsgSeqNum; // Message sequence number to which this FETCH resp applies
  3478. BOOL bMsgFlags; // TRUE if MsgFlags (below) contains valid data
  3479. IMAP_MSGFLAGS mfMsgFlags; // Used to return the FLAGS tag of a FETCH response
  3480. BOOL bRFC822Size; // TRUE if dwRFC822Size (below) contains valid data
  3481. DWORD dwRFC822Size; // Used to return the RFC822.SIZE tag of a FETCH response
  3482. BOOL bUID; // TRUE if dwUID (below) contains valid data
  3483. DWORD dwUID; // Used to return the UID tag of a FETCH response
  3484. BOOL bInternalDate; // TRUE if ftInternalDate (below) contains valid data
  3485. FILETIME ftInternalDate; // Used to return the INTERNALDATE tag of a FETCH response
  3486. LPARAM lpFetchCookie1; // User-settable values. These will persist throughout
  3487. LPARAM lpFetchCookie2; // the FETCH, ie, for all FETCH_BODY_PART responses (even
  3488. // if multiple body parts are fetched), and for the final
  3489. // FETCH_CMD_RESULTS structure.
  3490. } FETCH_CMD_RESULTS;
  3491. typedef struct tagIMAPADDR {
  3492. LPSTR pszName; // See formal syntax for "addr_name", RFC2060
  3493. LPSTR pszADL; // See formal syntax for "addr_adl", RFC2060
  3494. LPSTR pszMailbox; // See formal syntax for "addr_mailbox", RFC2060
  3495. LPSTR pszHost; // See formal syntax for "addr_host", RFC2060
  3496. struct tagIMAPADDR *pNext; // Pointer to next address
  3497. } IMAPADDR;
  3498. typedef struct tagFETCH_CMD_RESULTS_EX {
  3499. // *** First part of this structure is exactly like FETCH_CMD_RESULTS ***
  3500. DWORD dwMsgSeqNum; // Message sequence number to which this FETCH resp applies
  3501. BOOL bMsgFlags; // TRUE if MsgFlags (below) contains valid data
  3502. IMAP_MSGFLAGS mfMsgFlags; // Used to return the FLAGS tag of a FETCH response
  3503. BOOL bRFC822Size; // TRUE if dwRFC822Size (below) contains valid data
  3504. DWORD dwRFC822Size; // Used to return the RFC822.SIZE tag of a FETCH response
  3505. BOOL bUID; // TRUE if dwUID (below) contains valid data
  3506. DWORD dwUID; // Used to return the UID tag of a FETCH response
  3507. BOOL bInternalDate; // TRUE if ftInternalDate (below) contains valid data
  3508. FILETIME ftInternalDate; // Used to return the INTERNALDATE tag of a FETCH response
  3509. LPARAM lpFetchCookie1; // User-settable values. These will persist throughout
  3510. LPARAM lpFetchCookie2; // the FETCH, ie, for all FETCH_BODY_PART responses (even
  3511. // if multiple body parts are fetched), and for the final
  3512. // FETCH_CMD_RESULTS structure.
  3513. // *** Second part of this structure contains the extensions ***
  3514. BOOL bEnvelope; // TRUE if we received an ENVELOPE response
  3515. FILETIME ftENVDate; // Date returned via ENVELOPE
  3516. LPSTR pszENVSubject; // "Subject" returned via ENVELOPE
  3517. IMAPADDR *piaENVFrom; // "From" addresses returned via ENVELOPE
  3518. IMAPADDR *piaENVSender; // "Sender" addresses returned via ENVELOPE
  3519. IMAPADDR *piaENVReplyTo; // "ReplyTo" addresses returned via ENVELOPE
  3520. IMAPADDR *piaENVTo; // "To" addresses returned via ENVELOPE
  3521. IMAPADDR *piaENVCc; // "Cc" addresses returned via ENVELOPE
  3522. IMAPADDR *piaENVBcc; // "Bcc" addresses returned via ENVELOPE
  3523. LPSTR pszENVInReplyTo; // "InReplyTo" returned via ENVELOPE
  3524. LPSTR pszENVMessageID; // "MessageID" returned via ENVELOPE
  3525. DWORD dwReserved1;
  3526. DWORD dwReserved2;
  3527. DWORD dwReserved3;
  3528. } FETCH_CMD_RESULTS_EX;
  3529. // The following structure is used to track and communicate EXISTS,
  3530. // RECENT and UNSEEN responses from the IMAP server
  3531. typedef struct tagMBOX_MSGCOUNT {
  3532. BOOL bGotExistsResponse;
  3533. DWORD dwExists;
  3534. BOOL bGotRecentResponse;
  3535. DWORD dwRecent;
  3536. BOOL bGotUnseenResponse;
  3537. DWORD dwUnseen;
  3538. } MBOX_MSGCOUNT;
  3539. // The following structure returns the results of a LIST or LSUB response
  3540. typedef struct tagIMAP_LISTLSUB_RESPONSE {
  3541. LPSTR pszMailboxName;
  3542. IMAP_MBOXFLAGS imfMboxFlags;
  3543. char cHierarchyChar;
  3544. } IMAP_LISTLSUB_RESPONSE;
  3545. // The following structure returns the results of a STATUS response
  3546. typedef struct tagIMAP_STATUS_RESPONSE {
  3547. LPSTR pszMailboxName;
  3548. BOOL fMessages;
  3549. DWORD dwMessages;
  3550. BOOL fRecent;
  3551. DWORD dwRecent;
  3552. BOOL fUIDNext;
  3553. DWORD dwUIDNext;
  3554. BOOL fUIDValidity;
  3555. DWORD dwUIDValidity;
  3556. BOOL fUnseen;
  3557. DWORD dwUnseen;
  3558. } IMAP_STATUS_RESPONSE;
  3559. // The following structure returns the progress of the current APPEND command
  3560. typedef struct tagAPPEND_PROGRESS {
  3561. DWORD dwUploaded;
  3562. DWORD dwTotal;
  3563. } APPEND_PROGRESS;
  3564. // The following union can hold the results of many types of IMAP responses
  3565. typedef [switch_type(IMAP_RESPONSE_TYPE)] union tagIMAP_RESPONSE_DATA {
  3566. [case (irtMAILBOX_UPDATE)] MBOX_MSGCOUNT *pmcMsgCount; // For mailbox update (EXISTS, RECENT, UNSEEN) data
  3567. [case (irtDELETED_MSG)] DWORD dwDeletedMsgSeqNum; // For EXPUNGE response data
  3568. [case (irtFETCH_BODY)] FETCH_BODY_PART *pFetchBodyPart; // For body parts (eg, RFC822) retrieved via FETCH
  3569. [case (irtUPDATE_MSG)] FETCH_CMD_RESULTS *pFetchResults; // For message update (FETCH) data
  3570. [case (irtAPPLICABLE_FLAGS, irtPERMANENT_FLAGS)]
  3571. IMAP_MSGFLAGS imfImapMessageFlags; // For FLAGS response or PERMANENTFLAGS response code data
  3572. [case (irtUIDVALIDITY)] DWORD dwUIDValidity; // For UIDVALIDITY response code data
  3573. [case (irtREADWRITE_STATUS)] BOOL bReadWrite; // For READ-WRITE or READ-ONLY response code data
  3574. [case (irtSEARCH)] IRangeList *prlSearchResults; // For SEARCH response data
  3575. [case (irtMAILBOX_LISTING)]
  3576. IMAP_LISTLSUB_RESPONSE illrdMailboxListing; // For LIST or LSUB response data
  3577. [case (irtMAILBOX_STATUS)]
  3578. IMAP_STATUS_RESPONSE *pisrStatusResponse; // For STATUS response data
  3579. [case (irtAPPEND_PROGRESS)]
  3580. APPEND_PROGRESS *papAppendProgress;
  3581. [case (irtUPDATE_MSG_EX)] FETCH_CMD_RESULTS_EX
  3582. *pFetchResultsEx; // For message update (FETCH) data
  3583. } IMAP_RESPONSE_DATA;
  3584. // The following structure is used to represent all IMAP responses
  3585. typedef struct tagIMAP_RESPONSE {
  3586. WPARAM wParam; // This is 0 if unsolicited response or unresolvable
  3587. LPARAM lParam; // This is 0 if unsolicited response or unresolvable
  3588. HRESULT hrResult;
  3589. LPSTR lpszResponseText;
  3590. IMAP_RESPONSE_TYPE irtResponseType;
  3591. [switch_is(irtResponseType)] IMAP_RESPONSE_DATA irdResponseData;
  3592. } IMAP_RESPONSE;
  3593. //-----------------------------------------------------------------------
  3594. // IID_IIMAPCallback Interface Functions
  3595. //-----------------------------------------------------------------------
  3596. //***********************************************************************
  3597. // Function: OnResponse
  3598. // Purpose: This function is used to report IMAP server responses to
  3599. // IMAP commands (or unsolicited responses).
  3600. // Arguments:
  3601. // [in] IMAP_RESPONSE *pirIMAPResponse - a pointer to an IMAP response
  3602. // structure is returned to the IID_IIMAPTransport user via
  3603. // this callback.
  3604. // Returns: This function should always return S_OK.
  3605. //***********************************************************************
  3606. HRESULT OnResponse([in] const IMAP_RESPONSE *pirIMAPResponse);
  3607. } // interface IIMAPCallback
  3608. // ***************************************************************************************
  3609. // ---------------------------------------------------------------------------------------
  3610. // IID_IIMAPTransport
  3611. // ---------------------------------------------------------------------------------------
  3612. [
  3613. uuid(E9E9D8A8-4EDD-11d0-874F-00AA00530EE9),
  3614. helpstring("IMAP Transport Interface: used to send IMAP commands to an IMAP server."),
  3615. ]
  3616. interface IIMAPTransport : IInternetTransport
  3617. {
  3618. // -------------------------------------
  3619. // IID_IIMAPTransport Interface Constants
  3620. // -------------------------------------
  3621. // The following DWORDs are returned by IIMAPTransport::Capability
  3622. const DWORD IMAP_CAPABILITY_IMAP4 = 0x00000001;
  3623. const DWORD IMAP_CAPABILITY_IMAP4rev1 = 0x00000002;
  3624. const DWORD IMAP_CAPABILITY_IDLE = 0x00000004;
  3625. const DWORD IMAP_CAPABILITY_ALLFLAGS = 0x00000007; // Keep this updated
  3626. //-----------------------------------------------------------------------
  3627. // IID_IIMAPTransport Interface Functions
  3628. //-----------------------------------------------------------------------
  3629. //***************************************************************************
  3630. // Function: InitNew
  3631. //
  3632. // Purpose:
  3633. // This function initializes the CImap4Agent class. This function
  3634. // must be the next function called after instantiating the CImap4Agent class.
  3635. //
  3636. // Arguments:
  3637. // LPSTR pszLogFilePath [in] - path to a log file (where all input and
  3638. // output is logged), if the caller wishes to log IMAP transactions.
  3639. // IIMAPCallback *pCBHandler [in] - pointer to a IIMAPCallback object.
  3640. // This object allows the CImap4Agent class to report all IMAP response
  3641. // results to its user.
  3642. //
  3643. // Returns:
  3644. // HRESULT indicating success or failure.
  3645. //***************************************************************************
  3646. HRESULT InitNew([in] LPSTR pszLogFilePath,
  3647. [in] IIMAPCallback *pCBHandler);
  3648. //***************************************************************************
  3649. // Function: NewIRangeList
  3650. //
  3651. // Purpose:
  3652. // This function returns a pointer to an IRangeList. Its purpose is to
  3653. // allow full functionality from an IIMAPTransport pointer without needing
  3654. // to resort to CoCreateInstance to get an IRangeList.
  3655. //
  3656. // Arguments:
  3657. // IRangeList **pprlNewRangeList [out] - if successful, the function
  3658. // returns a pointer to the new IRangeList.
  3659. //
  3660. // Returns:
  3661. // HRESULT indicating success or failure.
  3662. //***************************************************************************
  3663. HRESULT NewIRangeList([out] IRangeList **pprlNewRangeList);
  3664. //***************************************************************************
  3665. // Function: Capability
  3666. //
  3667. // Purpose:
  3668. // The CImap4Agent class always asks for the server's CAPABILITIES after
  3669. // a connection is established. The result is saved in a register and
  3670. // is available by calling this function.
  3671. //
  3672. // Arguments:
  3673. // [out] DWORD *pdwCapabilityFlags - this function returns a DWORD with
  3674. // bit-flags specifying which capabilities this IMAP server
  3675. // supports.
  3676. //
  3677. // Returns:
  3678. // HRESULT indicating success or failure.
  3679. //***************************************************************************
  3680. HRESULT Capability([out] DWORD *pdwCapabilityFlags);
  3681. //***************************************************************************
  3682. // Function: Select
  3683. //
  3684. // Purpose:
  3685. // This function issues a SELECT command to the IMAP server.
  3686. //
  3687. // Arguments:
  3688. // WPARAM wParam [in] - (see below)
  3689. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3690. // the caller to this IMAP command and its responses. Can be anything,
  3691. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3692. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3693. // responses for this command. If this is NULL, the default CB handler
  3694. // is used.
  3695. // LPSTR lpszMailboxName - pointer to IMAP-compliant mailbox name
  3696. //
  3697. // Returns:
  3698. // HRESULT indicating success or failure of send operation.
  3699. //***************************************************************************
  3700. HRESULT Select([in] WPARAM wParam,
  3701. [in] LPARAM lParam,
  3702. [in] IIMAPCallback *pCBHandler,
  3703. [in] LPSTR lpszMailboxName);
  3704. //***************************************************************************
  3705. // Function: Examine
  3706. //
  3707. // Purpose:
  3708. // This function issues an EXAMINE command to the IMAP server.
  3709. //
  3710. // Arguments:
  3711. // Same as for the Select() function.
  3712. //
  3713. // Returns:
  3714. // Same as for the Select() function.
  3715. //***************************************************************************
  3716. HRESULT Examine([in] WPARAM wParam,
  3717. [in] LPARAM lParam,
  3718. [in] IIMAPCallback *pCBHandler,
  3719. [in] LPSTR lpszMailboxName);
  3720. //***************************************************************************
  3721. // Function: Create
  3722. //
  3723. // Purpose:
  3724. // This function issues a CREATE command to the IMAP server.
  3725. //
  3726. // Arguments:
  3727. // WPARAM wParam [in] - (see below)
  3728. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3729. // the caller to this IMAP command and its responses. Can be anything,
  3730. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3731. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3732. // responses for this command. If this is NULL, the default CB handler
  3733. // is used.
  3734. // LPSTR lpszMailboxName - IMAP-compliant name of the mailbox.
  3735. //
  3736. // Returns:
  3737. // HRESULT indicating success or failure of send operation.
  3738. //***************************************************************************
  3739. HRESULT Create([in] WPARAM wParam,
  3740. [in] LPARAM lParam,
  3741. [in] IIMAPCallback *pCBHandler,
  3742. [in] LPSTR lpszMailboxName);
  3743. //***************************************************************************
  3744. // Function: Delete
  3745. //
  3746. // Purpose:
  3747. // This function issues a DELETE command to the IMAP server.
  3748. //
  3749. // Arguments:
  3750. // WPARAM wParam [in] - (see below)
  3751. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3752. // the caller to this IMAP command and its responses. Can be anything,
  3753. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3754. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3755. // responses for this command. If this is NULL, the default CB handler
  3756. // is used.
  3757. // LPSTR lpszMailboxName - IMAP-compliant name of the mailbox.
  3758. //
  3759. // Returns:
  3760. // HRESULT indicating success or failure of send operation.
  3761. //***************************************************************************
  3762. HRESULT Delete([in] WPARAM wParam,
  3763. [in] LPARAM lParam,
  3764. [in] IIMAPCallback *pCBHandler,
  3765. [in] LPSTR lpszMailboxName);
  3766. //***************************************************************************
  3767. // Function: Rename
  3768. //
  3769. // Purpose:
  3770. // This function issues a RENAME command to the IMAP server.
  3771. //
  3772. // Arguments:
  3773. // WPARAM wParam [in] - (see below)
  3774. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3775. // the caller to this IMAP command and its responses. Can be anything,
  3776. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3777. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3778. // responses for this command. If this is NULL, the default CB handler
  3779. // is used.
  3780. // LPSTR lpszMailboxName - CURRENT IMAP-compliant name of the mailbox.
  3781. // LPSTR lpszNewMailboxName - NEW IMAP-compliant name of the mailbox.
  3782. //
  3783. // Returns:
  3784. // HRESULT indicating success or failure of send operation.
  3785. //***************************************************************************
  3786. HRESULT Rename([in] WPARAM wParam,
  3787. [in] LPARAM lParam,
  3788. [in] IIMAPCallback *pCBHandler,
  3789. [in] LPSTR lpszMailboxName,
  3790. [in] LPSTR lpszNewMailboxName);
  3791. //***************************************************************************
  3792. // Function: Subscribe
  3793. //
  3794. // Purpose:
  3795. // This function issues a SUBSCRIBE command to the IMAP server.
  3796. //
  3797. // Arguments:
  3798. // WPARAM wParam [in] - (see below)
  3799. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3800. // the caller to this IMAP command and its responses. Can be anything,
  3801. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3802. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3803. // responses for this command. If this is NULL, the default CB handler
  3804. // is used.
  3805. // LPSTR lpszMailboxName - IMAP-compliant name of the mailbox.
  3806. //
  3807. // Returns:
  3808. // HRESULT indicating success or failure of send operation.
  3809. //***************************************************************************
  3810. HRESULT Subscribe([in] WPARAM wParam,
  3811. [in] LPARAM lParam,
  3812. [in] IIMAPCallback *pCBHandler,
  3813. [in] LPSTR lpszMailboxName);
  3814. //***************************************************************************
  3815. // Function: Unsubscribe
  3816. //
  3817. // Purpose:
  3818. // This function issues an UNSUBSCRIBE command to the IMAP server.
  3819. //
  3820. // Arguments:
  3821. // WPARAM wParam [in] - (see below)
  3822. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3823. // the caller to this IMAP command and its responses. Can be anything,
  3824. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3825. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3826. // responses for this command. If this is NULL, the default CB handler
  3827. // is used.
  3828. // LPSTR lpszMailboxName - IMAP-compliant name of the mailbox.
  3829. //
  3830. // Returns:
  3831. // HRESULT indicating success or failure of send operation.
  3832. //***************************************************************************
  3833. HRESULT Unsubscribe([in] WPARAM wParam,
  3834. [in] LPARAM lParam,
  3835. [in] IIMAPCallback *pCBHandler,
  3836. [in] LPSTR lpszMailboxName);
  3837. //***************************************************************************
  3838. // Function: List
  3839. //
  3840. // Purpose:
  3841. // This function issues a LIST command to the IMAP server.
  3842. //
  3843. // Arguments:
  3844. // WPARAM wParam [in] - (see below)
  3845. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3846. // the caller to this IMAP command and its responses. Can be anything,
  3847. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3848. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3849. // responses for this command. If this is NULL, the default CB handler
  3850. // is used.
  3851. // LPSTR lpszMailboxNameReference - IMAP-compliant reference for mbox name
  3852. // LPSTR lpszMailboxNamePattern - IMAP-compliant pattern for mailbox name
  3853. //
  3854. // Returns:
  3855. // HRESULT indicating success or failure of send operation.
  3856. //***************************************************************************
  3857. HRESULT List([in] WPARAM wParam,
  3858. [in] LPARAM lParam,
  3859. [in] IIMAPCallback *pCBHandler,
  3860. [in] LPSTR lpszMailboxNameReference,
  3861. [in] LPSTR lpszMailboxNamePattern);
  3862. //***************************************************************************
  3863. // Function: Lsub
  3864. //
  3865. // Purpose:
  3866. // This function issues a LSUB command to the IMAP server.
  3867. //
  3868. // Arguments:
  3869. // WPARAM wParam [in] - (see below)
  3870. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3871. // the caller to this IMAP command and its responses. Can be anything,
  3872. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3873. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3874. // responses for this command. If this is NULL, the default CB handler
  3875. // is used.
  3876. // LPSTR lpszMailboxNameReference - IMAP-compliant reference for mbox name
  3877. // LPSTR lpszMailboxNamePattern - IMAP-compliant pattern for mailbox name.
  3878. //
  3879. // Returns:
  3880. // HRESULT indicating success or failure of send operation.
  3881. //***************************************************************************
  3882. HRESULT Lsub([in] WPARAM wParam,
  3883. [in] LPARAM lParam,
  3884. [in] IIMAPCallback *pCBHandler,
  3885. [in] LPSTR lpszMailboxNameReference,
  3886. [in] LPSTR lpszMailboxNamePattern);
  3887. //***************************************************************************
  3888. // Function: Append
  3889. //
  3890. // Purpose:
  3891. // This function issues an APPEND command to the IMAP server.
  3892. //
  3893. // Arguments:
  3894. // WPARAM wParam [in] - (see below)
  3895. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3896. // the caller to this IMAP command and its responses. Can be anything,
  3897. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3898. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3899. // responses for this command. If this is NULL, the default CB handler
  3900. // is used.
  3901. // LPSTR lpszMailboxName - IMAP-compliant mailbox name to append message to.
  3902. // LPSTR lpszMessageFlags - IMAP-compliant list of msg flags to set for msg.
  3903. // Set to NULL to set no message flags. (Avoid passing "()" due to old Cyrus
  3904. // server bug). $REVIEW: This should be changed to IMAP_MSGFLAGS!!!
  3905. // FILETIME ftMessageDateTime - date/time to associate with msg (GMT/UTC)
  3906. // LPSTREAM lpstmMessageToSave - the message to save, in RFC822 format.
  3907. // No need to rewind the stream, this is done by CConnection::SendStream.
  3908. //
  3909. // Returns:
  3910. // HRESULT indicating success or failure of send operation.
  3911. //***************************************************************************
  3912. HRESULT Append([in] WPARAM wParam,
  3913. [in] LPARAM lParam,
  3914. [in] IIMAPCallback *pCBHandler,
  3915. [in] LPSTR lpszMailboxName,
  3916. [in] LPSTR lpszMessageFlags,
  3917. [in] FILETIME ftMessageDateTime,
  3918. [in] LPSTREAM lpstmMessageToSave);
  3919. //***************************************************************************
  3920. // Function: Close
  3921. //
  3922. // Purpose:
  3923. // This function issues a CLOSE command to the IMAP server.
  3924. //
  3925. // Arguments:
  3926. // WPARAM wParam [in] - (see below)
  3927. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3928. // the caller to this IMAP command and its responses. Can be anything,
  3929. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3930. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3931. // responses for this command. If this is NULL, the default CB handler
  3932. // is used.
  3933. //
  3934. // Returns:
  3935. // HRESULT indicating success or failure of send operation.
  3936. //***************************************************************************
  3937. HRESULT Close([in] WPARAM wParam,
  3938. [in] LPARAM lParam,
  3939. [in] IIMAPCallback *pCBHandler);
  3940. //***************************************************************************
  3941. // Function: Expunge
  3942. //
  3943. // Purpose:
  3944. // This function issues an EXPUNGE command to the IMAP server.
  3945. //
  3946. // Arguments:
  3947. // WPARAM wParam [in] - (see below)
  3948. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3949. // the caller to this IMAP command and its responses. Can be anything,
  3950. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3951. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3952. // responses for this command. If this is NULL, the default CB handler
  3953. // is used.
  3954. //
  3955. // Returns:
  3956. // HRESULT indicating success or failure on send operation.
  3957. //***************************************************************************
  3958. HRESULT Expunge([in] WPARAM wParam,
  3959. [in] LPARAM lParam,
  3960. [in] IIMAPCallback *pCBHandler);
  3961. //***************************************************************************
  3962. // Function: Search
  3963. //
  3964. // Purpose:
  3965. // This function issues a SEARCH command to the IMAP server.
  3966. //
  3967. // Arguments:
  3968. // WPARAM wParam [in] - (see below)
  3969. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  3970. // the caller to this IMAP command and its responses. Can be anything,
  3971. // but note that the value of 0, 0 is reserved for unsolicited responses.
  3972. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  3973. // responses for this command. If this is NULL, the default CB handler
  3974. // is used.
  3975. // LPSTR lpszSearchCriteria - IMAP-compliant list of search criteria
  3976. // boolean bReturnUIDs - if TRUE, we prepend "UID" to command.
  3977. // IRangeList *pMsgRange [in] - range of messages over which to operate
  3978. // the search. This argument should be NULL to exclude the message
  3979. // set from the search criteria.
  3980. // boolean bUIDRangeList [in] - TRUE if pMsgRange refers to a UID range,
  3981. // FALSE if pMsgRange refers to a message sequence number range. If
  3982. // pMsgRange is NULL, this argument is ignored.
  3983. //
  3984. // Returns:
  3985. // HRESULT indicating success or failure on send operation.
  3986. //***************************************************************************
  3987. HRESULT Search([in] WPARAM wParam,
  3988. [in] LPARAM lParam,
  3989. [in] IIMAPCallback *pCBHandler,
  3990. [in] LPSTR lpszSearchCriteria,
  3991. [in] boolean bReturnUIDs,
  3992. [in] IRangeList *pMsgRange,
  3993. [in] boolean bUIDRangeList);
  3994. //***************************************************************************
  3995. // Function: Fetch
  3996. //
  3997. // Purpose:
  3998. // This function issues a FETCH command to the IMAP server.
  3999. //
  4000. // Arguments:
  4001. // WPARAM wParam [in] - (see below)
  4002. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  4003. // the caller to this IMAP command and its responses. Can be anything,
  4004. // but note that the value of 0, 0 is reserved for unsolicited responses.
  4005. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  4006. // responses for this command. If this is NULL, the default CB handler
  4007. // is used.
  4008. // IRangeList *pMsgRange [in] - range of messages to fetch. The caller
  4009. // should pass NULL if he is using UIDs and he wants to generate his
  4010. // own message set (in lpszFetchArgs). If the caller is using msg
  4011. // seq nums, this argument MUST be specified to allow this class to
  4012. // resequence the msg nums as required.
  4013. // boolean bUIDMsgRange [in] - if TRUE, prepends "UID" to FETCH command and
  4014. // treats pMsgRange as a UID range.
  4015. // LPSTR lpszFetchArgs - arguments to the FETCH command
  4016. //
  4017. //
  4018. // Returns:
  4019. // HRESULT indicating success or failure of the send operation.
  4020. //***************************************************************************
  4021. HRESULT Fetch([in] WPARAM wParam,
  4022. [in] LPARAM lParam,
  4023. [in] IIMAPCallback *pCBHandler,
  4024. [in] IRangeList *pMsgRange,
  4025. [in] boolean bUIDMsgRange,
  4026. [in] LPSTR lpszFetchArgs);
  4027. //***************************************************************************
  4028. // Function: Store
  4029. //
  4030. // Purpose:
  4031. // This function issues a STORE command to the IMAP server.
  4032. //
  4033. // Arguments:
  4034. // WPARAM wParam [in] - (see below)
  4035. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  4036. // the caller to this IMAP command and its responses. Can be anything,
  4037. // but note that the value of 0, 0 is reserved for unsolicited responses.
  4038. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  4039. // responses for this command. If this is NULL, the default CB handler
  4040. // is used.
  4041. // IRangeList *pMsgRange [in] - range of messages to store. The caller
  4042. // should pass NULL if he is using UIDs and he wants to generate his
  4043. // own message set (in lpszStoreArgs). If the caller is using msg
  4044. // seq nums, this argument MUST be specified to allow this class to
  4045. // resequence the msg nums as required.
  4046. // boolean bUIDRangeList [in] - if TRUE, we prepend "UID" to the STORE command
  4047. // LPSTR lpszStoreArgs - arguments for the STORE command.
  4048. //
  4049. // Returns:
  4050. // HRESULT indicating success or failure of the send operation.
  4051. //***************************************************************************
  4052. HRESULT Store([in] WPARAM wParam,
  4053. [in] LPARAM lParam,
  4054. [in] IIMAPCallback *pCBHandler,
  4055. [in] IRangeList *pMsgRange,
  4056. [in] boolean bUIDRangeList,
  4057. [in] LPSTR lpszStoreArgs);
  4058. //***************************************************************************
  4059. // Function: Copy
  4060. //
  4061. // Purpose:
  4062. // This function issues a COPY command to the IMAP server.
  4063. //
  4064. // Arguments:
  4065. // WPARAM wParam [in] - (see below)
  4066. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  4067. // the caller to this IMAP command and its responses. Can be anything,
  4068. // but note that the value of 0, 0 is reserved for unsolicited responses.
  4069. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  4070. // responses for this command. If this is NULL, the default CB handler
  4071. // is used.
  4072. // IRangeList *pMsgRange [in] - the range of messages to copy. This
  4073. // argument must be supplied.
  4074. // boolean bUIDRangeList [in] - if TRUE, prepends "UID" to COPY command
  4075. // LPSTR lpszMailboxName [in] - C String of mailbox name
  4076. //
  4077. // Returns:
  4078. // HRESULT indicating success or failure of send operation.
  4079. //***************************************************************************
  4080. HRESULT Copy([in] WPARAM wParam,
  4081. [in] LPARAM lParam,
  4082. [in] IIMAPCallback *pCBHandler,
  4083. [in] IRangeList *pMsgRange,
  4084. [in] boolean bUIDRangeList,
  4085. [in] LPSTR lpszMailboxName);
  4086. //***************************************************************************
  4087. // Function: Noop
  4088. //
  4089. // Purpose:
  4090. // This function issues a NOOP command to the IMAP server.
  4091. //
  4092. // Arguments:
  4093. // WPARAM wParam [in] - (see below)
  4094. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  4095. // the caller to this IMAP command and its responses. Can be anything,
  4096. // but note that the value of 0, 0 is reserved for unsolicited responses.
  4097. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  4098. // responses for this command. If this is NULL, the default CB handler
  4099. // is used.
  4100. //
  4101. // Returns:
  4102. // HRESULT indicating success or failure of send operation.
  4103. //***************************************************************************
  4104. HRESULT Noop([in] WPARAM wParam,
  4105. [in] LPARAM lParam,
  4106. [in] IIMAPCallback *pCBHandler);
  4107. //---------------------------------------------------------------------------
  4108. // Message Sequence Number to UID member functions - the caller may use
  4109. // these functions to map from MSN's to UID's, if the caller uses UIDs
  4110. // to refer to messages. If the caller uses MSN's, there is no need to
  4111. // invoke the following functions.
  4112. //---------------------------------------------------------------------------
  4113. //***************************************************************************
  4114. // Function: ResizeMsgSeqNumTable
  4115. //
  4116. // Purpose:
  4117. // This function is called whenever we receive an EXISTS response. It
  4118. // resizes the MsgSeqNumToUID table to match the current size of the mailbox.
  4119. //
  4120. // Arguments:
  4121. // DWORD dwSizeOfMbox [in] - the number returned via the EXISTS response.
  4122. //
  4123. // Returns:
  4124. // HRESULT indicating success or failure.
  4125. //***************************************************************************
  4126. HRESULT ResizeMsgSeqNumTable([in] DWORD dwSizeOfMbox);
  4127. //***************************************************************************
  4128. // Function: UpdateSeqNumToUID
  4129. //
  4130. // Purpose:
  4131. // This function is called whenever we receive a FETCH response which has
  4132. // both a message sequence number and a UID number. It updates the
  4133. // MsgSeqNumToUID table so that given msg seq number maps to the given UID.
  4134. //
  4135. // Arguments:
  4136. // DWORD dwMsgSeqNum [in] - the message sequence number of the FETCH
  4137. // response.
  4138. // DWORD dwUID [in] - the UID of the given message sequence number.
  4139. //
  4140. // Returns:
  4141. // HRESULT indicating success or failure.
  4142. //***************************************************************************
  4143. HRESULT UpdateSeqNumToUID([in] DWORD dwMsgSeqNum,
  4144. [in] DWORD dwUID);
  4145. //***************************************************************************
  4146. // Function: RemoveSequenceNum
  4147. //
  4148. // Purpose:
  4149. // This function is called whenever we receive an EXPUNGE response. It
  4150. // removes the given message sequence number from the MsgSeqNumToUID table,
  4151. // and compacts the table so that all message sequence numbers following
  4152. // the deleted one are re-sequenced.
  4153. //
  4154. // Arguments:
  4155. // DWORD dwDeletedMsgSeqNum [in] - message sequence number of deleted msg.
  4156. //
  4157. // Returns:
  4158. // HRESULT indicating success or failure.
  4159. //***************************************************************************
  4160. HRESULT RemoveSequenceNum([in] DWORD dwDeletedMsgSeqNum);
  4161. //***************************************************************************
  4162. // Function: MsgSeqNumToUID
  4163. //
  4164. // Purpose:
  4165. // This function takes a message sequence number and converts it to a UID
  4166. // based on the MsgSeqNumToUID table.
  4167. //
  4168. // Arguments:
  4169. // DWORD dwMsgSeqNum [in] - the sequence number for which the caller wants
  4170. // to know the UID.
  4171. // DWORD *pdwUID [out] - the UID associated with the given sequence number
  4172. // is returned here. If none could be found, this function returns 0.
  4173. //
  4174. // Returns:
  4175. // HRESULT indicating success or failure.
  4176. //***************************************************************************
  4177. HRESULT MsgSeqNumToUID([in] DWORD dwMsgSeqNum, [out] DWORD *pdwUID);
  4178. //***************************************************************************
  4179. // Function: GetMsgSeqNumToUIDArray
  4180. //
  4181. // Purpose:
  4182. // This function returns a copy of the MsgSeqNumToUID array. The caller
  4183. // will want to do this to delete messages from the cache which no longer
  4184. // exist on the server, for example.
  4185. //
  4186. // Arguments:
  4187. // DWORD **ppdwMsgSeqNumToUIDArray [out] - the function returns a pointer
  4188. // to the copy of the MsgSeqNumToUID array in this argument. Note that
  4189. // it is the caller's responsibility to MemFree the array. If no array
  4190. // is available, or it is empty, the returned pointer value is NULL.
  4191. // DWORD *pdwNumberOfElements [out] - the function returns the size of
  4192. // the MsgSeqNumToUID array.
  4193. //
  4194. // Returns:
  4195. // HRESULT indicating success or failure.
  4196. //***************************************************************************
  4197. HRESULT GetMsgSeqNumToUIDArray([out] DWORD **ppdwMsgSeqNumToUIDArray,
  4198. [out] DWORD *pdwNumberOfElements);
  4199. //***************************************************************************
  4200. // Function: GetHighestMsgSeqNum
  4201. //
  4202. // Purpose:
  4203. // This function returns the highest message sequence number reported in
  4204. // the MsgSeqNumToUID array.
  4205. //
  4206. // Arguments:
  4207. // DWORD *pdwHighestMSN [out] - the highest message sequence number in the
  4208. // table is returned here.
  4209. //
  4210. // Returns:
  4211. // HRESULT indicating success or failure.
  4212. //***************************************************************************
  4213. HRESULT GetHighestMsgSeqNum([out] DWORD *pdwHighestMSN);
  4214. //***************************************************************************
  4215. // Function: ResetMsgSeqNumToUID
  4216. //
  4217. // Purpose:
  4218. // This function resets the variables used to maintain the MsgSeqNumToUID
  4219. // table. This function is AUTOMATICALLY called whenever the MsgSeqNumToUID
  4220. // table becomes invalid (say, when a new mailbox is selected, or we are
  4221. // disconnected). This function shouldn't normally need to be called, but
  4222. // I've placed it here just in case someone needs it.
  4223. //
  4224. // Returns:
  4225. // S_OK. This function cannot fail.
  4226. //***************************************************************************
  4227. HRESULT ResetMsgSeqNumToUID(void);
  4228. //---------------------------------------------------------------------------
  4229. // Leaving Message Sequence Number to UID member functions zone
  4230. //---------------------------------------------------------------------------
  4231. //***************************************************************************
  4232. // Function: SetDefaultCBHandler
  4233. //
  4234. // Purpose: This function changes the current default IIMAPCallback handler
  4235. // to the given one.
  4236. //
  4237. // Arguments:
  4238. // IIMAPCallback *pCBHandler [in] - a pointer to the new callback handler.
  4239. //
  4240. // Returns:
  4241. // HRESULT indicating success or failure.
  4242. //***************************************************************************
  4243. HRESULT SetDefaultCBHandler([in] IIMAPCallback *pCBHandler);
  4244. //***************************************************************************
  4245. // Function: Status
  4246. //
  4247. // Purpose:
  4248. // This function issues a STATUS command to the IMAP server.
  4249. //
  4250. // Arguments:
  4251. // WPARAM wParam [in] - (see below)
  4252. // LPARAM lParam [in] - the wParam and lParam form a unique ID assigned by
  4253. // the caller to this IMAP command and its responses. Can be anything,
  4254. // but note that the value of 0, 0 is reserved for unsolicited responses.
  4255. // IIMAPCallback *pCBHandler [in] - the CB handler to use to process the
  4256. // responses for this command. If this is NULL, the default CB handler
  4257. // is used.
  4258. // LPSTR pszMailboxName [in] - the mailbox which you want to get the
  4259. // STATUS of.
  4260. // LPSTR pszStatusCmdArgs [in] - the arguments for the STATUS command,
  4261. // eg, "(MESSAGES UNSEEN)".
  4262. //
  4263. // Returns:
  4264. // HRESULT indicating success or failure of the send operation.
  4265. //***************************************************************************
  4266. HRESULT Status([in] WPARAM wParam,
  4267. [in] LPARAM lParam,
  4268. [in] IIMAPCallback *pCBHandler,
  4269. [in] LPSTR pszMailboxName,
  4270. [in] LPSTR pszStatusCmdArgs);
  4271. } // interface IIMAPTransport
  4272. // ***************************************************************************************
  4273. // ---------------------------------------------------------------------------------------
  4274. // IID_IIMAPTransport2
  4275. // ---------------------------------------------------------------------------------------
  4276. [
  4277. uuid(DA8283C0-37C5-11d2-ACD9-0080C7B6E3C5),
  4278. helpstring("IMAP Transport Interface 2: Extension to IIMAPTransport."),
  4279. ]
  4280. interface IIMAPTransport2 : IIMAPTransport
  4281. {
  4282. //-----------------------------------------------------------------------
  4283. // IID_IIMAPTransport Interface Functions
  4284. //-----------------------------------------------------------------------
  4285. //***************************************************************************
  4286. // Function: SetDefaultCP
  4287. //
  4288. // Purpose:
  4289. // This function allows the caller to tell IIMAPTransport what codepage to
  4290. // use for IMAP mailbox names. After calling this function, all mailbox names
  4291. // submitted to IIMAPTransport will be translated from the default codepage,
  4292. // and all mailbox names returned from the server will be translated to
  4293. // the default codepage before being returned via IIMAPCallback.
  4294. //
  4295. // Arguments:
  4296. // DWORD dwTranslateFlags [in] - enables/disables automatic translation to
  4297. // and from default codepage and IMAP-modified UTF-7. If disabled, caller
  4298. // wishes all mailbox names to be passed verbatim to/from IMAP server.
  4299. // Note that by default we translate for IMAP4 servers, even with its
  4300. // round-trippability problems, because this is how we used to do it
  4301. // in the past.
  4302. // UINT uiCodePage [in] - the default codepage to use for translations.
  4303. // By default this value is the CP returned by GetACP().
  4304. //
  4305. // Returns:
  4306. // HRESULT indicating success or failure.
  4307. //***************************************************************************
  4308. HRESULT SetDefaultCP([in] DWORD dwTranslateFlags,
  4309. [in] UINT uiCodePage);
  4310. // TranslateFlags
  4311. const DWORD IMAP_MBOXXLATE_DEFAULT = 0x00000000; // Always translate, even for IMAP4
  4312. const DWORD IMAP_MBOXXLATE_DISABLE = 0x00000001; // Always disable
  4313. const DWORD IMAP_MBOXXLATE_DISABLEIMAP4 = 0x00000002; // Disable for IMAP4, translate for IMAP4rev1
  4314. const DWORD IMAP_MBOXXLATE_VERBATIMOK = 0x00000004; // Non-translatable mbox names can be returned verbatim
  4315. // Note if translation disabled, all mboxes will be
  4316. // returned with IXP_S_IMAP_VERBATIM_MBOX
  4317. const DWORD IMAP_MBOXXLATE_RETAINCP = 0x00000008; // Don't change codepage with this call
  4318. //***************************************************************************
  4319. // Function: MultiByteToModifiedUTF7
  4320. //
  4321. // Purpose:
  4322. // This function takes a MultiByte string and converts it to modified IMAP
  4323. // UTF7, which is described in RFC2060. This function is only needed if the
  4324. // user has disabled transparent mailbox translation using SetDefaultCP(FALSE,0).
  4325. //
  4326. // Arguments:
  4327. // LPCSTR pszSource [in] - pointer to the MultiByte string to convert to UTF7.
  4328. // LPSTR *ppszDestination [out] - a pointer to a string buffer containing
  4329. // the UTF7 equivalent of pszSource is returned here. It is the caller's
  4330. // responsibility to MemFree this string.
  4331. // UINT uiSourceCP [in] - indicates the codepage for pszSource
  4332. // Note that no translation is performed if SetDefaultCP(FALSE,.) was called.
  4333. // DWORD dwFlags [in] - Reserved. Leave as 0.
  4334. //
  4335. // Returns:
  4336. // HRESULT indicating success or failure.
  4337. //***************************************************************************
  4338. HRESULT MultiByteToModifiedUTF7([in] LPCSTR pszSource,
  4339. [out] LPSTR *ppszDestination,
  4340. [in] UINT uiSourceCP,
  4341. [in] DWORD dwFlags);
  4342. //***************************************************************************
  4343. // Function: ModifiedUTF7ToMultiByte
  4344. //
  4345. // Purpose:
  4346. // This function takes a modified IMAP UTF-7 string (as defined in RFC2060)
  4347. // and converts it to a multi-byte string. This function is only needed if the
  4348. // user has disabled transparent mailbox translation using SetDefaultCP(FALSE,0).
  4349. //
  4350. // Arguments:
  4351. // LPCSTR pszSource [in] - a null-terminated string containing the modified
  4352. // IMAP UTF-7 string to convert to multibyte.
  4353. // LPSTR *ppszDestination [out] - this function returns a pointer to the
  4354. // null-terminated multibyte string (in the system codepage) obtained
  4355. // from pszSource. It is the caller's responsiblity to MemFree this
  4356. // string when it is done with it.
  4357. // UINT uiDestintationCP [in] - indicates the desired codepage for the
  4358. // destination string. Note that no translation is performed if
  4359. // SetDefaultCP(FALSE,.) was called.
  4360. // DWORD dwFlags [in] - Reserved. Leave as 0.
  4361. //
  4362. // Returns:
  4363. // HRESULT indicating success or failure. Success result codes include:
  4364. // S_OK - pszSource successfully converted to modified UTF-7
  4365. // IXP_S_IMAP_VERBATIM_MBOX - pszSource could not be converted to multibyte,
  4366. // so ppszDestination contains a duplicate of pszSource. If target CP
  4367. // is Unicode, pszSource is converted to Unicode with the assumption
  4368. // that it is USASCII. IMAP_MBOXXLATE_VERBATIMOK must have been set via
  4369. // SetDefaultCP in order to get this behaviour.
  4370. //***************************************************************************
  4371. HRESULT ModifiedUTF7ToMultiByte([in] LPCSTR pszSource,
  4372. [out] LPSTR *ppszDestination,
  4373. [in] UINT uiDestinationCP,
  4374. [in] DWORD dwFlags);
  4375. //***************************************************************************
  4376. // Function: SetIdleMode
  4377. //
  4378. // Purpose:
  4379. // The IMAP IDLE extension allows the server to unilaterally report changes
  4380. // to the currently selected mailbox: new email, flag updates, and message
  4381. // expunges. IIMAPTransport always enters IDLE mode when no IMAP commands
  4382. // are pending, but it turns out that this can result in unnecessary
  4383. // entry and exit of IDLE mode when the caller tries to sequence IMAP commands.
  4384. // This function allows the caller to disable the use of the IDLE extension.
  4385. //
  4386. // Arguments:
  4387. // DWORD dwIdleFlags [in] - enables or disables the use of the IDLE extension.
  4388. //
  4389. // Returns:
  4390. // HRESULT indicating success or failure.
  4391. //***************************************************************************
  4392. HRESULT SetIdleMode([in] DWORD dwIdleFlags);
  4393. // Idle Flags
  4394. const DWORD IMAP_IDLE_DISABLE = 0x00000000;
  4395. const DWORD IMAP_IDLE_ENABLE = 0x00000001;
  4396. //***************************************************************************
  4397. // Function: EnableFetchEx
  4398. //
  4399. // Purpose:
  4400. // IIMAPTransport only understood a subset of FETCH response tags. Notable
  4401. // omissions included ENVELOPE and BODYSTRUCTURE. Calling this function
  4402. // changes the behaviour of IIMAPTransport::Fetch. Instead of returning
  4403. // FETCH responses via IIMAPCallback::OnResponse(irtUPDATE_MSG),
  4404. // the FETCH response is returned via OnResponse(irtUPDATE_MSG_EX).
  4405. // Other FETCH-related responses remain unaffected (eg, irtFETCH_BODY).
  4406. //
  4407. // Arguments:
  4408. // DWORD dwFetchExFlags [in] - enables or disables FETCH extensions.
  4409. //
  4410. // Returns:
  4411. // HRESULT indicating success or failure.
  4412. //***************************************************************************
  4413. HRESULT EnableFetchEx([in] DWORD dwFetchExFlags);
  4414. // FetchEx flags
  4415. const DWORD IMAP_FETCHEX_DISABLE = 0x00000000;
  4416. const DWORD IMAP_FETCHEX_ENABLE = 0x00000001;
  4417. //***************************************************************************
  4418. // Function: SetWindow
  4419. //
  4420. // Purpose:
  4421. // This function creates a new window for async winsock processing
  4422. //
  4423. // Returns:
  4424. // HRESULT indicating success or failure.
  4425. //***************************************************************************
  4426. HRESULT SetWindow(void);
  4427. //***************************************************************************
  4428. // Function: ResetWindow
  4429. //
  4430. // Purpose:
  4431. // This function closes a window for async winsock processing
  4432. //
  4433. // Returns:
  4434. // HRESULT indicating success or failure.
  4435. //***************************************************************************
  4436. HRESULT ResetWindow(void);
  4437. } // interface IIMAPTransport2
  4438. } // library IMNXPORT
  4439. cpp_quote("// --------------------------------------------------------------------------------")
  4440. cpp_quote("// Exported C Functions")
  4441. cpp_quote("// --------------------------------------------------------------------------------")
  4442. cpp_quote("#if !defined(_IMNXPORT_)")
  4443. cpp_quote("#define IMNXPORTAPI DECLSPEC_IMPORT HRESULT WINAPI")
  4444. cpp_quote("#else")
  4445. cpp_quote("#define IMNXPORTAPI HRESULT WINAPI")
  4446. cpp_quote("#endif")
  4447. cpp_quote("#ifdef __cplusplus")
  4448. cpp_quote("extern \"C\" {")
  4449. cpp_quote("#endif")
  4450. cpp_quote("")
  4451. cpp_quote("// --------------------------------------------------------------------------------")
  4452. cpp_quote("// CreateRASTransport")
  4453. cpp_quote("// ")
  4454. cpp_quote("// Description:")
  4455. cpp_quote("// This method creates a IRASTransport object. The client must initialize the")
  4456. cpp_quote("// object by calling IRASTransport::InitNew")
  4457. cpp_quote("// ")
  4458. cpp_quote("// Parameters:")
  4459. cpp_quote("// ppTransport Upon successful return, contains the a pointer to")
  4460. cpp_quote("// an IRASTransport interface")
  4461. cpp_quote("// ")
  4462. cpp_quote("// Return Values:")
  4463. cpp_quote("// S_OK Successful.")
  4464. cpp_quote("// E_INVALIDARG ppTransport is NULL")
  4465. cpp_quote("// E_OUTOFMEMORY Memory allocation failure...")
  4466. cpp_quote("// ")
  4467. cpp_quote("// --------------------------------------------------------------------------------")
  4468. cpp_quote("IMNXPORTAPI CreateRASTransport(")
  4469. cpp_quote(" /* out */ IRASTransport **ppTransport);")
  4470. cpp_quote("")
  4471. cpp_quote("// --------------------------------------------------------------------------------")
  4472. cpp_quote("// CreateNNTPTransport")
  4473. cpp_quote("// ")
  4474. cpp_quote("// Description:")
  4475. cpp_quote("// This method creates a INNTPTransport object. The client must initialize the")
  4476. cpp_quote("// object by calling INNTPTransport::InitNew")
  4477. cpp_quote("// ")
  4478. cpp_quote("// Parameters:")
  4479. cpp_quote("// ppTransport Upon successful return, contains the a pointer to")
  4480. cpp_quote("// an INNTPTransport interface")
  4481. cpp_quote("// ")
  4482. cpp_quote("// Return Values:")
  4483. cpp_quote("// S_OK Successful.")
  4484. cpp_quote("// E_INVALIDARG ppTransport is NULL")
  4485. cpp_quote("// E_OUTOFMEMORY Memory allocation failure...")
  4486. cpp_quote("// ")
  4487. cpp_quote("// --------------------------------------------------------------------------------")
  4488. cpp_quote("IMNXPORTAPI CreateNNTPTransport(")
  4489. cpp_quote(" /* out */ INNTPTransport **ppTransport);")
  4490. cpp_quote("")
  4491. cpp_quote("// --------------------------------------------------------------------------------")
  4492. cpp_quote("// CreateSMTPTransport")
  4493. cpp_quote("// ")
  4494. cpp_quote("// Description:")
  4495. cpp_quote("// This method creates a ISMTPTransport object. The client must initialize the")
  4496. cpp_quote("// object by calling ISMTPTransport::InitNew")
  4497. cpp_quote("// ")
  4498. cpp_quote("// Parameters:")
  4499. cpp_quote("// ppTransport Upon successful return, contains the a pointer to")
  4500. cpp_quote("// an ISMTPTransport interface")
  4501. cpp_quote("// ")
  4502. cpp_quote("// Return Values:")
  4503. cpp_quote("// S_OK Successful.")
  4504. cpp_quote("// E_INVALIDARG ppTransport is NULL")
  4505. cpp_quote("// E_OUTOFMEMORY Memory allocation failure...")
  4506. cpp_quote("// ")
  4507. cpp_quote("// --------------------------------------------------------------------------------")
  4508. cpp_quote("IMNXPORTAPI CreateSMTPTransport(")
  4509. cpp_quote(" /* out */ ISMTPTransport **ppTransport);")
  4510. cpp_quote("")
  4511. cpp_quote("// --------------------------------------------------------------------------------")
  4512. cpp_quote("// CreatePOP3Transport")
  4513. cpp_quote("// ")
  4514. cpp_quote("// Description:")
  4515. cpp_quote("// This method creates a IPOP3Transport object. The client must initialize the")
  4516. cpp_quote("// object by calling IPOP3Transport::InitNew")
  4517. cpp_quote("// ")
  4518. cpp_quote("// Parameters:")
  4519. cpp_quote("// ppTransport Upon successful return, contains the a pointer to")
  4520. cpp_quote("// an IPOP3Transport interface")
  4521. cpp_quote("// ")
  4522. cpp_quote("// Return Values:")
  4523. cpp_quote("// S_OK Successful.")
  4524. cpp_quote("// E_INVALIDARG ppTransport is NULL")
  4525. cpp_quote("// E_OUTOFMEMORY Memory allocation failure...")
  4526. cpp_quote("// ")
  4527. cpp_quote("// --------------------------------------------------------------------------------")
  4528. cpp_quote("IMNXPORTAPI CreatePOP3Transport(")
  4529. cpp_quote(" /* out */ IPOP3Transport **ppTransport);")
  4530. cpp_quote("")
  4531. cpp_quote("// --------------------------------------------------------------------------------")
  4532. cpp_quote("// CreateIMAPTransport")
  4533. cpp_quote("// ")
  4534. cpp_quote("// Description:")
  4535. cpp_quote("// This method creates a IIMAPTransport object. The client must initialize the")
  4536. cpp_quote("// object by calling IIMAPTransport::InitNew")
  4537. cpp_quote("// ")
  4538. cpp_quote("// Parameters:")
  4539. cpp_quote("// ppTransport Upon successful return, contains the a pointer to")
  4540. cpp_quote("// an IIMAPTransport interface")
  4541. cpp_quote("// ")
  4542. cpp_quote("// Return Values:")
  4543. cpp_quote("// S_OK Successful.")
  4544. cpp_quote("// E_INVALIDARG ppTransport is NULL")
  4545. cpp_quote("// E_OUTOFMEMORY Memory allocation failure...")
  4546. cpp_quote("// ")
  4547. cpp_quote("// --------------------------------------------------------------------------------")
  4548. cpp_quote("IMNXPORTAPI CreateIMAPTransport(")
  4549. cpp_quote(" /* out */ IIMAPTransport **ppTransport);")
  4550. cpp_quote("")
  4551. cpp_quote("// --------------------------------------------------------------------------------")
  4552. cpp_quote("// CreateIMAPTransport2")
  4553. cpp_quote("// ")
  4554. cpp_quote("// Description:")
  4555. cpp_quote("// This method creates an IIMAPTransport2 object. The client must initialize the")
  4556. cpp_quote("// object by calling IIMAPTransport2::InitNew")
  4557. cpp_quote("// ")
  4558. cpp_quote("// Parameters:")
  4559. cpp_quote("// ppTransport Upon successful return, contains the a pointer to")
  4560. cpp_quote("// an IIMAPTransport2 interface")
  4561. cpp_quote("// ")
  4562. cpp_quote("// Return Values:")
  4563. cpp_quote("// S_OK Successful.")
  4564. cpp_quote("// E_INVALIDARG ppTransport is NULL")
  4565. cpp_quote("// E_OUTOFMEMORY Memory allocation failure...")
  4566. cpp_quote("// ")
  4567. cpp_quote("// --------------------------------------------------------------------------------")
  4568. cpp_quote("IMNXPORTAPI CreateIMAPTransport2(")
  4569. cpp_quote(" /* out */ IIMAPTransport2 **ppTransport);")
  4570. cpp_quote("")
  4571. cpp_quote("// --------------------------------------------------------------------------------")
  4572. cpp_quote("// CreateRangeList")
  4573. cpp_quote("// ")
  4574. cpp_quote("// Description:")
  4575. cpp_quote("// This method creates a IRangeList object.")
  4576. cpp_quote("// ")
  4577. cpp_quote("// Parameters:")
  4578. cpp_quote("// ppRangeList Upon successful return, contains the a pointer to")
  4579. cpp_quote("// an IRangeList interface")
  4580. cpp_quote("// ")
  4581. cpp_quote("// Return Values:")
  4582. cpp_quote("// S_OK Successful.")
  4583. cpp_quote("// E_INVALIDARG ppRangeList is NULL")
  4584. cpp_quote("// E_OUTOFMEMORY Memory allocation failure...")
  4585. cpp_quote("// ")
  4586. cpp_quote("// --------------------------------------------------------------------------------")
  4587. cpp_quote("IMNXPORTAPI CreateRangeList(")
  4588. cpp_quote(" /* out */ IRangeList **ppRangeList);")
  4589. cpp_quote("")
  4590. cpp_quote("#ifdef __cplusplus")
  4591. cpp_quote("}")
  4592. cpp_quote("#endif")
  4593. cpp_quote("")