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.

2009 lines
107 KiB

  1. /*
  2. @doc MAILMSG EXTERNAL
  3. @module MAILMSG.IDL - IDL for Mail Message Object. | This module declares the
  4. various interfaces exported for access to the Mail Message Object.
  5. */
  6. cpp_quote("/*++")
  7. cpp_quote("")
  8. cpp_quote("Copyright (c) 1996, 1997 Microsoft Corporation")
  9. cpp_quote("")
  10. cpp_quote("Module Name:")
  11. cpp_quote("")
  12. cpp_quote(" mailmsg.idl / mailmsg.h")
  13. cpp_quote("")
  14. cpp_quote("Abstract:")
  15. cpp_quote("")
  16. cpp_quote(" This module contains definitions for the COM interfaces for")
  17. cpp_quote(" the Mail Message Object.")
  18. cpp_quote("")
  19. cpp_quote("Author:")
  20. cpp_quote("")
  21. cpp_quote(" Don Dumitru ([email protected])")
  22. cpp_quote("")
  23. cpp_quote("Revision History:")
  24. cpp_quote("")
  25. cpp_quote(" dondu 2/24/98 created")
  26. cpp_quote("")
  27. cpp_quote("--*/")
  28. // mailmsg.idl : IDL source for mailmsg.dll
  29. //
  30. // This file will be processed by the MIDL tool to
  31. // produce the type library (mailmsg.tlb) and marshalling code.
  32. import "oaidl.idl";
  33. import "ocidl.idl";
  34. //
  35. // Define an FIO_CONTEXT so that the compiler will not complain
  36. // during MIDL PASS.
  37. //
  38. cpp_quote("#ifdef MIDL_PASS")
  39. typedef struct _FIO_CONTEXT {
  40. DWORD m_dwTempHack ;
  41. DWORD m_dwSignature ;
  42. HANDLE m_hFile ;
  43. } FIO_CONTEXT, *PFIO_CONTEXT;
  44. cpp_quote("#endif")
  45. cpp_quote("#include <filehc.h>")
  46. // Define a structure as a filter context for quickly going through
  47. // recipients in a list of domains and returning recipients that
  48. // match certain filtering criteria
  49. typedef struct _RECIPIENT_FILTER_CONTEXT
  50. {
  51. DWORD dwCurrentDomain;
  52. DWORD dwCurrentRecipientIndex;
  53. DWORD dwRecipientsLeftInDomain;
  54. DWORD dwNextDomain;
  55. DWORD dwFilterMask;
  56. DWORD dwFilterFlags;
  57. } RECIPIENT_FILTER_CONTEXT, *LPRECIPIENT_FILTER_CONTEXT;
  58. //@doc MAILMSG EXTERNAL
  59. //
  60. // Define insertion flags for SetNextDomain
  61. //
  62. //@const DWORD | FLAG_FAIL_IF_SOURCE_DOMAIN_LINKED | Fail if current domain has existing domain links
  63. cpp_quote("#define FLAG_FAIL_IF_SOURCE_DOMAIN_LINKED 0x00000001")
  64. //@const DWORD | FLAG_FAIL_IF_NEXT_DOMAIN_LINKED | Fail if next domain has existing domain links
  65. cpp_quote("#define FLAG_FAIL_IF_NEXT_DOMAIN_LINKED 0x00000002")
  66. //@const DWORD | FLAG_OVERWRITE_EXISTING_LINKS | Force overwrite of exiting domain link information
  67. cpp_quote("#define FLAG_OVERWRITE_EXISTING_LINKS 0x00000004")
  68. //@const DWORD | FLAG_OVERWRITE_EXISTING_LINKS | Force the current domain to only domain is a domain list
  69. cpp_quote("#define FLAG_SET_FIRST_DOMAIN 0x00000008")
  70. //
  71. // Define address types for IMailMsgRecipientsBase::Item
  72. //
  73. //@const DWORD | ADDRTYPE_SMTP | SMTP address
  74. cpp_quote("#define ADDRTYPE_SMTP 0")
  75. //@const DWORD | ADDRTYPE_X400 | X400 address
  76. cpp_quote("#define ADDRTYPE_X400 1")
  77. //@const DWORD | ADDRTYPE_X500 | X500 address
  78. cpp_quote("#define ADDRTYPE_X500 2")
  79. //@const DWORD | ADDRTYPE_LEGACY_EX_DN | DN For Exchange 5.5 and previous
  80. cpp_quote("#define ADDRTYPE_LEGACY_EX_DN 3")
  81. //@const DWORD | ADDRTYPE_OTHER | Other address type
  82. cpp_quote("#define ADDRTYPE_OTHER 4")
  83. //@const HRESULT | MAILMSG_S_PENDING | Success. The operation is pending completion.
  84. cpp_quote("#define MAILMSG_S_PENDING MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_NT_BIT,STATUS_PENDING)")
  85. //@const HRESULT | MAILMSG_E_DUPLICATE | Failure. The recipient is a duplicate of one already in the list.
  86. cpp_quote("#define MAILMSG_E_DUPLICATE HRESULT_FROM_WIN32(ERROR_FILE_EXISTS)")
  87. //@const HRESULT | MAILMSG_E_PROPNOTFOUND | Failure. The requested property does not exist.
  88. cpp_quote("#define MAILMSG_E_PROPNOTFOUND STG_E_UNKNOWN")
  89. //@const HRESULT | MAILTRANSPORT_S_PENDING | Success. The operation is pending completion.
  90. cpp_quote("#define MAILTRANSPORT_S_PENDING MAILMSG_S_PENDING")
  91. //@const HRESULT | STOREDRV_E_RETRY | Success. The operation is pending completion.
  92. cpp_quote("#define STOREDRV_E_RETRY MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,ERROR_RETRY)")
  93. //@const HRESULT | STOREDRV_E_SHUTDOWN | Success. The operation is pending shutdown.
  94. cpp_quote("#define STOREDRV_E_SHUTDOWN 0xC004012DL")
  95. //@const DWORD | MAILMSG_AMF_MUSTCREATE | Store driver must create the message, regardless of recipients.
  96. cpp_quote("#define MAILMSG_AMF_MUSTCREATE 0x00000001")
  97. //@const DWORD | SMTP_INIT_VSERVER_STARTUP | Virtual server is starting.
  98. cpp_quote("#define SMTP_INIT_VSERVER_STARTUP 0x00000001")
  99. //@const DWORD | SMTP_TERM_VSERVER_SHUTDOWN | Virtual server is stopping.
  100. cpp_quote("#define SMTP_TERM_VSERVER_SHUTDOWN 0x00000002")
  101. //@const DWORD | SMTP_INIT_BINDING_CHANGE | A binding change occurred.
  102. cpp_quote("#define SMTP_INIT_BINDING_CHANGE 0x00000003")
  103. //@const DWORD | SMTP_TERM_BINDING_CHANGE | A binding change occurred.
  104. cpp_quote("#define SMTP_TERM_BINDING_CHANGE 0x00000004")
  105. //@const DWORD | MAILMSG_GETPROPS_COMPLETE | Get the complete property stream.
  106. cpp_quote("#define MAILMSG_GETPROPS_COMPLETE 0x00000001")
  107. //@const DWORD | MAILMSG_GETPROPS_INCREMENTAL | Get the incremental property stream.
  108. cpp_quote("#define MAILMSG_GETPROPS_INCREMENTAL 0x00000002")
  109. //@const DWORD | MAILMSG_GETPROPS_CLEAR_DIRTY | Clear the dirty flag(s).
  110. cpp_quote("#define MAILMSG_GETPROPS_CLEAR_DIRTY 0x00000004")
  111. //@doc MAILMSG EXTERNAL
  112. /*
  113. @interface IMailMsgNotify | Interface for receiving async notifications.
  114. @meth HRESULT | Notify | Notify than an operation has completed.
  115. */
  116. [
  117. helpstring("Mail Message Notify"),
  118. object,
  119. pointer_default(unique),
  120. uuid(0f7c3c30-a8ad-11d1-aa91-00aa006bc80b)
  121. ]
  122. interface IMailMsgNotify : IUnknown
  123. {
  124. //@method HRESULT | IMailMsgNotify | Notify | Notify that an operation has completed.
  125. //@parm HRESULT | hrRes | [in] Specifies the result of the operation.
  126. //@rvalue S_OK | Success.
  127. [helpstring("Notify that an operation has completed.")]
  128. HRESULT Notify([in] HRESULT hrRes);
  129. };
  130. interface IMailMsgProperties;
  131. //@doc MAILMSG EXTERNAL
  132. /*
  133. @interface IMailMsgPropertyStream | Used by the message object for storing properties in the
  134. store driver.
  135. @meth HRESULT | GetSize | Get the number of bytes in the stream (with async completion).
  136. @meth HRESULT | ReadBlocks | Read a list of blocks from the stream (with async completion).
  137. @meth HRESULT | WriteBlocks | Write a list of blocks to the stream (with async completion).
  138. @meth HRESULT | StartWriteBlocks | Mark the start of a writeblocks transaction.
  139. @meth HRESULT | EndWriteBlocks | Mark the end of a writeblocks transaction.
  140. @meth HRESULT | CancelWriteBlocks | Mark the end of a writeblocks transaction.
  141. Signals that the data isn't complete and should be discarded.
  142. */
  143. [
  144. helpstring("Mail Message Property Stream"),
  145. local, // this interface is local only
  146. object,
  147. pointer_default(unique),
  148. uuid(a44819c0-a7cf-11d1-aa91-00aa006bc80b)
  149. ]
  150. interface IMailMsgPropertyStream : IUnknown
  151. {
  152. //@method HRESULT | IMailMsgPropertyStream | GetSize | Get the number of bytes in the stream (with
  153. // async completion).
  154. //@parm DWORD * | pdwSize | [out] Receives the result. The caller must not change this until the
  155. // operation completes.
  156. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  157. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  158. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  159. //@rvalue S_OK | Success. Operation completed synchronously.
  160. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  161. // with the result of the operation when it completes.
  162. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  163. [helpstring("Get the number of bytes in the stream (with async completion).")]
  164. HRESULT GetSize([in] IMailMsgProperties *pMsg,
  165. [out/*,ptr*/] DWORD *pdwSize,
  166. [in,unique] IMailMsgNotify *pNotify);
  167. //@method HRESULT | IMailMsgPropertyStream | ReadBlocks | Read a list of blocks from the stream (with
  168. // async completion).
  169. //@parm DWORD | dwCount | [in] Specifies the number of blocks.
  170. //@parm DWORD * | pdwOffset | [in,size_is(dwCount),length_is(dwCount),unique] Specifies the list of
  171. // offsets to read from. The caller must not change this list until the operation completes.
  172. //@parm DWORD * | pdwLength | [in,size_is(dwCount),length_is(dwCount),unique] Specifies the list of
  173. // lengths to read. The caller must not change this list until the operation completes.
  174. //@parm BYTE * | ppbBlock | [out] Specifies the buffers to read into. The caller must not change this
  175. // list until the operation completes.
  176. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  177. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  178. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  179. //@rvalue S_OK | Success. The operation completed synchronously.
  180. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  181. // with the result of the operation when it completes.
  182. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  183. [helpstring("Read a list of blocks from the stream (with async completion).")]
  184. HRESULT ReadBlocks([in] IMailMsgProperties *pMsg,
  185. [in] DWORD dwCount,
  186. [in,size_is(dwCount),length_is(dwCount),unique] DWORD *pdwOffset,
  187. [in,size_is(dwCount),length_is(dwCount),unique] DWORD *pdwLength,
  188. [out,size_is(dwCount)] BYTE **ppbBlock,
  189. [in,unique] IMailMsgNotify *pNotify);
  190. //@method HRESULT | IMailMsgPropertyStream | WriteBlocks | Write a list of blocks from the stream
  191. // (with async completion). StartWriteBlocks should always be called before this method is called.
  192. // The last WriteBlocks will be followed by a call to EndWriteBlocks or CancelWriteBlocks.
  193. //@parm DWORD | dwCount | [in] Specifies the number of blocks.
  194. //@parm DWORD * | pdwOffset | [in,size_is(dwCount),length_is(dwCount),unique] Specifies the list of
  195. // offsets to write to. The caller must not change this list until the operation completes.
  196. //@parm DWORD * | pdwLength | [in,size_is(dwCount),length_is(dwCount),unique] Specifies the list of
  197. // lengths to write. The caller must not change this list until the operation completes.
  198. //@parm BYTE * | ppbBlock | [out] Specifes the buffers to write from. The caller must not change this
  199. // list until the operation completes.
  200. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  201. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  202. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  203. //@rvalue S_OK | Success. The operation completed synchronously.
  204. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  205. // with the result of the operation when it completes.
  206. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  207. [helpstring("Write a list of blocks to the stream (with async completion).")]
  208. HRESULT WriteBlocks([in] IMailMsgProperties *pMsg,
  209. [in] DWORD dwCount,
  210. [in,size_is(dwCount),length_is(dwCount),unique] DWORD *pdwOffset,
  211. [in,size_is(dwCount),length_is(dwCount),unique] DWORD *pdwLength,
  212. [in,size_is(dwCount)] BYTE **ppbBlock,
  213. [in,unique] IMailMsgNotify *pNotify);
  214. //@method HRESULT | IMailMsgPropertyStream | StartWriteBlocks | Mark the start of a WriteBlocks
  215. // transaction. Reports information on the quantity and size of blocks the that will be written
  216. // before the next call to EndWriteBlocks.
  217. //@parm DWORD | dwBlocksToWrite | [in] Specifies the number of blocks that will be written write.
  218. //@parm DWORD | dwTotalBytesToWrite | [in] Specifies the sum of the size of all blocks that will
  219. // be written.
  220. //@rvalue S_OK | Success. The operation completed synchronously.
  221. //@xref <om IMailMsgPropertyStream.WriteBlocks> <om IMailMsgPropertyStream.EndWriteBlocks>
  222. [helpstring("Mark the start of a write blocks transaction.")]
  223. HRESULT StartWriteBlocks([in] IMailMsgProperties *pMsg,
  224. [in] DWORD dwBlocksToWrite,
  225. [in] DWORD dwTotalBytesToWrite);
  226. //@method HRESULT | IMailMsgPropertyStream | StartWriteBlocks | Mark the end of a WriteBlocks
  227. // transaction.
  228. //@rvalue S_OK | Success. The operation completed synchronously.
  229. //@xref <om IMailMsgPropertyStream.WriteBlocks> <om IMailMsgPropertyStream.StartWriteBlocks>
  230. [helpstring("Mark the end of a write blocks transaction.")]
  231. HRESULT EndWriteBlocks([in] IMailMsgProperties *pMsg);
  232. //@method HRESULT | IMailMsgPropertyStream | CancelWriteBlocks | Mark the end of a WriteBlocks
  233. // transaction. Signals that the data isn't complete and should be discarded.
  234. //@rvalue S_OK | Success. The operation completed synchronously.
  235. //@xref <om IMailMsgPropertyStream.WriteBlocks> <om IMailMsgPropertyStream.StartWriteBlocks>
  236. [helpstring("Mark the end of a write blocks transaction. Signals that the data isn't complete and should be discarded.")]
  237. HRESULT CancelWriteBlocks([in] IMailMsgProperties *pMsg);
  238. };
  239. //@doc MAILMSG EXTERNAL
  240. /*
  241. @interface IMailMsgRecipientsBase | Base interface for accessing a recipient list.
  242. @meth HRESULT | Count | Get the number of recipients.
  243. @meth HRESULT | Item | Get the name of a recipient.
  244. @meth HRESULT | PutProperty | Write a recipient property.
  245. @meth HRESULT | GetProperty | Read a recipient property.
  246. @meth HRESULT | PutStringA | Write a recipient string property.
  247. @meth HRESULT | GetStringA | Read a recipient string property.
  248. @meth HRESULT | PutStringW | Write a recipient Unicode string property.
  249. @meth HRESULT | GetStringW | Read a recipient Unicode string property.
  250. @meth HRESULT | PutDWORD | Write a recipient DWORD property.
  251. @meth HRESULT | GetDWORD | Read a recipient DWORD property.
  252. @meth HRESULT | PutBool | Write a recipient boolean property.
  253. @meth HRESULT | GetBool | Read a recipient boolean property.
  254. @xref <i IMailMsgRecipients> <i IMailMsgRecipientsAdd>
  255. */
  256. [
  257. helpstring("Mail Message Recipients Base"),
  258. object,
  259. pointer_default(unique),
  260. uuid(d1a97920-a891-11d1-aa91-00aa006bc80b)
  261. ]
  262. interface IMailMsgRecipientsBase : IUnknown
  263. {
  264. //@method HRESULT | IMailMsgRecipientsBase | Count | Get the number of recipients.
  265. //@parm DWORD * | pdwCount | [in] Receives the result.
  266. //@rvalue S_OK | Success.
  267. [helpstring("Get the number of recipients.")]
  268. HRESULT Count([out/*,ptr*/] DWORD *pdwCount);
  269. //@method HRESULT | IMailMsgRecipientsBase | Item | Get the name of a recipient.
  270. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  271. //@parm DWORD | dwWhichName | [in] Specifies which name to get. The possible values
  272. // are ADDRTYPE_SMTP, ADDRTYPE_X400, ADDRTYPE_X500,
  273. // or ADDRTYPE_LEGACY_EX_DN.
  274. //@parm DWORD | cchLength | [in] Specifies the maximum length of the name (including the terminating
  275. // NULL).
  276. //@parm LPSTR | pszName | [out,size_is(cchLength)] Receives the name.
  277. //@rvalue S_OK | Success.
  278. //@rvalue STG_E_UNKNOWN | Failure. The recipient is not present. The name receives NULL.
  279. [helpstring("Get the name of a recipient.")]
  280. HRESULT Item([in] DWORD dwIndex,
  281. [in] DWORD dwWhichName,
  282. [in] DWORD cchLength,
  283. [out,size_is(cchLength)/*,ptr*/] LPSTR pszName);
  284. //@method HRESULT | IMailMsgRecipientsBase | PutProperty | Write a recipient property.
  285. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  286. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  287. //@parm DWORD | cbLength | [in] Specifies the length in bytes of the value. This value should be
  288. // passed in as zero if pbValue is NULL.
  289. //@parm BYTE * | pbValue | [in,size_is(cbLength),length_is(cbLength),unique] Specifies the value.
  290. //@rvalue S_OK | Success.
  291. //@rvalue STG_E_UNKNOWN | Error. The recipient or property was not present.
  292. //@xref <om IMailMsgRecipientsBase.GetProperty>
  293. [helpstring("Write a recipient property.")]
  294. HRESULT PutProperty([in] DWORD dwIndex,
  295. [in] DWORD dwPropID,
  296. [in] DWORD cbLength,
  297. [in,size_is(cbLength),length_is(cbLength),unique] BYTE *pbValue);
  298. //@method HRESULT | IMailMsgRecipientsBase | GetProperty | Read a recipient property.
  299. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  300. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  301. //@parm DWORD | cbLength | [in] Specifies the length in bytes of the buffer to receive the value.
  302. //@parm DWORD * | pcbLength | [out] Receives the length in bytes of the value. If the property is not
  303. // present, this will receive zero.
  304. //@parm BYTE * | pbValue | [out,size_is(cbLength),length_is(*pcbLength)] Receives the value.
  305. //@rvalue S_OK | Success.
  306. //@rvalue STG_E_UNKNOWN | Error. The recipient or property was not present.
  307. //@xref <om IMailMsgRecipientsBase.PutProperty>
  308. [helpstring("Read a recipient property.")]
  309. HRESULT GetProperty([in] DWORD dwIndex,
  310. [in] DWORD dwPropID,
  311. [in] DWORD cbLength,
  312. [out] DWORD *pcbLength,
  313. [out,size_is(cbLength),length_is(*pcbLength)/*,ptr*/] BYTE *pbValue);
  314. //@method HRESULT | IMailMsgRecipientsBase | PutStringA | Write a recipient string property.
  315. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  316. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  317. //@parm LPCSTR | pszValue | [in,unique] Specifies the value.
  318. //@rvalue S_OK | Success.
  319. //@rvalue STG_E_UNKNOWN | Error. The recipient or property was not present.
  320. //@xref <om IMailMsgRecipientsBase.GetStringA>
  321. [helpstring("Write a recipient string property.")]
  322. HRESULT PutStringA([in] DWORD dwIndex,
  323. [in] DWORD dwPropID,
  324. [in,unique] LPCSTR pszValue);
  325. //@method HRESULT | IMailMsgRecipientsBase | GetStringA | Read a recipient string property.
  326. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  327. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  328. //@parm DWORD | cchLength | [in] Specifies the length in characters (including the terminating NULL)
  329. // of the buffer to receive the value.
  330. //@parm LPCSTR | pszValue | [out,size_is(cchLength)] Receives the value.
  331. //@rvalue S_OK | Success.
  332. //@rvalue STG_E_UNKNOWN | Error. The recipient or property was not present.
  333. //@xref <om IMailMsgRecipientsBase.PutStringA>
  334. [helpstring("Read a recipient string property.")]
  335. HRESULT GetStringA([in] DWORD dwIndex,
  336. [in] DWORD dwPropID,
  337. [in] DWORD cchLength,
  338. [out,size_is(cchLength)/*,ptr*/] LPSTR pszValue);
  339. //@method HRESULT | IMailMsgRecipientsBase | PutStringW | Write a recipient Unicode string property.
  340. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  341. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  342. //@parm LPCWSTR | pszValue | [in,unique] Specifies the value.
  343. //@rvalue S_OK | Success.
  344. //@rvalue STG_E_UNKNOWN | Error. The recipient or property was not present.
  345. //@xref <om IMailMsgRecipientsBase.GetStringW>
  346. [helpstring("Write a recipient Unicode string property.")]
  347. HRESULT PutStringW([in] DWORD dwIndex,
  348. [in] DWORD dwPropID,
  349. [in,unique] LPCWSTR pszValue);
  350. //@method HRESULT | IMailMsgRecipientsBase | GetStringW | Read a recipient Unicode string property.
  351. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  352. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  353. //@parm DWORD | cchLength | [in] Specifies the length in characters (including the terminating NULL)
  354. // of the buffer to receive the value.
  355. //@parm LPCSTR | pszValue | [out,size_is(cchLength)] Receives the value.
  356. //@rvalue S_OK | Success.
  357. //@rvalue STG_E_UNKNOWN | Error. The recipient or property was not present.
  358. //@xref <om IMailMsgRecipientsBase.PutStringW>
  359. [helpstring("Read a recipient Unicode string property.")]
  360. HRESULT GetStringW([in] DWORD dwIndex,
  361. [in] DWORD dwPropID,
  362. [in] DWORD cchLength,
  363. [out,size_is(cchLength)/*,ptr*/] LPWSTR pszValue);
  364. //@method HRESULT | IMailMsgRecipientsBase | PutDWORD | Write a recipient DWORD property.
  365. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  366. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  367. //@parm DWORD | dwValue | [in] The value to write.
  368. //@rvalue S_OK | Success.
  369. //@rvalue STG_E_UNKNOWN | Error. The recipient or property was not present.
  370. //@xref <om IMailMsgRecipientsBase.GetDWORD>
  371. [helpstring("Write a recipient DWORD property.")]
  372. HRESULT PutDWORD([in] DWORD dwIndex,
  373. [in] DWORD dwPropID,
  374. [in] DWORD dwValue);
  375. //@method HRESULT | IMailMsgRecipientsBase | GetDWORD | Read a recipient DWORD property.
  376. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  377. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  378. //@parm DWORD * | pdwValue | [out] Receives the value. If the property is not present, the method
  379. // sets this to zero and returns S_FALSE.
  380. //@rvalue S_OK | Success.
  381. //@rvalue STG_E_UNKNOWN | Error. The recipient or property was not present.
  382. //@xref <om IMailMsgRecipientsBase.PutDWORD>
  383. [helpstring("Read a recipient DWORD property.")]
  384. HRESULT GetDWORD([in] DWORD dwIndex,
  385. [in] DWORD dwPropID,
  386. [out/*,ptr*/] DWORD *pdwValue);
  387. //@method HRESULT | IMailMsgRecipientsBase | PutBool | Write a recipient boolean property.
  388. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  389. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  390. //@parm DWORD | dwValue | [in] The value to write. This value is coerced to either TRUE or FALSE.
  391. //@rvalue S_OK | Success.
  392. //@rvalue STG_E_UNKNOWN | Error. The recipient or property was not present.
  393. //@xref <om IMailMsgRecipientsBase.GetBool>
  394. [helpstring("Write a recipient boolean property.")]
  395. HRESULT PutBool([in] DWORD dwIndex,
  396. [in] DWORD dwPropID,
  397. [in] DWORD dwValue);
  398. //@method HRESULT | IMailMsgRecipientsBase | GetBool | Read a recipient boolean property.
  399. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient.
  400. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  401. //@parm DWORD * | pdwValue | [out] Receives the value, which will either be TRUE or FALSE. If the
  402. // property is not present, the method sets this to FALSE and returns S_FALSE.
  403. //@rvalue S_OK | Success.
  404. //@rvalue STG_E_UNKNOWN | Error. The recipient or property was not present.
  405. //@xref <om IMailMsgRecipientsBase.PutBool>
  406. [helpstring("Read a recipient boolean property.")]
  407. HRESULT GetBool([in] DWORD dwIndex,
  408. [in] DWORD dwPropID,
  409. [out/*,ptr*/] DWORD *pdwValue);
  410. };
  411. /*
  412. @interface IMailMsgRecipientsAdd | Interface for adding to a recipient list.
  413. @meth HRESULT | AddPrimary | Add a primary recipient (overwrite duplicates).
  414. @meth HRESULT | AddSecondary | Add a secondary recipient (reject duplicates).
  415. @xref <i IMailMsgRecipientsBase>
  416. */
  417. [
  418. helpstring("Mail Message Recipients Add"),
  419. object,
  420. pointer_default(unique),
  421. uuid(4c28a700-a892-11d1-aa91-00aa006bc80b)
  422. ]
  423. interface IMailMsgRecipientsAdd : IMailMsgRecipientsBase
  424. {
  425. //@method HRESULT | IMailMsgRecipientsAdd | AddPrimary | Add a primary recipient (overwrite
  426. // duplicates).
  427. //@parm DWORD | dwCount | [in] Specifies the number of recipient names.
  428. //@parm LPCSTR * | ppszNames | [in,size_is(dwCount)] Specifies the recipient names.
  429. //@parm DWORD * | pdwPropIDs | [in,size_is(dwCount)] Specifies the property ID's of the names.
  430. // These can be ADDRTYPE_SMTP, ADDRTYPE_X400, ADDRTYPE_X500,
  431. // or ADDRTYPE_LEGACY_EX_DN. Duplicates are not allowed.
  432. //@parm DWORD * | pdwIndex | [out] Receives the zero-based index of the recipient.
  433. //@parm IMailMsgRecipientsBase * | pFrom | [in,unique] Specifies the recipient list from which to copy
  434. // properties. If this value is NULL, then no properties will be copied. Names will only be copied
  435. // if the new reciepent has 0 names. The FLAG_RECIPIENT_DO_NOT_DELIVER
  436. // and FLAG_RECIPIENT_NO_NAME_COLLISIONS flags in the
  437. // IMMPID_RP_RECEIPIENT_FLAGS property are not copied
  438. //@parm DWORD | dwFrom | [in] Specifies the zero-based index of the recipient from which to copy
  439. // properties. This value is ignored if pFrom is NULL.
  440. //@rvalue S_OK | Success.
  441. //@rvalue S_FALSE | Success. The recipient is a duplicate of one already in the list.
  442. //@xref <i IMailMsgRecipientsBase> <om IMailMsgRecipientsAdd.AddSecondary>
  443. [helpstring("Add a primary recipient (overwrite duplicates)."),local]
  444. HRESULT AddPrimary([in] DWORD dwCount,
  445. [in,size_is(dwCount)] LPCSTR *ppszNames,
  446. [in,size_is(dwCount)] DWORD *pdwPropIDs,
  447. [out/*,ptr*/] DWORD *pdwIndex,
  448. [in,unique] IMailMsgRecipientsBase *pFrom,
  449. [in] DWORD dwFrom);
  450. //@method HRESULT | IMailMsgRecipientsAdd | AddSecondary | Add a secondary recipient (reject
  451. // duplicates).
  452. //@parm DWORD | dwCount | [in] Specifies the number of recipient names.
  453. //@parm LPCSTR * | ppszNames | [in,size_is(dwCount)] Specifies the recipient names.
  454. //@parm DWORD * | pdwPropIDs | [in,size_is(dwCount)] Specifies the property ID's of the names.
  455. //@parm DWORD * | pdwIndex | [out] Receives the zero-based index of the recipient.
  456. //@parm IMailMsgRecipientsBase * | pFrom | [in,unique] Specifies the recipient list from which to copy
  457. // properties. If this value is NULL, then no properties will be copied. Names will only be copied
  458. // if the new reciepent has 0 names. The FLAG_RECIPIENT_DO_NOT_DELIVER and
  459. // FLAG_RECIPIENT_NO_NAME_COLLISIONS flags in the
  460. // IMMPID_RP_RECEIPIENT_FLAGS property are not copied
  461. //@parm DWORD | dwFrom | [in] Specifies the zero-based index of the recipient from which to copy
  462. // properties. This value is ignored if pFrom is NULL.
  463. //@rvalue S_OK | Success.
  464. //@rvalue MAILMSG_E_DUPLICATE | Failure, the recipient is a duplicate of one already in the list.
  465. //@xref <i IMailMsgRecipientsBase> <om IMailMsgRecipientsAdd.AddSecondary>
  466. [helpstring("Add a secondary recipient (reject duplicates)."),local]
  467. HRESULT AddSecondary([in] DWORD dwCount,
  468. [in,size_is(dwCount)] LPCSTR *ppszNames,
  469. [in,size_is(dwCount)] DWORD *pdwPropIDs,
  470. [out/*,ptr*/] DWORD *pdwIndex,
  471. [in,unique] IMailMsgRecipientsBase *pFrom,
  472. [in] DWORD dwFrom);
  473. };
  474. /*
  475. @interface IMailMsgRecipients | Interface for accessing a recipient list.
  476. @meth HRESULT | Commit | Commit all changes to a recipient to disk (with async completion).
  477. @meth HRESULT | DomainCount | Get the count of the domains.
  478. @meth HRESULT | DomainItem | Get information about one domain.
  479. @meth HRESULT | AllocNewList | Create a new recipient list.
  480. @meth HRESULT | WriteList | Write the new recipient list.
  481. @xref <i IMailMsgRecipientsBase>
  482. */
  483. [
  484. helpstring("Mail Message Recipients"),
  485. object,
  486. pointer_default(unique),
  487. uuid(19507fe0-a892-11d1-aa91-00aa006bc80b)
  488. ]
  489. interface IMailMsgRecipients : IMailMsgRecipientsBase
  490. {
  491. //@method HRESULT | IMailMsgRecipients | Commit | Commit all changes to a recipient to disk (with
  492. // async completion).
  493. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the recipient to commit.
  494. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  495. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  496. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  497. //@rvalue S_OK | Success. The operation completed synchronously.
  498. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  499. // with the result of the operation when it completes.
  500. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  501. [helpstring("Commit all changes to a recipient to disk (with async completion).")]
  502. HRESULT Commit([in] DWORD dwIndex,
  503. [in,unique] IMailMsgNotify *pNotify);
  504. //@method HRESULT | IMailMsgRecipients | DomainCount | Get the count of the domains.
  505. //@parm DWORD * | pdwCount | [out] Receives the result.
  506. //@rvalue S_OK | Success.
  507. [helpstring("Get the count of the domains.")]
  508. HRESULT DomainCount([out/*,ptr*/] DWORD *pdwCount);
  509. //@method HRESULT | IMailMsgRecipients | DomainItem | Get information about one domain.
  510. //@parm DWORD | dwIndex | [in] Specifies the zero-based index of the domain.
  511. //@parm DWORD | cchLength | [in] Specifies the length in characters (including the terminating NULL)
  512. // of the buffer to receive the domain name.
  513. //@parm LPSTR | pszDomain | [out,size_is(cchLength)] Receives the domain name. This may be NULL.
  514. //@parm DWORD * | pdwRecipientIndex | [out] Receives the index of the first recipient in the domain. This may be NULL.
  515. //@parm DWORD * | pdwRecipientCount | [out] Recieves the count of the recipients in the domain. This may be NULL.
  516. //@rvalue S_OK | Success.
  517. //@rvalue STG_E_NOMOREFILES | Failure. The domain is not present. The name receives NULL, and the
  518. // index and count receive zero.
  519. [helpstring("Get information about one domain.")]
  520. HRESULT DomainItem([in] DWORD dwIndex,
  521. [in] DWORD cchLength,
  522. [out,size_is(cchLength)/*,ptr*/] LPSTR pszDomain,
  523. [out/*,ptr*/] DWORD *pdwRecipientIndex,
  524. [out/*,ptr*/] DWORD *pdwRecipientCount);
  525. //@method HRESULT | IMailMsgRecipients | AllocNewList | Create a new recipient list.
  526. //@parm IMailMsgRecipientsAdd ** | ppNewList | [out] Receives the new list.
  527. //@rvalue S_OK | Success.
  528. //@xref <om IMailMsgRecipients.WriteList>
  529. [helpstring("Create a new recipient list.")]
  530. HRESULT AllocNewList([out/*,ptr*/] IMailMsgRecipientsAdd **ppNewList);
  531. //@method HRESULT | IMailMsgRecipients | WriteList | Write the new recipient list.
  532. // IMailMsgProperties::Commit must be called after this method in order to commit the new recipient
  533. // list to disk.
  534. //@parm IMailMsgPropertiesAdd * | pNewList | [in] Specifies the new list.
  535. //@rvalue S_OK | Success.
  536. //@xref <om IMailMsgRecipients.AllocNewList> <om IMailMsgProperties.Commit>
  537. [helpstring("Write the new recipient list.")]
  538. HRESULT WriteList([in,unique] IMailMsgRecipientsAdd *pNewList);
  539. //@method HRESULT | IMailMsgRecipients | SetNextDomain | Link a domain after another.
  540. //@parm DWORD | dwDomainIndex | [in] Specifies the zero-based index of the source domain.
  541. //@parm DWORD | dwNextDomainIndex | [in] Specifies the index of the domain to link after the source domain.
  542. //@parm DWORD | dwFlags | [in] Specifies any optional flags. Flags may be any combination
  543. // of FLAG_FAIL_IF_SOURCE_DOMAIN_LINKED or FLAG_FAIL_IF_TARGET_DOMAIN_LINKED. FLAG_OVERWRITE_EXISTING_LINKS
  544. // may also be specified, but not in conjunction with the others.
  545. // If FLAG_SET_FIRST_DOMAIN is set, this domain will be set as the first domain in a domain list (the next
  546. // domain link for dwDomainIndex will be destroyed).
  547. //@rvalue S_OK | Success.
  548. //@rvalue E_INVALIDARG | Failure. One or more arguments are invalid
  549. //@rvalue E_FAIL | Failure. The result contradicts with one or more of the flags.
  550. [helpstring("Set the next domain in a recipient filter context.")]
  551. HRESULT SetNextDomain(
  552. [in] DWORD dwDomainIndex,
  553. [in] DWORD dwNextDomainIndex,
  554. [in] DWORD dwFlags);
  555. //@method HRESULT | IMailMsgRecipients | InitializeRecipientFilterContext | Initialize
  556. // a recipient filter context against a chain of domain. Filter is based on comparing
  557. // a set of filter flags against the IMMPID_RP_STATUS_FLAGS property.
  558. //@parm LPRECIPIENT_FILTER_CONTEXT | pContext | [in,unique] Specifies the context variable to
  559. // be initialized. This context must be allocated by the caller.
  560. //@parm DWORD | dwStartingDomain | [in] Specifies the starting domain index.
  561. //@parm DWORD | dwFilterMask | [in] Specifies the filter mask. This mask will mask out
  562. // the bits of interest in IMMPID_RP_STATUS_FLAGS before checking the filter flags.
  563. //@parm DWORD | dwFilterFlags | [in] Specifies the filter flags. These flags are
  564. // compared against the result of the mask, and an exact match is required.
  565. //@rvalue S_OK | Success.
  566. //@rvalue E_INVALIDARG | Failure. One or more arguments are invalid
  567. //@rvalue E_POINTER | Failure. The context passed in is NULL.
  568. [helpstring("Initialze a recipient filter context.")]
  569. HRESULT InitializeRecipientFilterContext(
  570. [in,unique] LPRECIPIENT_FILTER_CONTEXT pContext,
  571. [in] DWORD dwStartingDomain,
  572. [in] DWORD dwFilterFlags,
  573. [in] DWORD dwFilterMask);
  574. //@method HRESULT | IMailMsgRecipients | TerminateRecipientFilterContext | Terminates
  575. // a recipient filter context.
  576. //@parm LPRECIPIENT_FILTER_CONTEXT | pContext | [in,unique] Specifies the context variable to
  577. // be terminated.
  578. //@rvalue S_OK | Success.
  579. //@rvalue E_POINTER | Failure. The context passed in is NULL.
  580. [helpstring("Terminate a recipient filter context.")]
  581. HRESULT TerminateRecipientFilterContext(
  582. [in,unique] LPRECIPIENT_FILTER_CONTEXT pContext);
  583. //@method HRESULT | IMailMsgRecipients | GetNextRecipient | Returns the next recipient
  584. // in the chain of domains that match the filtering criteria set for the filter context.
  585. //@parm LPRECIPIENT_FILTER_CONTEXT | pContext | [in,unique] Specifies the filter context. This
  586. // must be previously initialized by InitializeRecipientFilterContext.
  587. //@parm DWORD * | pdwRecipientIndex | [out] Receives the next recipient with matching
  588. // criteria.
  589. //@rvalue S_OK | Success.
  590. //@rvalue HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS) | No more recipients match the criteria.
  591. //@rvalue HRESULT_FROM_WIN32(ERROR_INVALID_DATA) | The context specified is invalid.
  592. //@rvalue E_INVALIDARG | Failure. One or more arguments are invalid
  593. //@rvalue E_POINTER | Failure. The context passed in is NULL.
  594. [helpstring("Get the next domain in a recipient filter context.")]
  595. HRESULT GetNextRecipient(
  596. [in,unique] LPRECIPIENT_FILTER_CONTEXT pContext,
  597. [out] DWORD *pdwRecipientIndex);
  598. };
  599. /*
  600. @interface IMailMsgProperties | Interface for accessing properties of an Mail Message Object.
  601. @meth HRESULT | PutProperty | Write a property.
  602. @meth HRESULT | GetProperty | Read a property.
  603. @meth HRESULT | Commit | Commit all changes to disk (with async completion).
  604. @meth HRESULT | PutStringA | Write a string property.
  605. @meth HRESULT | GetStringA | Read a string property.
  606. @meth HRESULT | PutStringW | Write a Unicode string property.
  607. @meth HRESULT | GetStringW | Read a Unicode string property.
  608. @meth HRESULT | PutDWORD | Write a DWORD property.
  609. @meth HRESULT | GetDWORD | Read a DWORD property.
  610. @meth HRESULT | PutBool | Write a boolean property.
  611. @meth HRESULT | GetBool | Read a boolean property.
  612. @meth HRESULT | GetContentSize | Get the size of the content (with async completion).
  613. @meth HRESULT | ReadContent | Read the content (with async completion).
  614. @meth HRESULT | WriteContent | Write the content (with async completion).
  615. @meth HRESULT | CopyContentToFile | Copy the content to a file (with async completion).
  616. @meth HRESULT | CopyContentToFileEx | Copy the content to a file (with async completion).
  617. // @meth HRESULT | CopyContentToStream | Copy the content to a stram (with async completion).
  618. @meth HRESULT | ForkForRecipients | Create a new Mail Message Object for different recipients.
  619. @meth HRESULT | RebindAfterFork | Allocates backing store and binds a forked message.
  620. @meth HRESULT | SetContentSize | Set the size of the content (with async completion).
  621. @meth HRESULT | MapContent | Memory map the content
  622. @meth HRESULT | UnmapContent | Release memory mapped content
  623. */
  624. [
  625. helpstring("Mail Message Properties"),
  626. local,
  627. object,
  628. pointer_default(unique),
  629. uuid(ab95fb40-a34f-11d1-aa8a-00aa006bc80b)
  630. ]
  631. interface IMailMsgProperties : IUnknown
  632. {
  633. //@method HRESULT | IMailMsgProperties | PutProperty | Write a property.
  634. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  635. //@parm DWORD | cbLength | [in] Specifies the length in bytes of the value.
  636. //@parm BYTE * | pbValue | [in,size_is(cbLength),length_is(cbLength),unique] Specifies the value.
  637. //@rvalue S_OK | Success.
  638. //@rvalue STG_E_UNKNOWN | Error. The property was not present.
  639. //@xref <om IMailMsgProperties.GetProperty>
  640. [helpstring("Write a property.")]
  641. HRESULT PutProperty([in] DWORD dwPropID,
  642. [in] DWORD cbLength,
  643. [in,size_is(cbLength),length_is(cbLength),unique] BYTE *pbValue);
  644. //@method HRESULT | IMailMsgProperties | GetProperty | Read a property.
  645. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  646. //@parm DWORD | cbLength | [in] Specifies the length in bytes of the buffer to receive the value.
  647. //@parm DWORD * | pcbLength | [out] Receives the length in bytes of the value. This is set to zero if
  648. // the property is not present.
  649. //@parm BYTE * | pbValue | [out,size_is(cbLength),length_is(*pcbLength)] Receives the value.
  650. //@rvalue S_OK | Success.
  651. //@rvalue STG_E_UNKNOWN | Error. The property was not present. *pcbLength is set to zero.
  652. //@xref <om IMailMsgProperties.PutProperty>
  653. [helpstring("Read a property.")]
  654. HRESULT GetProperty([in] DWORD dwPropID,
  655. [in] DWORD cbLength,
  656. [out] DWORD *pcbLength,
  657. [out,size_is(cbLength),length_is(*pcbLength)/*,ptr*/] BYTE *pbValue);
  658. //@method HRESULT | IMailMsgProperties | Commit | Commit all changes to disk (with async completion).
  659. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  660. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  661. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  662. //@rvalue S_OK | Success. The operation completed synchronously.
  663. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  664. // with the result of the operation when it completes.
  665. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  666. [helpstring("Commit all changes to disk (with async completion).")]
  667. HRESULT Commit([in,unique] IMailMsgNotify *pNotify);
  668. //@method HRESULT | IMailMsgProperties | PutStringA | Write a string property.
  669. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  670. //@parm LPCSTR | pszValue | [in,unique] Specifies the value.
  671. //@rvalue S_OK | Success.
  672. //@rvalue STG_E_UNKNOWN | Error. The property was not present.
  673. //@xref <om IMailMsgProperties.GetStringA>
  674. [helpstring("Write a string property.")]
  675. HRESULT PutStringA([in] DWORD dwPropID,
  676. [in,unique] LPCSTR pszValue);
  677. //@method HRESULT | IMailMsgProperties | GetStringA | Read a string property.
  678. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  679. //@parm DWORD | cchLength | [in] Specifies the length in characters (including the terminating NULL)
  680. // of the buffer to receive the value.
  681. //@parm LPSTR | pszValue | [out,size_is(cchLength)] Receives the value.
  682. //@rvalue S_OK | Success.
  683. //@rvalue STG_E_UNKNOWN | Error. The property was not present. The value receives NULL.
  684. //@xref <om IMailMsgProperties.PutStringA>
  685. [helpstring("Read a string property.")]
  686. HRESULT GetStringA([in] DWORD dwPropID,
  687. [in] DWORD cchLength,
  688. [out,size_is(cchLength)/*,ptr*/] LPSTR pszValue);
  689. //@method HRESULT | IMailMsgProperties | PutStringW | Write a Unicode string property.
  690. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  691. //@parm LPCWSTR | pszValue | [in,unique] Specifies the value.
  692. //@rvalue S_OK | Success.
  693. //@rvalue STG_E_UNKNOWN | Error. The property was not present.
  694. //@xref <om IMailMsgProperties.GetStringW>
  695. [helpstring("Write a Unicode string property.")]
  696. HRESULT PutStringW([in] DWORD dwPropID,
  697. [in,unique] LPCWSTR pszValue);
  698. //@method HRESULT | IMailMsgProperties | GetStringW | Read a Unicode string property.
  699. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  700. //@parm DWORD | cchLength | [in] Specifies the length in characters (including the terminating NULL)
  701. // of the buffer to receive the value.
  702. //@parm LPCSTR | pszValue | [out,size_is(cchLength)] Receives the value.
  703. //@rvalue S_OK | Success.
  704. //@rvalue STG_E_UNKNOWN | Error. The property was not present. The value receives NULL.
  705. //@xref <om IMailMsgProperties.PutStringW>
  706. [helpstring("Read a Unicode string property.")]
  707. HRESULT GetStringW([in] DWORD dwPropID,
  708. [in] DWORD cchLength,
  709. [out,size_is(cchLength)/*,ptr*/] LPWSTR pszValue);
  710. //@method HRESULT | IMailMsgProperties | PutDWORD | Write a DWORD property.
  711. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  712. //@parm DWORD | dwValue | [in] The value to write.
  713. //@rvalue S_OK | Success.
  714. //@rvalue STG_E_UNKNOWN | Error. The property was not present.
  715. //@xref <om IMailMsgProperties.GetDWORD>
  716. [helpstring("Write a DWORD property.")]
  717. HRESULT PutDWORD([in] DWORD dwPropID,
  718. [in] DWORD dwValue);
  719. //@method HRESULT | IMailMsgProperties | GetDWORD | Read a DWORD property.
  720. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  721. //@parm DWORD * | pdwValue | [out] Receives the value. If the property is not present, the method
  722. // sets this to zero and returns STG_E_UNKNOWN.
  723. //@rvalue S_OK | Success.
  724. //@rvalue STG_E_UNKNOWN | Error. The property was not present. *pdwValue is set to zero.
  725. //@xref <om IMailMsgProperties.PutDWORD>
  726. [helpstring("Read a DWORD property.")]
  727. HRESULT GetDWORD([in] DWORD dwPropID,
  728. [out/*,ptr*/] DWORD *pdwValue);
  729. //@method HRESULT | IMailMsgProperties | PutBool | Write a boolean property.
  730. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  731. //@parm DWORD | dwValue | [in] The value to write. This value is coerced to either TRUE or FALSE.
  732. //@rvalue S_OK | Success.
  733. //@rvalue STG_E_UNKNOWN | Error. The property was not present.
  734. //@xref <om IMailMsgProperties.GetBool>
  735. [helpstring("Write a boolean property.")]
  736. HRESULT PutBool([in] DWORD dwPropID,
  737. [in] DWORD bValue);
  738. //@method HRESULT | IMailMsgProperties | GetBool | Read a boolean property.
  739. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  740. //@parm DWORD * | pdwValue | [out] Receives the value, which will either be TRUE or FALSE. If the
  741. // property is not present, the method sets this to FALSE and returns STG_E_UNKNOWN.
  742. //@rvalue S_OK | Success.
  743. //@rvalue STG_E_UNKNOWN | Error. The property was not present or recipient was not present.
  744. //@xref <om IMailMsgProperties.PutBool>
  745. [helpstring("Read a boolean property.")]
  746. HRESULT GetBool([in] DWORD dwPropID,
  747. [out/*,ptr*/] DWORD *pbValue);
  748. //@method HRESULT | IMailMsgProperties | GetContentSize | Get the size of the content (with async
  749. // completion).
  750. //@parm DWORD * | pdwSize | [out] Receives the result.
  751. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  752. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  753. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  754. //@rvalue S_OK | Success. The operation completed synchronously.
  755. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  756. // with the result of the operation when it completes.
  757. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  758. [helpstring("Get the size of the content.")]
  759. HRESULT GetContentSize([out/*,ptr*/] DWORD *pdwSize,
  760. [in,unique] IMailMsgNotify *pNotify);
  761. //@method HRESULT | IMailMsgProperties | ReadContent | Read the content (with async completion).
  762. //@parm DWORD | dwOffset | [in] Specifies the offset to read from.
  763. //@parm DWORD | dwLength | [in] Specifies the length in bytes to read.
  764. //@parm DWORD * | pdwLength | [out] Receives the number of bytes read.
  765. //@parm BYTE * | pbBlock | [out,size_is(dwLength),length_is(*pdwLength)] Receives the result.
  766. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  767. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  768. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  769. //@rvalue S_OK | Success. The operation completed synchronously.
  770. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  771. // with the result of the operation when it completes.
  772. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  773. [helpstring("Read the content (with async completion).")]
  774. HRESULT ReadContent([in] DWORD dwOffset,
  775. [in] DWORD dwLength,
  776. [out] DWORD *pdwLength,
  777. [out,size_is(dwLength),length_is(*pdwLength)] BYTE *pbBlock,
  778. [in] IMailMsgNotify *pNotify);
  779. //@method HRESULT | IMailMsgProperties | WriteContent | Write the content (with async completion).
  780. //@parm DWORD | dwOffset | [in] Specifies the offset to write to.
  781. //@parm DWORD | dwLength | [in] Specifies the length in bytes to write.
  782. //@parm DWORD * | pdwLength | [out] Receives the number of bytes written.
  783. //@parm BYTE * | pbBlock | [out,size_is(dwLength),length_is(*pdwLength)] Data to write.
  784. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  785. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  786. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  787. //@rvalue S_OK | Success. The operation completed synchronously.
  788. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  789. // with the result of the operation when it completes.
  790. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  791. [helpstring("Write the content (with async completion).")]
  792. HRESULT WriteContent([in] DWORD dwOffset,
  793. [in] DWORD dwLength,
  794. [out] DWORD *pdwLength,
  795. [in,size_is(dwLength),length_is(*pdwLength)] BYTE *pbBlock,
  796. [in] IMailMsgNotify *pNotify);
  797. //@method HRESULT | IMailMsgProperties | CopyContentToFile | Copy the content to a file (with async
  798. // completion).
  799. //@parm PFIO_CONTEXT | pFIOCopy | [in] Specifies the file to copy to.
  800. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  801. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  802. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  803. //@rvalue S_OK | Success. The operation completed synchronously.
  804. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  805. // with the result of the operation when it completes.
  806. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  807. [helpstring("Copy the content to a file (with async completion)."),local]
  808. HRESULT CopyContentToFile([in] PFIO_CONTEXT pFIOCopy,
  809. [in,unique] IMailMsgNotify *pNotify);
  810. //@method HRESULT | IMailMsgProperties | CopyContentToFileEx | Copy the content to a file (with async
  811. // completion).
  812. //@parm PFIO_CONTEXT | pFIOCopy | [in] Specifies the file to copy to.
  813. //@parm BOOL | fDotStuffed | [in] Specify if the pFIOCopy should contain dot stuffed data
  814. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  815. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  816. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  817. //@rvalue S_OK | Success. The operation completed synchronously.
  818. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  819. // with the result of the operation when it completes.
  820. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  821. [helpstring("Copy the content to a file (with async completion)."),local]
  822. HRESULT CopyContentToFileEx([in] PFIO_CONTEXT pFIOCopy,
  823. [in] BOOL fDotStuffed,
  824. [in,unique] IMailMsgNotify *pNotify);
  825. #if 0
  826. //@method HRESULT | IMailMsgProperties | CopyContentToStream | Copy the content to a stream (with
  827. // async completion).
  828. //@parm IMailMsgPropertyStream * | pStream | [in] Specifies the stream to copy to.
  829. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  830. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  831. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  832. //@rvalue S_OK | Success. The operation completed synchronously.
  833. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  834. // with the result of the operation when it completes.
  835. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  836. [helpstring("Copy the content to a stream (with async completion).")]
  837. HRESULT CopyContentToStream([in,unique] IMailMsgPropertyStream *pStream,
  838. [in,unique] IMailMsgNotify *pNotify);
  839. #endif
  840. //@method HRESULT | IMailMsgProperties | ForkForRecipients | Create a new Mail Message Object for
  841. // different recipients.
  842. //@parm IMailMsgProperties ** | ppNewMessage | [out,unique] Receives the new message object.
  843. //@parm IMailMsgRecipientsAdd ** | ppRecipients | [out,unique] Receives the new interface for adding
  844. // recipients.
  845. //@rvalue S_OK | Success.
  846. //@xref <i IMailMsgRecipientsAdd>
  847. [helpstring("Create a new Mail Message Object for different recipients.")]
  848. HRESULT ForkForRecipients([out,unique] IMailMsgProperties **ppNewMessage,
  849. [out,unique] IMailMsgRecipientsAdd **ppRecipients);
  850. //@method HRESULT | IMailMsgProperties | CopyContentToFileAtOffset | Copy the content to a file at a given
  851. //offset (with async completion).
  852. //@parm PFIO_CONTEXT | pFIOCopy | [in] Specifies the file to copy to.
  853. //@parm DWORD | dwOffset | [in] Specifies the offset of the file to copy to.
  854. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  855. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  856. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  857. //@rvalue S_OK | Success. The operation completed synchronously.
  858. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  859. // with the result of the operation when it completes.
  860. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  861. [helpstring("Copy the content to a file at a given offset (with async completion)."),local]
  862. HRESULT CopyContentToFileAtOffset([in] PFIO_CONTEXT pFIOCopy,
  863. [in] DWORD dwOffset,
  864. [in,unique] IMailMsgNotify *pNotify);
  865. //@method HRESULT | IMailMsgProperties | RebindAfterFork | Allocates backing store for a forked object,
  866. // and binds the message to the storage. The caller may select to use either the same store driver as
  867. // the original message, or any specific store driver.
  868. //@parm IMailMsgProperties * | pOriginalMsg | [in] Speciifies the original message object from which to
  869. // copy the message content.
  870. //@parm IUnknown * | pStoreDriver | [in] Specifies a store driver from which to allocate
  871. // backing store. If NULL, the store driver of the original message is used.
  872. //@rvalue S_OK | Success.
  873. //@xref <i IMailMsgRecipientsAdd>
  874. [helpstring("Allocates backing store and binds a forked message.")]
  875. HRESULT RebindAfterFork([in] IMailMsgProperties *pOriginalMsg,
  876. [in] IUnknown *pStoreDriver);
  877. //@method HRESULT | IMailMsgProperties | SetContentSize | Get the size of the content (with async
  878. // completion).
  879. //@parm DWORD | dwSize | [out] Receives the result.
  880. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  881. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  882. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  883. //@rvalue S_OK | Success. The operation completed synchronously.
  884. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  885. // with the result of the operation when it completes.
  886. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  887. [helpstring("Get the size of the content.")]
  888. HRESULT SetContentSize([in] DWORD dwSize,
  889. [in,unique] IMailMsgNotify *pNotify);
  890. //@method HRESULT | IMailMsgProperties | MapContent | Map the content
  891. // of the message to a pointer.
  892. //@parm BOOL | fWrite | [in] Write access?
  893. //@parm BYTE ** | ppbContent | [in] Pointer to receive the pointer to
  894. // the content.
  895. //@parm BYTE ** | pcContent | [in] Pointer to receive the size of the
  896. // content.
  897. //@rvalue S_OK | Success. The operation completed synchronously.
  898. //@xref <i IMailMsgProperties> <om IMailMsgPropeties.UnmapContent>
  899. [helpstring("Memory map the content to a pointer.")]
  900. HRESULT MapContent([in] BOOL fWrite,
  901. [in] BYTE **ppbContent,
  902. [in] DWORD *pcContent);
  903. //@method HRESULT | IMailMsgProperties | UnmapContent | Unmap memory
  904. // mapped content
  905. //@parm BYTE * | ppbContent | [in] Pointer to the content (acquired
  906. // via MapContent)
  907. //@rvalue S_OK | Success. The operation completed synchronously.
  908. //@xref <i IMailMsgProperties> <om IMailMsgPropeties.MapContent>
  909. [helpstring("Unmap the message contents.")]
  910. HRESULT UnmapContent([in] BYTE *pbContent);
  911. };
  912. /*
  913. @interface IMailMsgCommit | Optional store driver supplied interface
  914. that is called to commit the message data. If the store driver
  915. doesn't support this interface then FlushFileBuffers is called on
  916. the PFIO_CONTEXT's handle.
  917. @meth HRESULT | BeginCommit | Called at the start of
  918. IMailMsgProperties::Commit.
  919. @meth HRESULT | EndCommit | Called at the end of
  920. IMailMsgProperties::Commit (after all StartWriteBlocks / WriteBlocks /
  921. EndWriteBlocks calls).
  922. */
  923. [
  924. helpstring("Mail Message Commit"),
  925. local,
  926. object,
  927. pointer_default(unique),
  928. uuid(02B80EDB-6D5A-4d05-950A-237811F8D412)
  929. ]
  930. interface IMailMsgCommit : IUnknown
  931. {
  932. //@method HRESULT | IMailMsgCommit | BeginCommit |
  933. // Called at the start of IMailMsgProperties::Commit.
  934. //@parm IMailMsgPropertyStream | pStream | [in] Specifies the stream.
  935. //@parm PFIO_CONTEXT | pFIOContext | [in] Specifies the content.
  936. //@rvalue S_OK | Success.
  937. //@rvalue other | Error.
  938. [helpstring("Start commit operation")]
  939. HRESULT BeginCommit([in] IMailMsgProperties *pMsg,
  940. [in] IMailMsgPropertyStream *pStream,
  941. [in] PFIO_CONTEXT pFIO);
  942. //@method HRESULT | IMailMsgCommit | EndCommit |
  943. // Called at the end of IMailMsgProperties::Commit.
  944. //@parm IMailMsgPropertyStream | pStream | [in] Specifies the stream.
  945. //@parm PFIO_CONTEXT | pFIOContext | [in] Specifies the content.
  946. //@rvalue S_OK | Success.
  947. //@rvalue other | Error.
  948. [helpstring("End commit operation")]
  949. HRESULT EndCommit([in] IMailMsgProperties *pMsg,
  950. [in] IMailMsgPropertyStream *pStream,
  951. [in] PFIO_CONTEXT pFIO);
  952. };
  953. /*
  954. @interface IMailMsgValidate | Interface to validate mailmsg structures
  955. @meth HRESULT | ValidateStream | Does the stream contain valid mailmsg
  956. data?.
  957. */
  958. [
  959. helpstring("Mail Message Validate"),
  960. local,
  961. object,
  962. pointer_default(unique),
  963. uuid(6717b03c-072c-11d3-94ff-00c04fa379f1)
  964. ]
  965. interface IMailMsgValidate : IUnknown
  966. {
  967. //@method HRESULT | IMailMsgProperties | ValidateStream |
  968. // Does the stream contain valid mailmsg data?
  969. //@parm IMailMsgPropertyStream | pStream | [in] Specifies the stream.
  970. //@rvalue S_OK | Success.
  971. //@rvalue HRESULT_FROM_WIN32(ERROR_INVALID_DATA) | The stream is invalid.
  972. [helpstring("Check stream data")]
  973. HRESULT ValidateStream([in] IMailMsgPropertyStream *pStream);
  974. };
  975. /*
  976. @interface IMailMsgValidateContext | Interface to validate context
  977. @meth HRESULT | ValidateMessageContext | Method to validate context
  978. */
  979. [
  980. helpstring("MailMsg Interface to validate context"),
  981. local,
  982. object,
  983. pointer_default(unique),
  984. uuid(60a482b1-b311-4eca-a3a3-907f9dafd16f)
  985. ]
  986. interface IMailMsgValidateContext : IUnknown
  987. {
  988. //@method HRESULT | IMailMsgValidateContext | ValidateMessageContext |
  989. // Determine if the context for this message is still valid.
  990. //@rvalue S_OK | Success. This context is still valid.
  991. //@rvalue HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) | Failure. This context
  992. // is no longer valid.
  993. //@rvalue E_NOTIMPL | Failure. The driver does not support this method.
  994. HRESULT ValidateContext();
  995. };
  996. /*
  997. @interface IMailMsgPropertyManagement | Manage properties for an Mail Message Object.
  998. @meth HRESULT | AllocPropIDRange | Allocate a range of property ID's.
  999. */
  1000. [
  1001. helpstring("Mail Message Property Management"),
  1002. object,
  1003. pointer_default(unique),
  1004. uuid(a2f196c0-a351-11d1-aa8a-00aa006bc80b)
  1005. ]
  1006. interface IMailMsgPropertyManagement : IUnknown
  1007. {
  1008. //@method HRESULT | IMailMsgPropertyManagement | AllocPropIDRange | Allocate a range of property ID's.
  1009. //@parm REFGUID | rguid | [in] Specifies the GUID for the range. If this range is not already
  1010. // registered, or if it is already registered and the count of the registered range matches the
  1011. // requested count, then the registration succeeds.
  1012. //@parm DWORD | cCount | [in] Specifies the count.
  1013. //@parm DWORD * | pdwStart | [out] Receives the starting property ID in the range.
  1014. //@rvalue S_OK | Success.
  1015. //@rvalue E_INVALIDARG | Failure. The range is already registered, with a different count.
  1016. [helpstring("Allocate a range of property ID's.")]
  1017. HRESULT AllocPropIDRange([in] REFGUID rguid,
  1018. [in] DWORD cCount,
  1019. [out/*,ptr*/] DWORD *pdwStart);
  1020. };
  1021. /*
  1022. @interface IMailMsgEnumMessages | An enumerator for messages.
  1023. @meth HRESULT | Next | Enumerate a message (with async completion).
  1024. */
  1025. [
  1026. helpstring("Mail Message Enumerator"),
  1027. local,
  1028. object,
  1029. pointer_default(unique),
  1030. uuid(e760a840-c8f1-11d1-9ff2-00c04fa37348)
  1031. ]
  1032. interface IMailMsgEnumMessages : IUnknown
  1033. {
  1034. //@method HRESULT | IMailMsgEnumMessages | Next | Enumerate a message (with async completion).
  1035. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message. This may be NULL.
  1036. //@parm IMailMsgPropertyStream ** | ppStream | [out] Receives the property stream.
  1037. //@parm PFIO_CONTEXT * | ppFIOContentFile | [out] Receives the content file.
  1038. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1039. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1040. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1041. //@rvalue S_OK | Success. The operation completed synchronously.
  1042. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1043. // with the result of the operation when it completes.
  1044. //@rvalue STG_E_NOMOREFILES | Failure. There are no more undelivered messages.
  1045. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify> <om IMailMsgStoreDriver.EnumMessages>
  1046. [helpstring("Enumerate a message (with async completion).")]
  1047. HRESULT Next([in,unique] IMailMsgProperties *pMsg,
  1048. [out/*,ptr*/] IMailMsgPropertyStream **ppStream,
  1049. [out/*,ptr*/] PFIO_CONTEXT *ppFIOContentFile,
  1050. [in,unique] IMailMsgNotify *pNotify);
  1051. };
  1052. /*
  1053. @interface IMailMsgStoreDriver | Used by the protocol stack to manage message files in the store
  1054. driver.
  1055. @meth HRESULT | AllocMessage | Allocate property stream and content file for a recipient (with async
  1056. completion).
  1057. @meth HRESULT | EnumMessages | Get an enumerator for undelivered messages in the store.
  1058. @meth HRESULT | ReOpen | Re-open a property stream and/or content file (with async completion).
  1059. @meth HRESULT | Delete | Delete a property stream and content file (with async completion).
  1060. */
  1061. [
  1062. helpstring("Mail Message Store Driver"),
  1063. local,
  1064. object,
  1065. pointer_default(unique),
  1066. uuid(246aae60-acc4-11d1-aa91-00aa006bc80b)
  1067. ]
  1068. interface IMailMsgStoreDriver : IUnknown
  1069. {
  1070. //@method HRESULT | IMailMsgStoreDriver | AllocMessage | Allocate property stream and content file for
  1071. // a recipient (with async completion).
  1072. //@parm IMailMsgProperties * | pMsg | [in,unique] Specifies the message.
  1073. //@parm DWORD | dwFlags | [in] Specifies flags. Currently only MAILMSG_AMF_MUSTCREATE is defined.
  1074. //@parm IMailMsgPropertyStream ** | ppStream | [out] Receives the property stream.
  1075. //@parm PFIO_CONTEXT * | ppFIOContentFile | [out] Receives the content file. The content file will have been
  1076. // opened with FILE_FLAG_OVERLAPPED, and can only be closed by using
  1077. // IMailMsgStoreDriver::CloseContentFile.
  1078. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1079. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1080. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1081. //@rvalue S_OK | Success. The operation completed synchronously.
  1082. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1083. // with the result of the operation when it completes.
  1084. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify> <om IMailMsgStoreDriver.CloseContentFile>
  1085. [helpstring("Allocate property stream and content file for a recipient (with async completion).")]
  1086. HRESULT AllocMessage([in,unique] IMailMsgProperties *pMsg,
  1087. [in] DWORD dwFlags,
  1088. [out/*,ptr*/] IMailMsgPropertyStream **ppStream,
  1089. [out/*,ptr*/] PFIO_CONTEXT *ppFIOContentFile,
  1090. [in,unique] IMailMsgNotify *pNotify);
  1091. //@method HRESULT | IMailMsgStoreDriver | EnumMessages | Get an enumerator for undelivered messages in
  1092. // the store.
  1093. //@parm IMailMsgEnumMessages ** | ppEnum | [out] Receives the result.
  1094. //@rvalue S_OK | Success.
  1095. //@xref <i IMailMsgEnumMessages>
  1096. [helpstring("Get an enumerator for undelivered messages in the store.")]
  1097. HRESULT EnumMessages([out] IMailMsgEnumMessages **ppEnum);
  1098. //@method HRESULT | IMailMsgStoreDriver | ReOpen | Re-open a property stream and/or content file (with
  1099. // async completion). Before calling this method, if the property stream is being re-opened all
  1100. // instances of the property stream interface must have been released, and if the content file is
  1101. // being re-opened all instances of the content handle must have been closed.
  1102. //@parm IMailMsgProperties * | pMsg | [in,unique] Specifies the message.
  1103. //@parm IMailMsgPropertyStream ** | ppStream | [out] Receives the property stream. If this parameter
  1104. // is NULL, the property stream will not be re-opened.
  1105. //@parm PFIO_CONTEXT * | ppFIOContentFile | [out] Receives the content file. If this parameter is NULL, the
  1106. // content file will not be re-opened.
  1107. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1108. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1109. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1110. //@rvalue S_OK | Success. The operation completed synchronously.
  1111. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1112. // with the result of the operation when it completes.
  1113. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify> <om IMailMsgStoreDriver.CloseContentFile>
  1114. [helpstring("Re-open a property stream and/or content file (with async completion).")]
  1115. HRESULT ReOpen([in] IMailMsgProperties *pMsg,
  1116. [out/*,ptr*/] IMailMsgPropertyStream **ppStream,
  1117. [out/*,ptr*/] PFIO_CONTEXT *ppFIOContentFile,
  1118. [in,unique] IMailMsgNotify *pNotify);
  1119. //@method HRESULT | IMailMsgStoreDriver | Delete | Delete a property stream and content file (with
  1120. // async completion). Before calling this method, all instances of the property stream interface must
  1121. // be released, and all instances of the content file handle must be closed. This interface should
  1122. // be used by the MailMsg object only, all other users should go through IMailMsgQueueMgmt::Delete().
  1123. //@parm IMailMsgProperties * | pMsg | [in,unique] Specifies the message.
  1124. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1125. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1126. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1127. //@rvalue S_OK | Success. The operation completed synchronously.
  1128. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1129. // with the result of the operation when it completes.
  1130. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  1131. [helpstring("Delete a property stream and content file (with async completion).")]
  1132. HRESULT Delete([in] IMailMsgProperties *pMsg,
  1133. [in,unique] IMailMsgNotify *pNotify);
  1134. //@method HRESULT | IMailMsgStoreDriver | CloseContentFile | Close the content file.
  1135. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message.
  1136. //@parm PFIO_CONTEXT | pFIOContentFile | [in] Specifies the content handle.
  1137. //@xref <om IMailMsgStoreDriver.ReOpen>
  1138. [helpstring("Close the content file.")]
  1139. HRESULT CloseContentFile([in] IMailMsgProperties *pMsg, [in] PFIO_CONTEXT pFIOContentFile);
  1140. //@method HRESULT | IMailMsgStoreDriver | ReAllocMessage | Re-allocates a new property stream and/or content
  1141. // file based on existing storage (with async completion).
  1142. //@parm IMailMsgProperties * | pOriginalMsg | [in,unique] Specifies the message on which the re-allocation is to be based.
  1143. //@parm IMailMsgProperties * | pNewMsg | [in,unique] Specifies the message receiving the reallocation.
  1144. //@parm IMailMsgPropertyStream ** | ppStream | [out] Receives the property stream.
  1145. //@parm PFIO_CONTEXT * | ppFIOContentFile | [out] Receives the content file.
  1146. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1147. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1148. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1149. //@rvalue S_OK | Success. The operation completed synchronously.
  1150. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1151. // with the result of the operation when it completes.
  1152. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify> <om IMailMsgStoreDriver.CloseContentFile>
  1153. [helpstring("Re-allocates an empty property stream and content file based on existing storage (with async completion).")]
  1154. HRESULT ReAllocMessage(
  1155. [in] IMailMsgProperties *pOriginalMsg,
  1156. [in] IMailMsgProperties *pNewMsg,
  1157. [out/*,ptr*/] IMailMsgPropertyStream **ppStream,
  1158. [out/*,ptr*/] PFIO_CONTEXT *ppFIOContentFile,
  1159. [in,unique] IMailMsgNotify *pNotify
  1160. );
  1161. //@method HRESULT | IMailMsgStoreDriver | SupportWriteContent | Does the store support writeable content?
  1162. // store driver supports writeable content.
  1163. //@rvalue S_OK | Success. Writeable content is supported.
  1164. //@rvalue S_FALSE | Success. Writable content is not supported.
  1165. [helpstring("Does the store support writeable content?")]
  1166. HRESULT SupportWriteContent();
  1167. };
  1168. /*
  1169. @interface IMailMsgQueueMgmt | Mail Message Queue Management Interface.
  1170. @meth HRESULT | AddUsage | Increment the usage count.
  1171. @meth HRESULT | ReleaseUsage | Decrement the usage count.
  1172. @meth HRESULT | SetRecipientCount | Set the recipient count.
  1173. @meth HRESULT | GetRecipientCount | Get the recipient count.
  1174. @meth HRESULT | DecrementRecipientCount | Decrement the recipient count.
  1175. @meth HRESULT | IncrementRecipientCount | Increment the recipient count.
  1176. @meth HRESULT | Delete | Delete the backing store for the message object (with async completion).
  1177. */
  1178. [
  1179. helpstring("Mail Message Queue Management Interface"),
  1180. object,
  1181. pointer_default(unique),
  1182. uuid(b2564d0a-d5a1-11d1-9ff7-00c04fa37348)
  1183. ]
  1184. interface IMailMsgQueueMgmt : IUnknown
  1185. {
  1186. //@method HRESULT | IMailMsgQueueMgmt | AddUsage | Increment the usage count. When the usage count
  1187. // is non-zero, the message object's resources are more likely to be kept cached in memory.
  1188. //@rvalue S_OK | Success. The usage count transitioned from zero to one.
  1189. //@rvalue S_FALSE | Success. The usage count was already above one.
  1190. //@rvalue E_FAIL | Failure. The usage count was a negative value (which should never happen). The
  1191. // increment operation has not been done.
  1192. //@xref <om IMailMsgQueueMgmt.ReleaseUsage>
  1193. [helpstring("Increment the usage count.")]
  1194. HRESULT AddUsage();
  1195. //@method HRESULT | IMailMsgQueueMgmt | ReleaseUsage | Decrement the usage count. When the usage
  1196. // count is zero, the message object's resources are more likely to be released from memory.
  1197. //@rvalue S_OK | Success. The usage count transitioned from one to zero.
  1198. //@rvalue S_FALSE | Success. The resulting usage count was greater than one.
  1199. //@rvalue E_FAIL | Failure. The resulting usage count is a negative value (which should never
  1200. // happen). The decrement operation has not been done.
  1201. //@xref <om IMailMsgQueueMgmt.AddUsage>
  1202. [helpstring("Decrement the usage count.")]
  1203. HRESULT ReleaseUsage();
  1204. //@method HRESULT | IMailMsgQueueMgmt | SetRecipientCount | Set the recipient count.
  1205. //@parm DWORD | dwCount | [in] Specifies the value to set the recipient count to.
  1206. //@rvalue S_OK | Success.
  1207. //@xref <om IMailMsgQueueMgmt.GetRecipientCount> <om IMailMsgQueueMgmt.DecrementRecipientCount>
  1208. // <om IMailMsgQueueMgmt.IncrementRecipientCount>
  1209. [helpstring("Set the recipient count.")]
  1210. HRESULT SetRecipientCount([in] DWORD dwCount);
  1211. //@method HRESULT | IMailMsgQueueMgmt | GetRecipientCount | Get the recipient count.
  1212. //@parm DWORD * | pdwCount | [out] Receives the recipient count.
  1213. //@rvalue S_OK | Success.
  1214. //@xref <om IMailMsgQueueMgmt.SetRecipientCount> <om IMailMsgQueueMgmt.DecrementRecipientCount>
  1215. // <om IMailMsgQueueMgmt.IncrementRecipientCount>
  1216. [helpstring("Get the recipient count.")]
  1217. HRESULT GetRecipientCount([out] DWORD *pdwCount);
  1218. //@method HRESULT | IMailMsgQueueMgmt | DecrementRecipientCount | Decrement the recipient count.
  1219. //@parm DWORD | dwDecrement | [in] Specifies the amount to decement the recipient count by.
  1220. //@rvalue S_OK | Success. The resulting recipient count is zero.
  1221. //@rvalue S_FALSE | Success. The resulting recipient count is non-zero.
  1222. //@rvalue E_FAIL | Failure. The resulting recipient count is negative (which should never happen).
  1223. // The decrement operation has not been done.
  1224. //@xref <om IMailMsgQueueMgmt.SetRecipientCount> <om IMailMsgQueueMgmt.GetRecipientCount>
  1225. // <om IMailMsgQueueMgmt.IncrementRecipientCount>
  1226. [helpstring("Decrement the recipient count.")]
  1227. HRESULT DecrementRecipientCount([in] DWORD dwDecrement);
  1228. //@method HRESULT | IMailMsgQueueMgmt | IncrementRecipientCount | Increment the recipient count.
  1229. //@parm DWORD | dwIncrement | [in] Specifies the amount to incement the recipient count by.
  1230. //@rvalue S_OK | Success. The recipient count transitioned from zero to non-zero. The S_OK and
  1231. // S_FALSE return values are provided for debugging purposes only - clients should not use these
  1232. // different return values for anything other than debugging code.
  1233. //@rvalue S_FALSE | Success. The recipient count was non-zero before the call. The S_OK and S_FALSE
  1234. // return values are provided for debugging purposes only - clients should not use these different
  1235. // return values for anything other than debugging code.
  1236. //@rvalue E_FAIL | Failure. The recipient count was negative (which should never happen). The
  1237. // increment operation has not been done.
  1238. //@xref <om IMailMsgQueueMgmt.SetRecipientCount> <om IMailMsgQueueMgmt.GetRecipientCount>
  1239. // <om IMailMsgQueueMgmt.DecrementRecipientCount>
  1240. [helpstring("Increment the recipient count.")]
  1241. HRESULT IncrementRecipientCount([in] DWORD dwIncrement);
  1242. //@method HRESULT | IMailMsgQueueMgmt | Delete | Delete the backing store for the message object (with
  1243. // async completion).
  1244. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1245. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1246. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1247. //@rvalue S_OK | Success. The operation completed synchronously.
  1248. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1249. // with the result of the operation when it completes.
  1250. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  1251. [helpstring("Delete the backing store for the message object (with async completion).")]
  1252. HRESULT Delete([in,unique] IMailMsgNotify *pNotify);
  1253. };
  1254. /*
  1255. @interface ISMTPStoreDriver | SMTP Store Driver Interface.
  1256. @meth HRESULT | Init | Initialize the store driver.
  1257. @meth HRESULT | PrepareForShutdown | Prepare to shutdown the store driver.
  1258. @meth HRESULT | Shutdown | Finish shutdown of the store driver.
  1259. @meth HRESULT | LocalDelivery | Perform local delivery on a message (with async completion).
  1260. @meth HRESULT | EnumerateAndSubmitMessages | Enumerate all the messages associated with the store driver.
  1261. */
  1262. [
  1263. helpstring("SMTP Store Driver Interface."),
  1264. local,
  1265. object,
  1266. pointer_default(unique),
  1267. uuid(ee51588c-d64a-11d1-9ff7-00c04fa37348)
  1268. ]
  1269. interface ISMTPStoreDriver : IUnknown
  1270. {
  1271. //@method HRESULT | ISMTPStoreDriver | Init | Initialize the store driver. During this call, the
  1272. // store driver receives the instance number of the server, a pointer to the binding information for
  1273. // the store driver, and a pointer to the server. By examing the parameters to this call, the store
  1274. // driver can determine if a previous instance of this store driver is already running for this
  1275. // virtual server, and if the binding options are similar enough that that previous instance is still
  1276. // valid - if so, then the store driver can return a pointer to the previous instance, causing the
  1277. // virtual-server to make all further calls on that previous instance.
  1278. //@parm DWORD | dwInstance | [in] Specifies the instance number of the virtual server.
  1279. //@parm IUnknown * | pBinding | [in,unique] Specifies the binding point for the store driver. This
  1280. // may be NULL.
  1281. //@parm IUnknown * | pServer | [in,unique] Specifies the server. The store driver may call methods
  1282. // on this object to perform advanced initialization functions. This may be NULL.
  1283. //@parm DWORD | dwReason | [in] Specifies the reason for the initialization. This will be either
  1284. // SMTP_INIT_VSERVER_STARTUP, or SMTP_INIT_BINDING_CHANGE.
  1285. //@parm IUnknown ** | ppStoreDriver | [out] Receives the store driver object. If this value non-NULL,
  1286. // the caller should release the original interface pointer, and use this object for all subsequent
  1287. // calls to the store driver. This mechanism allows the store driver to examine the parameters to
  1288. // the Init call, and redirect further operations by the virtual server to this store driver to be on
  1289. // a different object.
  1290. //@rvalue E_NOTIMPL | Failure. The driver does not support this method.
  1291. [helpstring("Initialize the store driver.")]
  1292. HRESULT Init([in] DWORD dwInstance,
  1293. [in,unique] IUnknown *pBinding,
  1294. [in] IUnknown *pServer,
  1295. [in] DWORD dwReason,
  1296. [out] IUnknown **ppStoreDriver);
  1297. //@method HRESULT | ISMTPStoreDriver | PrepareForShutdown | Prepare to shutdown the store driver. The
  1298. // store driver should release any interfaces it is holding on the server.
  1299. //@parm DWORD | dwReason | [in] Specifies the reason for the shutdown. This will be either
  1300. // SMTP_TERM_VSERVER_SHUTDOWN, or SMTP_TERM_BINDING_CHANGE.
  1301. //@rvalue E_NOTIMPL | Failure. The driver does not support this method.
  1302. [helpstring("Prepare to shutdown the store driver.")]
  1303. HRESULT PrepareForShutdown([in] DWORD dwReason);
  1304. //@method HRESULT | ISMTPStoreDriver | Shutdown | Finish shutdown of the store driver. The store
  1305. // driver should cancel any outstanding requests it has received from the server (posting
  1306. // HRESULT_FROM_WIN32(ERROR_SHUTDOWN_IN_PROGRESS) to any IMailMsgNotify interfaces it is holding).
  1307. //@parm DWORD | dwReason | [in] Specifies the reason for the shutdown. This will be either
  1308. // SMTP_TERM_VSERVER_SHUTDOWN, or SMTP_TERM_BINDING_CHANGE.
  1309. //@rvalue E_NOTIMPL | Failure. The driver does not support this method.
  1310. [helpstring("Finish shutdown of the store driver.")]
  1311. HRESULT Shutdown([in] DWORD dwReason);
  1312. //@method HRESULT | ISMTPStoreDriver | LocalDelivery | Perform local delivery on a message (with async
  1313. // completion).
  1314. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message being delivered.
  1315. //@parm DWORD | dwRecipCount | [in] Specifies the count of the recipients for this delivery.
  1316. //@parm DWORD * | pdwRecipIndexes | [in,size_is(dwRecipCount)] Specifies the indexes of the recipients
  1317. // for this delivery.
  1318. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1319. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  1320. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1321. //@rvalue S_OK | Success. The operation completed synchronously.
  1322. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1323. // with the result of the operation when it completes.
  1324. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  1325. [helpstring("Perform local delivery on a message (with async completion).")]
  1326. HRESULT LocalDelivery([in] IMailMsgProperties *pMsg,
  1327. [in] DWORD dwRecipCount,
  1328. [in,size_is(dwRecipCount)] DWORD *pdwRecipIndexes,
  1329. [in,unique] IMailMsgNotify *pNotify);
  1330. //@method HRESULT | ISMTPStoreDriver | EnumerateAndSubmitMessages | Enumerate all the messages associated with
  1331. // the store driver. The enumerator will restore undelivered messages from the store and submit
  1332. // them for delivery. This must be called after Init, and before any calls to AllocMessage.
  1333. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1334. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  1335. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1336. //@rvalue S_OK | Success.
  1337. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1338. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  1339. [helpstring("Enumerates undelivered messages in the store and submits them to queueing.")]
  1340. HRESULT EnumerateAndSubmitMessages([in,unique] IMailMsgNotify *pNotify);
  1341. };
  1342. /*
  1343. @interface IMailMsgStoreDriverValidateContext | Store Driver Context
  1344. Validation Interface.
  1345. @meth HRESULT | ValidateMessageContext | Initialize the store driver.
  1346. */
  1347. [
  1348. helpstring("Store Driver Message Validation Interface."),
  1349. local,
  1350. object,
  1351. pointer_default(unique),
  1352. uuid(C6742794-AD31-4711-BE73-9869142A8A23)
  1353. ]
  1354. interface IMailMsgStoreDriverValidateContext : IUnknown
  1355. {
  1356. //@method HRESULT | IMailMsgStoreDriverValidateContext | ValidateMessageContext |
  1357. // Given a message context, determine if it belongs to this store driver. If
  1358. // it does, determine if it is still valid (still has backing store).
  1359. //@parm PBYTE | pbContext | [in,unique] The context currently set on the message
  1360. // we are attempting to validate.
  1361. //@parm DWORD | cbContext | [in] The size of the context in bytes.
  1362. //@rvalue S_OK | Success. This context is associated with this store driver
  1363. // and is still valid.
  1364. //@rvalue S_FALSE | Success. This context is not associated with this store
  1365. // driver.
  1366. //@rvalue HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) | Failure. This context
  1367. // is associated with this driver, but it is no longer valid.
  1368. //@rvalue E_NOTIMPL | Failure. The driver does not support this method.
  1369. HRESULT ValidateMessageContext( [in, unique] BYTE *pbContext,
  1370. [in] DWORD cbContext);
  1371. };
  1372. /*
  1373. @interface IMailMsgBind | Interface for binding operations on a mail message.
  1374. @meth HRESULT | BindToStore | Bind a mail message to a store.
  1375. @meth HRESULT | GetProperties | Read the mail message properties into a stream (with async
  1376. completion).
  1377. */
  1378. [
  1379. helpstring("Interface for binding operations on a mail message."),
  1380. local,
  1381. object,
  1382. pointer_default(unique),
  1383. uuid(38cb448a-ca62-11d1-9ff3-00c04fa37348)
  1384. ]
  1385. interface IMailMsgBind : IUnknown
  1386. {
  1387. //@method HRESULT | IMailMsgBind | BindToStore | Bind a mail message to a store.
  1388. //@parm IMailMsgPropertyStream * | pStream | [in] Specifies the property stream.
  1389. //@parm IMailMsgStoreDriver * | pStore | [in] Specifies the store driver.
  1390. //@parm PFIO_CONTEXT | pFIOContentFile | [in] Specifies the content file.
  1391. //@rvalue S_OK | Success.
  1392. [helpstring("Bind a mail message to a store.")]
  1393. HRESULT BindToStore([in] IMailMsgPropertyStream *pStream,
  1394. [in] IMailMsgStoreDriver *pStore,
  1395. [in] PFIO_CONTEXT pFIOContentFile);
  1396. //@method HRESULT | IMailMsgBind | GetBinding | Get the file handle cache binding (with async completion). This
  1397. // method increments the usage count on the file handle cache context, preventing the content handle from being
  1398. // closed. IMailMsgBind::ReleaseContext must be called to decrement the usage count
  1399. // once operations on the handle are complete.
  1400. //@parm PFIO_CONTEXT * | ppFIOContentFile | [out] Recieves the content file.
  1401. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1402. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  1403. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1404. //@rvalue S_OK | Success. The operation completed synchronously.
  1405. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1406. // with the result of the operation when it completes.
  1407. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify> <om IMailMsgBind.ReleaseContext>
  1408. [helpstring("Get the file handle cache context (with async completion).")]
  1409. HRESULT GetBinding([out] PFIO_CONTEXT *ppFIOContentFile,
  1410. [in,unique] IMailMsgNotify *pNotify);
  1411. //@method HRESULT | IMailMsgBind | ReleaseContext | Decrement the reference count on the file
  1412. // handle context.
  1413. //@rvalue S_OK | Success.
  1414. //@xref <om IMailMsgBindATQ.GetBinding>
  1415. [helpstring("Decrement the reference count on the file handle context.")]
  1416. HRESULT ReleaseContext();
  1417. //@method HRESULT | IMailMsgBind | GetProperties | Read the mail message properties into a stream
  1418. // (with async completion).
  1419. //@parm IMailMsgPropertyStream * | pStream | [in] The stream to write the properties to.
  1420. //@parm DWORD | dwFlags | [in] Specifies the flags. This may be either MAILMSG_GETPROPS_INCREMENTAL
  1421. // or MAILMSG_GETPROPS_COMPLETE. It may also include MAILMSG_GETPROPS_CLEAR_DIRTY.
  1422. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1423. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  1424. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1425. //@rvalue S_OK | Success. The operation completed synchronously.
  1426. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1427. // with the result of the operation when it completes.
  1428. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  1429. [helpstring("Read the mail message properties into a stream (with async completion).")]
  1430. HRESULT GetProperties([in] IMailMsgPropertyStream *pStream,
  1431. [in] DWORD dwFlags,
  1432. [in,unique] IMailMsgNotify *pNotify);
  1433. };
  1434. /*
  1435. @interface IMailMsgPropertyBag | Interface for accessing a memory property bag object.
  1436. @meth HRESULT | PutProperty | Write a property.
  1437. @meth HRESULT | GetProperty | Read a property.
  1438. @meth HRESULT | PutStringA | Write a string property.
  1439. @meth HRESULT | GetStringA | Read a string property.
  1440. @meth HRESULT | PutStringW | Write a Unicode string property.
  1441. @meth HRESULT | GetStringW | Read a Unicode string property.
  1442. @meth HRESULT | PutDWORD | Write a DWORD property.
  1443. @meth HRESULT | GetDWORD | Read a DWORD property.
  1444. @meth HRESULT | PutBool | Write a boolean property.
  1445. @meth HRESULT | GetBool | Read a boolean property.
  1446. */
  1447. [
  1448. helpstring("Generic Memory property bag"),
  1449. local,
  1450. object,
  1451. pointer_default(unique),
  1452. uuid(d6d0509c-ec51-11d1-aa65-00c04fa35b82)
  1453. ]
  1454. interface IMailMsgPropertyBag : IUnknown
  1455. {
  1456. //@method HRESULT | IMailMsgPropertyBag | PutProperty | Write a property.
  1457. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1458. //@parm DWORD | cbLength | [in] Specifies the length in bytes of the value.
  1459. //@parm BYTE * | pbValue | [in,size_is(cbLength),length_is(cbLength),unique] Specifies the value.
  1460. //@rvalue S_OK | Success.
  1461. //@rvalue S_FALSE | Success. The property was not present.
  1462. //@xref <om ISMTPParams.GetProperty>
  1463. [helpstring("Write a property.")]
  1464. HRESULT PutProperty([in] DWORD dwPropID,
  1465. [in] DWORD cbLength,
  1466. [in,size_is(cbLength),length_is(cbLength),unique] BYTE *pbValue);
  1467. //@method HRESULT | IMailMsgPropertyBag | GetProperty | Read a property.
  1468. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1469. //@parm DWORD | cbLength | [in] Specifies the length in bytes of the buffer to receive the value.
  1470. //@parm DWORD * | pcbLength | [out] Receives the length in bytes of the value. This is set to zero if
  1471. // the property is not present.
  1472. //@parm BYTE * | pbValue | [out,size_is(cbLength),length_is(*pcbLength)] Receives the value.
  1473. //@rvalue S_OK | Success.
  1474. //@rvalue MAILMSG_E_PROPNOTFOUND | Failure. The property was not present. *pcbLength is set to zero.
  1475. //@xref <om ISMTPParams.PutProperty>
  1476. [helpstring("Read a property.")]
  1477. HRESULT GetProperty([in] DWORD dwPropID,
  1478. [in] DWORD cbLength,
  1479. [out] DWORD *pcbLength,
  1480. [out,size_is(cbLength),length_is(*pcbLength)/*,ptr*/] BYTE *pbValue);
  1481. //@method HRESULT | IMailMsgPropertyBag | PutStringA | Write a string property.
  1482. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1483. //@parm LPCSTR | pszValue | [in,unique] Specifies the value. If this is NULL, the property will be
  1484. // erased.
  1485. //@rvalue S_OK | Success.
  1486. //@rvalue S_FALSE | Success. The property was not present.
  1487. //@xref <om ISMTPParams.GetStringA>
  1488. [helpstring("Write a string property.")]
  1489. HRESULT PutStringA([in] DWORD dwPropID,
  1490. [in,unique] LPCSTR pszValue);
  1491. //@method HRESULT | IMailMsgPropertyBag | GetStringA | Read a string property.
  1492. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1493. //@parm DWORD | cchLength | [in] Specifies the length in characters (including the terminating NULL)
  1494. // of the buffer to receive the value.
  1495. //@parm LPSTR | pszValue | [out,size_is(cchLength)] Receives the value.
  1496. //@rvalue S_OK | Success.
  1497. //@rvalue MAILMSG_E_PROPNOTFOUND | Failure. The property was not present. The value receives NULL.
  1498. //@xref <om ISMTPParams.PutStringA>
  1499. [helpstring("Read a string property.")]
  1500. HRESULT GetStringA([in] DWORD dwPropID,
  1501. [in] DWORD cchLength,
  1502. [out,size_is(cchLength)/*,ptr*/] LPSTR pszValue);
  1503. //@method HRESULT | IMailMsgPropertyBag | PutStringW | Write a Unicode string property.
  1504. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1505. //@parm LPCWSTR | pszValue | [in,unique] Specifies the value.
  1506. //@rvalue S_OK | Success.
  1507. //@rvalue S_FALSE | Success. The property was not present.
  1508. //@xref <om ISMTPParams.GetStringW>
  1509. [helpstring("Write a Unicode string property.")]
  1510. HRESULT PutStringW([in] DWORD dwPropID,
  1511. [in,unique] LPCWSTR pszValue);
  1512. //@method HRESULT | IMailMsgPropertyBag | GetStringW | Read a Unicode string property.
  1513. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1514. //@parm DWORD | cchLength | [in] Specifies the length in characters (including the terminating NULL)
  1515. // of the buffer to receive the value.
  1516. //@parm LPCSTR | pszValue | [out,size_is(cchLength)] Receives the value.
  1517. //@rvalue S_OK | Success.
  1518. //@rvalue MAILMSG_E_PROPNOTFOUND | Failure. The property was not present. The value receives NULL.
  1519. //@xref <om ISMTPParams.PutStringW>
  1520. [helpstring("Read a Unicode string property.")]
  1521. HRESULT GetStringW([in] DWORD dwPropID,
  1522. [in] DWORD cchLength,
  1523. [out,size_is(cchLength)/*,ptr*/] LPWSTR pszValue);
  1524. //@method HRESULT | IMailMsgPropertyBag | PutDWORD | Write a DWORD property.
  1525. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1526. //@parm DWORD | dwValue | [in] The value to write.
  1527. //@rvalue S_OK | Success.
  1528. //@rvalue S_FALSE | Success. The property was not present.
  1529. //@xref <om ISMTPParams.GetDWORD>
  1530. [helpstring("Write a DWORD property.")]
  1531. HRESULT PutDWORD([in] DWORD dwPropID,
  1532. [in] DWORD dwValue);
  1533. //@method HRESULT | IMailMsgPropertyBag | GetDWORD | Read a DWORD property.
  1534. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1535. //@parm DWORD * | pdwValue | [out] Receives the value. If the property is not present, the method
  1536. // sets this to zero and returns S_FALSE.
  1537. //@rvalue S_OK | Success.
  1538. //@rvalue MAILMSG_E_PROPNOTFOUND | Failure. The property was not present. *pdwValue is set to zero.
  1539. //@xref <om ISMTPParams.PutDWORD>
  1540. [helpstring("Read a DWORD property.")]
  1541. HRESULT GetDWORD([in] DWORD dwPropID,
  1542. [out/*,ptr*/] DWORD *pdwValue);
  1543. //@method HRESULT | IMailMsgPropertyBag | PutBool | Write a boolean property.
  1544. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1545. //@parm DWORD | dwValue | [in] The value to write. This value is coerced to either TRUE or FALSE.
  1546. //@rvalue S_OK | Success.
  1547. //@rvalue S_FALSE | Success. The property was not present.
  1548. //@xref <om ISMTPParams.GetBool>
  1549. [helpstring("Write a boolean property.")]
  1550. HRESULT PutBool([in] DWORD dwPropID,
  1551. [in] DWORD bValue);
  1552. //@method HRESULT | IMailMsgPropertyBag | GetBool | Read a boolean property.
  1553. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1554. //@parm DWORD * | pdwValue | [out] Receives the value, which will either be TRUE or FALSE. If the
  1555. // property is not present, the method sets this to FALSE and returns S_FALSE.
  1556. //@rvalue S_OK | Success.
  1557. //@rvalue MAILMSG_E_PROPNOTFOUND | Failure. The property was not present. *pdwValue is set to FALSE.
  1558. //@xref <om ISMTPParams.PutBool>
  1559. [helpstring("Read a boolean property.")]
  1560. HRESULT GetBool([in] DWORD dwPropID,
  1561. [out/*,ptr*/] DWORD *pbValue);
  1562. };
  1563. /*
  1564. @interface IMailMsgLoggingPropertyBag | Interface to the logging facilities.
  1565. @meth HRESULT | WriteToLog | Write to the log
  1566. */
  1567. [
  1568. helpstring("Interface to the logging facilities."),
  1569. local,
  1570. object,
  1571. pointer_default(unique),
  1572. uuid(4cb17416-ec53-11d1-aa65-00c04fa35b82)
  1573. ]
  1574. interface IMailMsgLoggingPropertyBag : IMailMsgPropertyBag
  1575. {
  1576. // @method HRESULT | IMailMsgLoggingPropertyBag | WriteToLog | Write to the log
  1577. // @parm LPCWSTR | pszClientHostName | [in] Specifies the Client Host Name. May be NULL.
  1578. // @parm LPCWSTR | pszClientUserName | [in] Specifies the Client User Name. May be NULL.
  1579. // @parm LPCWSTR | pszServerAddress | [in] Specifies the Server Address May be NULL.
  1580. // @parm LPCWSTR | pszOperation | [in] Specifies the operation. May be NULL.
  1581. // @parm LPCWSTR | pszTarget | [in] Specifies the target. May be NULL.
  1582. // @parm LPCWSTR | pszParameters | [in] Specifies the parameters. May be NULL.
  1583. // @parm LPCWSTR | pszVersion | [in] Specifies the version. May be NULL.
  1584. // @parm DWORD | dwBytesSent | [in] Specifies the number of bytes sent.
  1585. // @parm DWORD | dwBytesReceived | [in] Specifies the number of bytes received.
  1586. // @parm DWORD | dwProcessingTimeMS | [in] Specifies the time spent processing, in milliseconds.
  1587. // @parm DWORD | dwWin32Status | [in] Specifies the Win32 status code.
  1588. // @parm DWORD | dwProtocolStatus | [in] Specifies the protocol status code.
  1589. // @parm DWORD | dwPort | [in] Specifies the port.
  1590. // @parm LPCWSTR | pszHTTPHeader | [in] Specifies the HTTP header. May be NULL.
  1591. // @rvalue S_OK | Success
  1592. // @rvalue E_FAIL | Failure.
  1593. // @rvalue E_NOTIMPL | Failure, not implemented.
  1594. // @xref <i ISMTPParams>
  1595. HRESULT WriteToLog([in] LPCSTR pszClientHostName,
  1596. [in] LPCSTR pszClientUserName,
  1597. [in] LPCSTR pszServerAddress,
  1598. [in] LPCSTR pszOperation,
  1599. [in] LPCSTR pszTarget,
  1600. [in] LPCSTR pszParameters,
  1601. [in] LPCSTR pszVersion,
  1602. [in] DWORD dwBytesSent,
  1603. [in] DWORD dwBytesReceived,
  1604. [in] DWORD dwProcessingTimeMS,
  1605. [in] DWORD dwWin32Status,
  1606. [in] DWORD dwProtocolStatus,
  1607. [in] DWORD dwPort,
  1608. [in] LPCSTR pszHTTPHeader);
  1609. };
  1610. /*
  1611. @interface IMailMsgCleanupCallback | Interface to receive notification that an object is about to be destroyed.
  1612. @meth HRESULT | CleanupCallback | Receives notification that an object is about to be destryoed.
  1613. */
  1614. [
  1615. helpstring("MailMsg Interface to receive a callback"),
  1616. local,
  1617. object,
  1618. pointer_default(unique),
  1619. uuid(951C04A1-29F0-4b8e-9ED5-836C73766051)
  1620. ]
  1621. interface IMailMsgCleanupCallback : IUnknown
  1622. {
  1623. // @method HRESULT | CleanupCallback | Receives notification that an object is about to be destryoed.
  1624. // @parm IUnknown | pObject | [in] IUnknown interface to the object about to be destroyed.
  1625. // @parm PVOID | pvContext | [in] Context previously specified to RegisterCleanupCallback
  1626. HRESULT CleanupCallback(
  1627. [in] IUnknown *pObject,
  1628. [in] PVOID pvContext);
  1629. };
  1630. /*
  1631. @interface IMailMsgRegisterCleanupCallback | Interface to register a callback.
  1632. @meth HRESULT | RegisterCleanupCallback | Register a callback to be called just before the object is destroyed.
  1633. */
  1634. [
  1635. helpstring("MailMsg Interface to register a callback"),
  1636. local,
  1637. object,
  1638. pointer_default(unique),
  1639. uuid(00561C2F-5E90-49e5-9E73-7BF9129298A0)
  1640. ]
  1641. interface IMailMsgRegisterCleanupCallback : IUnknown
  1642. {
  1643. // @method HRESULT | RegisterCleanupCallback | Register a callback to be called just before the object is destroyed.
  1644. // @parm IMailMsgCleanupCallback | pICallback | [in] Specifies the interface to call back.
  1645. // @parm PVOID | pvContext | [in] Specifies a context to be passed to the callback routine.
  1646. // @rvalue S_OK | Success
  1647. // @rvalue E_OUTOFMEMORY | Out of memory.
  1648. HRESULT RegisterCleanupCallback(
  1649. [in] IMailMsgCleanupCallback *pICallback,
  1650. [in] PVOID pvContext);
  1651. };
  1652. //
  1653. // The caller should NULL out all members & fillout only those that are relevant.
  1654. // If some member is null-ed out the LogMsgTrack method will use the info in IMailMsgProperties.
  1655. //
  1656. typedef struct _MSG_TRACK_INFO
  1657. {
  1658. LPSTR pszClientIp;
  1659. LPSTR pszClientName;
  1660. LPSTR pszPartnerName;
  1661. LPSTR pszServerIp;
  1662. LPSTR pszServerName;
  1663. LPSTR pszRecipientAddress;
  1664. LPSTR pszSenderAddress;
  1665. DWORD dwEventId;
  1666. LPSTR pszMessageId;
  1667. DWORD dwPriority;
  1668. DWORD dwRcptReportStatus;
  1669. DWORD cbMessageSize;
  1670. DWORD cRcpts;
  1671. DWORD dwTimeTaken;
  1672. DWORD dwEncryption;
  1673. LPSTR pszVersion;
  1674. LPSTR pszLinkMsgId;
  1675. LPSTR pszSubject;
  1676. } MSG_TRACK_INFO, *LPMSG_TRACK_INFO;
  1677. typedef struct _EVENT_LOG_INFO
  1678. {
  1679. DWORD dwEventId;
  1680. DWORD dwErrorCode;
  1681. LPSTR pszEventLogMsg;
  1682. } EVENT_LOG_INFO, *LPEVENT_LOG_INFO;
  1683. // Structure for info passed to SMTP event logging event
  1684. typedef struct _SMTP_LOG_EVENT_INFO
  1685. {
  1686. DWORD idMessage;
  1687. WORD idCategory;
  1688. WORD cSubstrings;
  1689. LPCSTR *rgszSubstrings;
  1690. WORD wType;
  1691. DWORD errCode;
  1692. WORD iDebugLevel;
  1693. LPCSTR szKey;
  1694. DWORD dwOptions;
  1695. DWORD iMessageString;
  1696. HMODULE hModule;
  1697. } SMTP_LOG_EVENT_INFO, *LPSMTP_LOG_EVENT_INFO;
  1698. /*
  1699. @interface ISMTPServer | Interface to the SMTP server.
  1700. @meth HRESULT | AllocMessage | Allocate a message object.
  1701. @meth HRESULT | SubmitMessage | Submit a message for delivery.
  1702. */
  1703. [
  1704. helpstring("Interface to the SMTP server."),
  1705. local,
  1706. object,
  1707. pointer_default(unique),
  1708. uuid(22625594-d822-11d1-9ff7-00c04fa37348)
  1709. ]
  1710. interface ISMTPServer : IUnknown
  1711. {
  1712. //@method HRESULT | ISMTPServer | AllocMessage | Allocate a message object.
  1713. //@parm IMailMsgProperties ** | ppMsg | [out] Receives the result.
  1714. //@rvalue S_OK | Success.
  1715. [helpstring("Allocate a message object.")]
  1716. HRESULT AllocMessage([out] IMailMsgProperties **ppMsg);
  1717. //@method HRESULT | ISMTPServer | SubmitMessage | Submit a message for delivery.
  1718. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message.
  1719. //@rvalue S_OK | Success.
  1720. [helpstring("Submit a message for delivery.")]
  1721. HRESULT SubmitMessage([in] IMailMsgProperties *pMsg);
  1722. //@method HRESULT | ISMTPServer | TriggerLocalDelivery | Trigger the local delivery event.
  1723. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message.
  1724. //@parm DWORD | dwRecipCount | [in] Specifies the count of the recipients for this delivery.
  1725. //@parm DWORD * | pdwRecipIndexes | [in,size_is(dwRecipCount)] Specifies the indexes of the recipients
  1726. // for this delivery.
  1727. //@rvalue S_OK | Success.
  1728. [helpstring("Trigger the local delivery event.")]
  1729. HRESULT TriggerLocalDelivery([in] IMailMsgProperties *pMsg, DWORD dwRecipientCount, DWORD * pdwRecipIndexes);
  1730. HRESULT ReadMetabaseString([in] DWORD MetabaseId,
  1731. [in, out, size_is(*BufferSize), length_is(*BufferSize)] char * Buffer,
  1732. [in, out] DWORD * BufferSize,
  1733. [in] BOOL fSecure);
  1734. HRESULT ReadMetabaseDword([in] DWORD MetabaseId,
  1735. [out] DWORD * dwValue);
  1736. HRESULT ServerStartHintFunction ();
  1737. HRESULT ServerStopHintFunction ();
  1738. HRESULT TriggerServerEvent([in] DWORD dwEventID,
  1739. [in] PVOID pvContext);
  1740. HRESULT WriteLog( [in] LPMSG_TRACK_INFO pMsgTrackInfo,
  1741. [in] IMailMsgProperties *pMsg,
  1742. [in] LPEVENT_LOG_INFO pEventLogInfo,
  1743. [in] LPSTR pszProtocolLog );
  1744. HRESULT ReadMetabaseData([in] DWORD MetabaseId,
  1745. [in, out, size_is(*BufferSize), length_is(*BufferSize)] BYTE * Buffer,
  1746. [in, out] DWORD * BufferSize);
  1747. };
  1748. [
  1749. helpstring("Extended Interface to the SMTP server."),
  1750. local,
  1751. object,
  1752. pointer_default(unique),
  1753. uuid(52ae6373-90f6-470c-9d38-526e9060b07d)
  1754. ]
  1755. interface ISMTPServerEx : IUnknown
  1756. {
  1757. // Triggers a Log event - the default handler here logs everything but can be overridden
  1758. // to allow for configurable logging levels
  1759. HRESULT TriggerLogEvent([in] DWORD idMessage,
  1760. [in] WORD idCategory,
  1761. [in] WORD cSubstrings,
  1762. [in] LPCSTR *rgszSubstrings,
  1763. [in] WORD wType,
  1764. [in] DWORD errCode,
  1765. [in] WORD iDebugLevel,
  1766. [in] LPCSTR szKey,
  1767. [in] DWORD dwOptions,
  1768. [in] DWORD iMessageString,
  1769. [in] HMODULE hModule);
  1770. // Reset any history about events using this message and key,
  1771. // so that the next TriggerLogEvent with one-time or periodic logging
  1772. // will cause the event to be logged.
  1773. HRESULT ResetLogEvent( [in] DWORD idMessage,
  1774. [in] LPCSTR szKey);
  1775. };
  1776. /*
  1777. @interface ISMTPServerAsync | Async Interface to the SMTP server.
  1778. @meth HRESULT | TriggerLocalDeliveryAsync | Locally deliver a msg.
  1779. */
  1780. [
  1781. helpstring("Async Interface to the SMTP server."),
  1782. local,
  1783. object,
  1784. pointer_default(unique),
  1785. uuid(08AF2A87-8C10-4196-9AE6-D517A86B9795)
  1786. ]
  1787. interface ISMTPServerAsync : IUnknown
  1788. {
  1789. //@method HRESULT | ISMTPServerAsync | TriggerLocalDeliveryAsync | Trigger the local delivery event.
  1790. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message.
  1791. //@parm DWORD | dwRecipCount | [in] Specifies the count of the recipients for this delivery.
  1792. //@parm DWORD * | pdwRecipIndexes | [in,size_is(dwRecipCount)] Specifies the indexes of the recipients
  1793. // for this delivery.
  1794. //@parm IMailMsgNotify * | pNotify | [in] Specifies the notify class
  1795. //@rvalue S_OK | Success.
  1796. [helpstring("Trigger the local delivery event.")]
  1797. HRESULT TriggerLocalDeliveryAsync([in] IMailMsgProperties *pMsg,
  1798. DWORD dwRecipientCount,
  1799. DWORD * pdwRecipIndexes,
  1800. IMailMsgNotify *pNotify);
  1801. };
  1802. [
  1803. helpstring("SMTP Interface to fire get aux domain info flags event"),
  1804. local,
  1805. object,
  1806. pointer_default(unique),
  1807. uuid(735e9929-1885-4736-8d07-492f962eceb9)
  1808. ]
  1809. interface ISMTPServerGetAuxDomainInfoFlags : IUnknown
  1810. {
  1811. // Trigger the GetAuxDomainInfoFlags event
  1812. //@method HRESULT | ISMTPServerGetAuxDomainInfoFlags | HrTriggerGetAuxDomainInfoFlagsEvent | Trigger the GetAuxDomainInfoFlags event.
  1813. //@parm LPCSTR | pszDomainName | [in] Specifies the domain name
  1814. //@parm DWORD * | pdwDomainInfoFlags | [out] Returns the flags for the specified domain
  1815. //@rvalue S_OK | Success.
  1816. [helpstring("Trigger the local delivery event.")]
  1817. HRESULT HrTriggerGetAuxDomainInfoFlagsEvent(
  1818. [in] LPCSTR pszDomainName,
  1819. [out] DWORD *pdwDomainInfoFlags );
  1820. };
  1821. [
  1822. helpstring("Internal Interface to the SMTP server."),
  1823. local,
  1824. object,
  1825. pointer_default(unique),
  1826. uuid(57EE6C15-1870-11d2-A689-00C04FA3490A)
  1827. ]
  1828. interface ISMTPServerInternal : ISMTPServer
  1829. {
  1830. //Allocates a message that has already been bound to a store driver
  1831. //Returned handle CANNOT be used for normal I/O since it is bound
  1832. //to a completion port in IIS
  1833. HRESULT AllocBoundMessage([out] IMailMsgProperties **ppMsg, [out] PFIO_CONTEXT *phContent);
  1834. };
  1835. [
  1836. helpstring("Mail Message 1.0 Type Library"),
  1837. uuid(daf24820-a8b9-11d1-aa91-00aa006bc80b),
  1838. version(1.0)
  1839. ]
  1840. library MailMsgLib
  1841. {
  1842. importlib("stdole2.tlb");
  1843. };