Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1965 lines
104 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 MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,301)")
  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. [out,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 IMailMsgValidate | Interface to validate mailmsg structures
  914. @meth HRESULT | ValidateStream | Does the stream contain valid mailmsg
  915. data?.
  916. */
  917. [
  918. helpstring("Mail Message Validate"),
  919. local,
  920. object,
  921. pointer_default(unique),
  922. uuid(6717b03c-072c-11d3-94ff-00c04fa379f1)
  923. ]
  924. interface IMailMsgValidate : IUnknown
  925. {
  926. //@method HRESULT | IMailMsgProperties | ValidateStream |
  927. // Does the stream contain valid mailmsg data?
  928. //@parm IMailMsgPropertyStream | pStream | [in] Specifies the stream.
  929. //@rvalue S_OK | Success.
  930. //@rvalue HRESULT_FROM_WIN32(ERROR_INVALID_DATA) | The stream is invalid.
  931. [helpstring("Check stream data")]
  932. HRESULT ValidateStream([in] IMailMsgPropertyStream *pStream);
  933. };
  934. /*
  935. @interface IMailMsgValidateContext | Interface to validate context
  936. @meth HRESULT | ValidateMessageContext | Method to validate context
  937. */
  938. [
  939. helpstring("MailMsg Interface to validate context"),
  940. local,
  941. object,
  942. pointer_default(unique),
  943. uuid(60a482b1-b311-4eca-a3a3-907f9dafd16f)
  944. ]
  945. interface IMailMsgValidateContext : IUnknown
  946. {
  947. //@method HRESULT | IMailMsgValidateContext | ValidateMessageContext |
  948. // Determine if the context for this message is still valid.
  949. //@rvalue S_OK | Success. This context is still valid.
  950. //@rvalue HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) | Failure. This context
  951. // is no longer valid.
  952. //@rvalue E_NOTIMPL | Failure. The driver does not support this method.
  953. HRESULT ValidateContext();
  954. };
  955. /*
  956. @interface IMailMsgPropertyManagement | Manage properties for an Mail Message Object.
  957. @meth HRESULT | AllocPropIDRange | Allocate a range of property ID's.
  958. */
  959. [
  960. helpstring("Mail Message Property Management"),
  961. object,
  962. pointer_default(unique),
  963. uuid(a2f196c0-a351-11d1-aa8a-00aa006bc80b)
  964. ]
  965. interface IMailMsgPropertyManagement : IUnknown
  966. {
  967. //@method HRESULT | IMailMsgPropertyManagement | AllocPropIDRange | Allocate a range of property ID's.
  968. //@parm REFGUID | rguid | [in] Specifies the GUID for the range. If this range is not already
  969. // registered, or if it is already registered and the count of the registered range matches the
  970. // requested count, then the registration succeeds.
  971. //@parm DWORD | cCount | [in] Specifies the count.
  972. //@parm DWORD * | pdwStart | [out] Receives the starting property ID in the range.
  973. //@rvalue S_OK | Success.
  974. //@rvalue E_INVALIDARG | Failure. The range is already registered, with a different count.
  975. [helpstring("Allocate a range of property ID's.")]
  976. HRESULT AllocPropIDRange([in] REFGUID rguid,
  977. [in] DWORD cCount,
  978. [out/*,ptr*/] DWORD *pdwStart);
  979. };
  980. /*
  981. @interface IMailMsgEnumMessages | An enumerator for messages.
  982. @meth HRESULT | Next | Enumerate a message (with async completion).
  983. */
  984. [
  985. helpstring("Mail Message Enumerator"),
  986. local,
  987. object,
  988. pointer_default(unique),
  989. uuid(e760a840-c8f1-11d1-9ff2-00c04fa37348)
  990. ]
  991. interface IMailMsgEnumMessages : IUnknown
  992. {
  993. //@method HRESULT | IMailMsgEnumMessages | Next | Enumerate a message (with async completion).
  994. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message. This may be NULL.
  995. //@parm IMailMsgPropertyStream ** | ppStream | [out] Receives the property stream.
  996. //@parm PFIO_CONTEXT * | ppFIOContentFile | [out] Receives the content file.
  997. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  998. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  999. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1000. //@rvalue S_OK | Success. The operation completed synchronously.
  1001. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1002. // with the result of the operation when it completes.
  1003. //@rvalue STG_E_NOMOREFILES | Failure. There are no more undelivered messages.
  1004. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify> <om IMailMsgStoreDriver.EnumMessages>
  1005. [helpstring("Enumerate a message (with async completion).")]
  1006. HRESULT Next([in,unique] IMailMsgProperties *pMsg,
  1007. [out/*,ptr*/] IMailMsgPropertyStream **ppStream,
  1008. [out/*,ptr*/] PFIO_CONTEXT *ppFIOContentFile,
  1009. [in,unique] IMailMsgNotify *pNotify);
  1010. };
  1011. /*
  1012. @interface IMailMsgStoreDriver | Used by the protocol stack to manage message files in the store
  1013. driver.
  1014. @meth HRESULT | AllocMessage | Allocate property stream and content file for a recipient (with async
  1015. completion).
  1016. @meth HRESULT | EnumMessages | Get an enumerator for undelivered messages in the store.
  1017. @meth HRESULT | ReOpen | Re-open a property stream and/or content file (with async completion).
  1018. @meth HRESULT | Delete | Delete a property stream and content file (with async completion).
  1019. */
  1020. [
  1021. helpstring("Mail Message Store Driver"),
  1022. local,
  1023. object,
  1024. pointer_default(unique),
  1025. uuid(246aae60-acc4-11d1-aa91-00aa006bc80b)
  1026. ]
  1027. interface IMailMsgStoreDriver : IUnknown
  1028. {
  1029. //@method HRESULT | IMailMsgStoreDriver | AllocMessage | Allocate property stream and content file for
  1030. // a recipient (with async completion).
  1031. //@parm IMailMsgProperties * | pMsg | [in,unique] Specifies the message.
  1032. //@parm DWORD | dwFlags | [in] Specifies flags. Currently only MAILMSG_AMF_MUSTCREATE is defined.
  1033. //@parm IMailMsgPropertyStream ** | ppStream | [out] Receives the property stream.
  1034. //@parm PFIO_CONTEXT * | ppFIOContentFile | [out] Receives the content file. The content file will have been
  1035. // opened with FILE_FLAG_OVERLAPPED, and can only be closed by using
  1036. // IMailMsgStoreDriver::CloseContentFile.
  1037. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1038. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1039. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1040. //@rvalue S_OK | Success. The operation completed synchronously.
  1041. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1042. // with the result of the operation when it completes.
  1043. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify> <om IMailMsgStoreDriver.CloseContentFile>
  1044. [helpstring("Allocate property stream and content file for a recipient (with async completion).")]
  1045. HRESULT AllocMessage([in,unique] IMailMsgProperties *pMsg,
  1046. [in] DWORD dwFlags,
  1047. [out/*,ptr*/] IMailMsgPropertyStream **ppStream,
  1048. [out/*,ptr*/] PFIO_CONTEXT *ppFIOContentFile,
  1049. [in,unique] IMailMsgNotify *pNotify);
  1050. //@method HRESULT | IMailMsgStoreDriver | EnumMessages | Get an enumerator for undelivered messages in
  1051. // the store.
  1052. //@parm IMailMsgEnumMessages ** | ppEnum | [out] Receives the result.
  1053. //@rvalue S_OK | Success.
  1054. //@xref <i IMailMsgEnumMessages>
  1055. [helpstring("Get an enumerator for undelivered messages in the store.")]
  1056. HRESULT EnumMessages([out] IMailMsgEnumMessages **ppEnum);
  1057. //@method HRESULT | IMailMsgStoreDriver | ReOpen | Re-open a property stream and/or content file (with
  1058. // async completion). Before calling this method, if the property stream is being re-opened all
  1059. // instances of the property stream interface must have been released, and if the content file is
  1060. // being re-opened all instances of the content handle must have been closed.
  1061. //@parm IMailMsgProperties * | pMsg | [in,unique] Specifies the message.
  1062. //@parm IMailMsgPropertyStream ** | ppStream | [out] Receives the property stream. If this parameter
  1063. // is NULL, the property stream will not be re-opened.
  1064. //@parm PFIO_CONTEXT * | ppFIOContentFile | [out] Receives the content file. If this parameter is NULL, the
  1065. // content file will not be re-opened.
  1066. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1067. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1068. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1069. //@rvalue S_OK | Success. The operation completed synchronously.
  1070. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1071. // with the result of the operation when it completes.
  1072. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify> <om IMailMsgStoreDriver.CloseContentFile>
  1073. [helpstring("Re-open a property stream and/or content file (with async completion).")]
  1074. HRESULT ReOpen([in] IMailMsgProperties *pMsg,
  1075. [out/*,ptr*/] IMailMsgPropertyStream **ppStream,
  1076. [out/*,ptr*/] PFIO_CONTEXT *ppFIOContentFile,
  1077. [in,unique] IMailMsgNotify *pNotify);
  1078. //@method HRESULT | IMailMsgStoreDriver | Delete | Delete a property stream and content file (with
  1079. // async completion). Before calling this method, all instances of the property stream interface must
  1080. // be released, and all instances of the content file handle must be closed. This interface should
  1081. // be used by the MailMsg object only, all other users should go through IMailMsgQueueMgmt::Delete().
  1082. //@parm IMailMsgProperties * | pMsg | [in,unique] Specifies the message.
  1083. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1084. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1085. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1086. //@rvalue S_OK | Success. The operation completed synchronously.
  1087. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1088. // with the result of the operation when it completes.
  1089. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  1090. [helpstring("Delete a property stream and content file (with async completion).")]
  1091. HRESULT Delete([in] IMailMsgProperties *pMsg,
  1092. [in,unique] IMailMsgNotify *pNotify);
  1093. //@method HRESULT | IMailMsgStoreDriver | CloseContentFile | Close the content file.
  1094. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message.
  1095. //@parm PFIO_CONTEXT | pFIOContentFile | [in] Specifies the content handle.
  1096. //@xref <om IMailMsgStoreDriver.ReOpen>
  1097. [helpstring("Close the content file.")]
  1098. HRESULT CloseContentFile([in] IMailMsgProperties *pMsg, [in] PFIO_CONTEXT pFIOContentFile);
  1099. //@method HRESULT | IMailMsgStoreDriver | ReAllocMessage | Re-allocates a new property stream and/or content
  1100. // file based on existing storage (with async completion).
  1101. //@parm IMailMsgProperties * | pOriginalMsg | [in,unique] Specifies the message on which the re-allocation is to be based.
  1102. //@parm IMailMsgProperties * | pNewMsg | [in,unique] Specifies the message receiving the reallocation.
  1103. //@parm IMailMsgPropertyStream ** | ppStream | [out] Receives the property stream.
  1104. //@parm PFIO_CONTEXT * | ppFIOContentFile | [out] Receives the content file.
  1105. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1106. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1107. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1108. //@rvalue S_OK | Success. The operation completed synchronously.
  1109. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1110. // with the result of the operation when it completes.
  1111. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify> <om IMailMsgStoreDriver.CloseContentFile>
  1112. [helpstring("Re-allocates an empty property stream and content file based on existing storage (with async completion).")]
  1113. HRESULT ReAllocMessage(
  1114. [in] IMailMsgProperties *pOriginalMsg,
  1115. [in] IMailMsgProperties *pNewMsg,
  1116. [out/*,ptr*/] IMailMsgPropertyStream **ppStream,
  1117. [out/*,ptr*/] PFIO_CONTEXT *ppFIOContentFile,
  1118. [in,unique] IMailMsgNotify *pNotify
  1119. );
  1120. //@method HRESULT | IMailMsgStoreDriver | SupportWriteContent | Does the store support writeable content?
  1121. // store driver supports writeable content.
  1122. //@rvalue S_OK | Success. Writeable content is supported.
  1123. //@rvalue S_FALSE | Success. Writable content is not supported.
  1124. [helpstring("Does the store support writeable content?")]
  1125. HRESULT SupportWriteContent();
  1126. };
  1127. /*
  1128. @interface IMailMsgQueueMgmt | Mail Message Queue Management Interface.
  1129. @meth HRESULT | AddUsage | Increment the usage count.
  1130. @meth HRESULT | ReleaseUsage | Decrement the usage count.
  1131. @meth HRESULT | SetRecipientCount | Set the recipient count.
  1132. @meth HRESULT | GetRecipientCount | Get the recipient count.
  1133. @meth HRESULT | DecrementRecipientCount | Decrement the recipient count.
  1134. @meth HRESULT | IncrementRecipientCount | Increment the recipient count.
  1135. @meth HRESULT | Delete | Delete the backing store for the message object (with async completion).
  1136. */
  1137. [
  1138. helpstring("Mail Message Queue Management Interface"),
  1139. object,
  1140. pointer_default(unique),
  1141. uuid(b2564d0a-d5a1-11d1-9ff7-00c04fa37348)
  1142. ]
  1143. interface IMailMsgQueueMgmt : IUnknown
  1144. {
  1145. //@method HRESULT | IMailMsgQueueMgmt | AddUsage | Increment the usage count. When the usage count
  1146. // is non-zero, the message object's resources are more likely to be kept cached in memory.
  1147. //@rvalue S_OK | Success. The usage count transitioned from zero to one.
  1148. //@rvalue S_FALSE | Success. The usage count was already above one.
  1149. //@rvalue E_FAIL | Failure. The usage count was a negative value (which should never happen). The
  1150. // increment operation has not been done.
  1151. //@xref <om IMailMsgQueueMgmt.ReleaseUsage>
  1152. [helpstring("Increment the usage count.")]
  1153. HRESULT AddUsage();
  1154. //@method HRESULT | IMailMsgQueueMgmt | ReleaseUsage | Decrement the usage count. When the usage
  1155. // count is zero, the message object's resources are more likely to be released from memory.
  1156. //@rvalue S_OK | Success. The usage count transitioned from one to zero.
  1157. //@rvalue S_FALSE | Success. The resulting usage count was greater than one.
  1158. //@rvalue E_FAIL | Failure. The resulting usage count is a negative value (which should never
  1159. // happen). The decrement operation has not been done.
  1160. //@xref <om IMailMsgQueueMgmt.AddUsage>
  1161. [helpstring("Decrement the usage count.")]
  1162. HRESULT ReleaseUsage();
  1163. //@method HRESULT | IMailMsgQueueMgmt | SetRecipientCount | Set the recipient count.
  1164. //@parm DWORD | dwCount | [in] Specifies the value to set the recipient count to.
  1165. //@rvalue S_OK | Success.
  1166. //@xref <om IMailMsgQueueMgmt.GetRecipientCount> <om IMailMsgQueueMgmt.DecrementRecipientCount>
  1167. // <om IMailMsgQueueMgmt.IncrementRecipientCount>
  1168. [helpstring("Set the recipient count.")]
  1169. HRESULT SetRecipientCount([in] DWORD dwCount);
  1170. //@method HRESULT | IMailMsgQueueMgmt | GetRecipientCount | Get the recipient count.
  1171. //@parm DWORD * | pdwCount | [out] Receives the recipient count.
  1172. //@rvalue S_OK | Success.
  1173. //@xref <om IMailMsgQueueMgmt.SetRecipientCount> <om IMailMsgQueueMgmt.DecrementRecipientCount>
  1174. // <om IMailMsgQueueMgmt.IncrementRecipientCount>
  1175. [helpstring("Get the recipient count.")]
  1176. HRESULT GetRecipientCount([out] DWORD *pdwCount);
  1177. //@method HRESULT | IMailMsgQueueMgmt | DecrementRecipientCount | Decrement the recipient count.
  1178. //@parm DWORD | dwDecrement | [in] Specifies the amount to decement the recipient count by.
  1179. //@rvalue S_OK | Success. The resulting recipient count is zero.
  1180. //@rvalue S_FALSE | Success. The resulting recipient count is non-zero.
  1181. //@rvalue E_FAIL | Failure. The resulting recipient count is negative (which should never happen).
  1182. // The decrement operation has not been done.
  1183. //@xref <om IMailMsgQueueMgmt.SetRecipientCount> <om IMailMsgQueueMgmt.GetRecipientCount>
  1184. // <om IMailMsgQueueMgmt.IncrementRecipientCount>
  1185. [helpstring("Decrement the recipient count.")]
  1186. HRESULT DecrementRecipientCount([in] DWORD dwDecrement);
  1187. //@method HRESULT | IMailMsgQueueMgmt | IncrementRecipientCount | Increment the recipient count.
  1188. //@parm DWORD | dwIncrement | [in] Specifies the amount to incement the recipient count by.
  1189. //@rvalue S_OK | Success. The recipient count transitioned from zero to non-zero. The S_OK and
  1190. // S_FALSE return values are provided for debugging purposes only - clients should not use these
  1191. // different return values for anything other than debugging code.
  1192. //@rvalue S_FALSE | Success. The recipient count was non-zero before the call. The S_OK and S_FALSE
  1193. // return values are provided for debugging purposes only - clients should not use these different
  1194. // return values for anything other than debugging code.
  1195. //@rvalue E_FAIL | Failure. The recipient count was negative (which should never happen). The
  1196. // increment operation has not been done.
  1197. //@xref <om IMailMsgQueueMgmt.SetRecipientCount> <om IMailMsgQueueMgmt.GetRecipientCount>
  1198. // <om IMailMsgQueueMgmt.DecrementRecipientCount>
  1199. [helpstring("Increment the recipient count.")]
  1200. HRESULT IncrementRecipientCount([in] DWORD dwIncrement);
  1201. //@method HRESULT | IMailMsgQueueMgmt | Delete | Delete the backing store for the message object (with
  1202. // async completion).
  1203. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1204. // value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the
  1205. // operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1206. //@rvalue S_OK | Success. The operation completed synchronously.
  1207. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1208. // with the result of the operation when it completes.
  1209. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  1210. [helpstring("Delete the backing store for the message object (with async completion).")]
  1211. HRESULT Delete([in,unique] IMailMsgNotify *pNotify);
  1212. };
  1213. /*
  1214. @interface ISMTPStoreDriver | SMTP Store Driver Interface.
  1215. @meth HRESULT | Init | Initialize the store driver.
  1216. @meth HRESULT | PrepareForShutdown | Prepare to shutdown the store driver.
  1217. @meth HRESULT | Shutdown | Finish shutdown of the store driver.
  1218. @meth HRESULT | LocalDelivery | Perform local delivery on a message (with async completion).
  1219. @meth HRESULT | EnumerateAndSubmitMessages | Enumerate all the messages associated with the store driver.
  1220. */
  1221. [
  1222. helpstring("SMTP Store Driver Interface."),
  1223. local,
  1224. object,
  1225. pointer_default(unique),
  1226. uuid(ee51588c-d64a-11d1-9ff7-00c04fa37348)
  1227. ]
  1228. interface ISMTPStoreDriver : IUnknown
  1229. {
  1230. //@method HRESULT | ISMTPStoreDriver | Init | Initialize the store driver. During this call, the
  1231. // store driver receives the instance number of the server, a pointer to the binding information for
  1232. // the store driver, and a pointer to the server. By examing the parameters to this call, the store
  1233. // driver can determine if a previous instance of this store driver is already running for this
  1234. // virtual server, and if the binding options are similar enough that that previous instance is still
  1235. // valid - if so, then the store driver can return a pointer to the previous instance, causing the
  1236. // virtual-server to make all further calls on that previous instance.
  1237. //@parm DWORD | dwInstance | [in] Specifies the instance number of the virtual server.
  1238. //@parm IUnknown * | pBinding | [in,unique] Specifies the binding point for the store driver. This
  1239. // may be NULL.
  1240. //@parm IUnknown * | pServer | [in,unique] Specifies the server. The store driver may call methods
  1241. // on this object to perform advanced initialization functions. This may be NULL.
  1242. //@parm DWORD | dwReason | [in] Specifies the reason for the initialization. This will be either
  1243. // SMTP_INIT_VSERVER_STARTUP, or SMTP_INIT_BINDING_CHANGE.
  1244. //@parm IUnknown ** | ppStoreDriver | [out] Receives the store driver object. If this value non-NULL,
  1245. // the caller should release the original interface pointer, and use this object for all subsequent
  1246. // calls to the store driver. This mechanism allows the store driver to examine the parameters to
  1247. // the Init call, and redirect further operations by the virtual server to this store driver to be on
  1248. // a different object.
  1249. //@rvalue E_NOTIMPL | Failure. The driver does not support this method.
  1250. [helpstring("Initialize the store driver.")]
  1251. HRESULT Init([in] DWORD dwInstance,
  1252. [in,unique] IUnknown *pBinding,
  1253. [in] IUnknown *pServer,
  1254. [in] DWORD dwReason,
  1255. [out] IUnknown **ppStoreDriver);
  1256. //@method HRESULT | ISMTPStoreDriver | PrepareForShutdown | Prepare to shutdown the store driver. The
  1257. // store driver should release any interfaces it is holding on the server.
  1258. //@parm DWORD | dwReason | [in] Specifies the reason for the shutdown. This will be either
  1259. // SMTP_TERM_VSERVER_SHUTDOWN, or SMTP_TERM_BINDING_CHANGE.
  1260. //@rvalue E_NOTIMPL | Failure. The driver does not support this method.
  1261. [helpstring("Prepare to shutdown the store driver.")]
  1262. HRESULT PrepareForShutdown([in] DWORD dwReason);
  1263. //@method HRESULT | ISMTPStoreDriver | Shutdown | Finish shutdown of the store driver. The store
  1264. // driver should cancel any outstanding requests it has received from the server (posting
  1265. // HRESULT_FROM_WIN32(ERROR_SHUTDOWN_IN_PROGRESS) to any IMailMsgNotify interfaces it is holding).
  1266. //@parm DWORD | dwReason | [in] Specifies the reason for the shutdown. This will be either
  1267. // SMTP_TERM_VSERVER_SHUTDOWN, or SMTP_TERM_BINDING_CHANGE.
  1268. //@rvalue E_NOTIMPL | Failure. The driver does not support this method.
  1269. [helpstring("Finish shutdown of the store driver.")]
  1270. HRESULT Shutdown([in] DWORD dwReason);
  1271. //@method HRESULT | ISMTPStoreDriver | LocalDelivery | Perform local delivery on a message (with async
  1272. // completion).
  1273. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message being delivered.
  1274. //@parm DWORD | dwRecipCount | [in] Specifies the count of the recipients for this delivery.
  1275. //@parm DWORD * | pdwRecipIndexes | [in,size_is(dwRecipCount)] Specifies the indexes of the recipients
  1276. // for this delivery.
  1277. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1278. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  1279. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1280. //@rvalue S_OK | Success. The operation completed synchronously.
  1281. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1282. // with the result of the operation when it completes.
  1283. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  1284. [helpstring("Perform local delivery on a message (with async completion).")]
  1285. HRESULT LocalDelivery([in] IMailMsgProperties *pMsg,
  1286. [in] DWORD dwRecipCount,
  1287. [in,size_is(dwRecipCount)] DWORD *pdwRecipIndexes,
  1288. [in,unique] IMailMsgNotify *pNotify);
  1289. //@method HRESULT | ISMTPStoreDriver | EnumerateAndSubmitMessages | Enumerate all the messages associated with
  1290. // the store driver. The enumerator will restore undelivered messages from the store and submit
  1291. // them for delivery. This must be called after Init, and before any calls to AllocMessage.
  1292. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1293. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  1294. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1295. //@rvalue S_OK | Success.
  1296. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1297. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  1298. [helpstring("Enumerates undelivered messages in the store and submits them to queueing.")]
  1299. HRESULT EnumerateAndSubmitMessages([in,unique] IMailMsgNotify *pNotify);
  1300. };
  1301. /*
  1302. @interface IMailMsgStoreDriverValidateContext | Store Driver Context
  1303. Validation Interface.
  1304. @meth HRESULT | ValidateMessageContext | Initialize the store driver.
  1305. */
  1306. [
  1307. helpstring("Store Driver Message Validation Interface."),
  1308. local,
  1309. object,
  1310. pointer_default(unique),
  1311. uuid(C6742794-AD31-4711-BE73-9869142A8A23)
  1312. ]
  1313. interface IMailMsgStoreDriverValidateContext : IUnknown
  1314. {
  1315. //@method HRESULT | IMailMsgStoreDriverValidateContext | ValidateMessageContext |
  1316. // Given a message context, determine if it belongs to this store driver. If
  1317. // it does, determine if it is still valid (still has backing store).
  1318. //@parm PBYTE | pbContext | [in,unique] The context currently set on the message
  1319. // we are attempting to validate.
  1320. //@parm DWORD | cbContext | [in] The size of the context in bytes.
  1321. //@rvalue S_OK | Success. This context is associated with this store driver
  1322. // and is still valid.
  1323. //@rvalue S_FALSE | Success. This context is not associated with this store
  1324. // driver.
  1325. //@rvalue HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) | Failure. This context
  1326. // is associated with this driver, but it is no longer valid.
  1327. //@rvalue E_NOTIMPL | Failure. The driver does not support this method.
  1328. HRESULT ValidateMessageContext( [in, unique] BYTE *pbContext,
  1329. [in] DWORD cbContext);
  1330. };
  1331. /*
  1332. @interface IMailMsgBind | Interface for binding operations on a mail message.
  1333. @meth HRESULT | BindToStore | Bind a mail message to a store.
  1334. @meth HRESULT | GetProperties | Read the mail message properties into a stream (with async
  1335. completion).
  1336. */
  1337. [
  1338. helpstring("Interface for binding operations on a mail message."),
  1339. local,
  1340. object,
  1341. pointer_default(unique),
  1342. uuid(38cb448a-ca62-11d1-9ff3-00c04fa37348)
  1343. ]
  1344. interface IMailMsgBind : IUnknown
  1345. {
  1346. //@method HRESULT | IMailMsgBind | BindToStore | Bind a mail message to a store.
  1347. //@parm IMailMsgPropertyStream * | pStream | [in] Specifies the property stream.
  1348. //@parm IMailMsgStoreDriver * | pStore | [in] Specifies the store driver.
  1349. //@parm PFIO_CONTEXT | pFIOContentFile | [in] Specifies the content file.
  1350. //@rvalue S_OK | Success.
  1351. [helpstring("Bind a mail message to a store.")]
  1352. HRESULT BindToStore([in] IMailMsgPropertyStream *pStream,
  1353. [in] IMailMsgStoreDriver *pStore,
  1354. [in] PFIO_CONTEXT pFIOContentFile);
  1355. //@method HRESULT | IMailMsgBind | GetBinding | Get the file handle cache binding (with async completion). This
  1356. // method increments the usage count on the file handle cache context, preventing the content handle from being
  1357. // closed. IMailMsgBind::ReleaseContext must be called to decrement the usage count
  1358. // once operations on the handle are complete.
  1359. //@parm PFIO_CONTEXT * | ppFIOContentFile | [out] Recieves the content file.
  1360. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1361. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  1362. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1363. //@rvalue S_OK | Success. The operation completed synchronously.
  1364. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1365. // with the result of the operation when it completes.
  1366. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify> <om IMailMsgBind.ReleaseContext>
  1367. [helpstring("Get the file handle cache context (with async completion).")]
  1368. HRESULT GetBinding([out] PFIO_CONTEXT *ppFIOContentFile,
  1369. [in,unique] IMailMsgNotify *pNotify);
  1370. //@method HRESULT | IMailMsgBind | ReleaseContext | Decrement the reference count on the file
  1371. // handle context.
  1372. //@rvalue S_OK | Success.
  1373. //@xref <om IMailMsgBindATQ.GetBinding>
  1374. [helpstring("Decrement the reference count on the file handle context.")]
  1375. HRESULT ReleaseContext();
  1376. //@method HRESULT | IMailMsgBind | GetProperties | Read the mail message properties into a stream
  1377. // (with async completion).
  1378. //@parm IMailMsgPropertyStream * | pStream | [in] The stream to write the properties to.
  1379. //@parm DWORD | dwFlags | [in] Specifies the flags. This may be either MAILMSG_GETPROPS_INCREMENTAL
  1380. // or MAILMSG_GETPROPS_COMPLETE. It may also include MAILMSG_GETPROPS_CLEAR_DIRTY.
  1381. //@parm IMailMsgNotify * | pNotify | [in,unique] Interface to notify for async completion. If this
  1382. // value is NULL, then the method will complete synchronously. Even if this value is non-NULL, the
  1383. // method may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
  1384. //@rvalue S_OK | Success. The operation completed synchronously.
  1385. //@rvalue MAILMSG_S_PENDING | Success. The operation is pending, and pNotify->Notify will be called
  1386. // with the result of the operation when it completes.
  1387. //@xref <i IMailMsgNotify> <om IMailMsgNotify.Notify>
  1388. [helpstring("Read the mail message properties into a stream (with async completion).")]
  1389. HRESULT GetProperties([in] IMailMsgPropertyStream *pStream,
  1390. [in] DWORD dwFlags,
  1391. [in,unique] IMailMsgNotify *pNotify);
  1392. };
  1393. /*
  1394. @interface IMailMsgPropertyBag | Interface for accessing a memory property bag object.
  1395. @meth HRESULT | PutProperty | Write a property.
  1396. @meth HRESULT | GetProperty | Read a property.
  1397. @meth HRESULT | PutStringA | Write a string property.
  1398. @meth HRESULT | GetStringA | Read a string property.
  1399. @meth HRESULT | PutStringW | Write a Unicode string property.
  1400. @meth HRESULT | GetStringW | Read a Unicode string property.
  1401. @meth HRESULT | PutDWORD | Write a DWORD property.
  1402. @meth HRESULT | GetDWORD | Read a DWORD property.
  1403. @meth HRESULT | PutBool | Write a boolean property.
  1404. @meth HRESULT | GetBool | Read a boolean property.
  1405. */
  1406. [
  1407. helpstring("Generic Memory property bag"),
  1408. local,
  1409. object,
  1410. pointer_default(unique),
  1411. uuid(d6d0509c-ec51-11d1-aa65-00c04fa35b82)
  1412. ]
  1413. interface IMailMsgPropertyBag : IUnknown
  1414. {
  1415. //@method HRESULT | IMailMsgPropertyBag | PutProperty | Write a property.
  1416. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1417. //@parm DWORD | cbLength | [in] Specifies the length in bytes of the value.
  1418. //@parm BYTE * | pbValue | [in,size_is(cbLength),length_is(cbLength),unique] Specifies the value.
  1419. //@rvalue S_OK | Success.
  1420. //@rvalue S_FALSE | Success. The property was not present.
  1421. //@xref <om ISMTPParams.GetProperty>
  1422. [helpstring("Write a property.")]
  1423. HRESULT PutProperty([in] DWORD dwPropID,
  1424. [in] DWORD cbLength,
  1425. [in,size_is(cbLength),length_is(cbLength),unique] BYTE *pbValue);
  1426. //@method HRESULT | IMailMsgPropertyBag | GetProperty | Read a property.
  1427. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1428. //@parm DWORD | cbLength | [in] Specifies the length in bytes of the buffer to receive the value.
  1429. //@parm DWORD * | pcbLength | [out] Receives the length in bytes of the value. This is set to zero if
  1430. // the property is not present.
  1431. //@parm BYTE * | pbValue | [out,size_is(cbLength),length_is(*pcbLength)] Receives the value.
  1432. //@rvalue S_OK | Success.
  1433. //@rvalue MAILMSG_E_PROPNOTFOUND | Failure. The property was not present. *pcbLength is set to zero.
  1434. //@xref <om ISMTPParams.PutProperty>
  1435. [helpstring("Read a property.")]
  1436. HRESULT GetProperty([in] DWORD dwPropID,
  1437. [in] DWORD cbLength,
  1438. [out] DWORD *pcbLength,
  1439. [out,size_is(cbLength),length_is(*pcbLength)/*,ptr*/] BYTE *pbValue);
  1440. //@method HRESULT | IMailMsgPropertyBag | PutStringA | Write a string property.
  1441. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1442. //@parm LPCSTR | pszValue | [in,unique] Specifies the value. If this is NULL, the property will be
  1443. // erased.
  1444. //@rvalue S_OK | Success.
  1445. //@rvalue S_FALSE | Success. The property was not present.
  1446. //@xref <om ISMTPParams.GetStringA>
  1447. [helpstring("Write a string property.")]
  1448. HRESULT PutStringA([in] DWORD dwPropID,
  1449. [in,unique] LPCSTR pszValue);
  1450. //@method HRESULT | IMailMsgPropertyBag | GetStringA | Read a string property.
  1451. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1452. //@parm DWORD | cchLength | [in] Specifies the length in characters (including the terminating NULL)
  1453. // of the buffer to receive the value.
  1454. //@parm LPSTR | pszValue | [out,size_is(cchLength)] Receives the value.
  1455. //@rvalue S_OK | Success.
  1456. //@rvalue MAILMSG_E_PROPNOTFOUND | Failure. The property was not present. The value receives NULL.
  1457. //@xref <om ISMTPParams.PutStringA>
  1458. [helpstring("Read a string property.")]
  1459. HRESULT GetStringA([in] DWORD dwPropID,
  1460. [in] DWORD cchLength,
  1461. [out,size_is(cchLength)/*,ptr*/] LPSTR pszValue);
  1462. //@method HRESULT | IMailMsgPropertyBag | PutStringW | Write a Unicode string property.
  1463. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1464. //@parm LPCWSTR | pszValue | [in,unique] Specifies the value.
  1465. //@rvalue S_OK | Success.
  1466. //@rvalue S_FALSE | Success. The property was not present.
  1467. //@xref <om ISMTPParams.GetStringW>
  1468. [helpstring("Write a Unicode string property.")]
  1469. HRESULT PutStringW([in] DWORD dwPropID,
  1470. [in,unique] LPCWSTR pszValue);
  1471. //@method HRESULT | IMailMsgPropertyBag | GetStringW | Read a Unicode string property.
  1472. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1473. //@parm DWORD | cchLength | [in] Specifies the length in characters (including the terminating NULL)
  1474. // of the buffer to receive the value.
  1475. //@parm LPCSTR | pszValue | [out,size_is(cchLength)] Receives the value.
  1476. //@rvalue S_OK | Success.
  1477. //@rvalue MAILMSG_E_PROPNOTFOUND | Failure. The property was not present. The value receives NULL.
  1478. //@xref <om ISMTPParams.PutStringW>
  1479. [helpstring("Read a Unicode string property.")]
  1480. HRESULT GetStringW([in] DWORD dwPropID,
  1481. [in] DWORD cchLength,
  1482. [out,size_is(cchLength)/*,ptr*/] LPWSTR pszValue);
  1483. //@method HRESULT | IMailMsgPropertyBag | PutDWORD | Write a DWORD property.
  1484. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1485. //@parm DWORD | dwValue | [in] The value to write.
  1486. //@rvalue S_OK | Success.
  1487. //@rvalue S_FALSE | Success. The property was not present.
  1488. //@xref <om ISMTPParams.GetDWORD>
  1489. [helpstring("Write a DWORD property.")]
  1490. HRESULT PutDWORD([in] DWORD dwPropID,
  1491. [in] DWORD dwValue);
  1492. //@method HRESULT | IMailMsgPropertyBag | GetDWORD | Read a DWORD property.
  1493. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1494. //@parm DWORD * | pdwValue | [out] Receives the value. If the property is not present, the method
  1495. // sets this to zero and returns S_FALSE.
  1496. //@rvalue S_OK | Success.
  1497. //@rvalue MAILMSG_E_PROPNOTFOUND | Failure. The property was not present. *pdwValue is set to zero.
  1498. //@xref <om ISMTPParams.PutDWORD>
  1499. [helpstring("Read a DWORD property.")]
  1500. HRESULT GetDWORD([in] DWORD dwPropID,
  1501. [out/*,ptr*/] DWORD *pdwValue);
  1502. //@method HRESULT | IMailMsgPropertyBag | PutBool | Write a boolean property.
  1503. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1504. //@parm DWORD | dwValue | [in] The value to write. This value is coerced to either TRUE or FALSE.
  1505. //@rvalue S_OK | Success.
  1506. //@rvalue S_FALSE | Success. The property was not present.
  1507. //@xref <om ISMTPParams.GetBool>
  1508. [helpstring("Write a boolean property.")]
  1509. HRESULT PutBool([in] DWORD dwPropID,
  1510. [in] DWORD bValue);
  1511. //@method HRESULT | IMailMsgPropertyBag | GetBool | Read a boolean property.
  1512. //@parm DWORD | dwPropID | [in] Specifies the property ID.
  1513. //@parm DWORD * | pdwValue | [out] Receives the value, which will either be TRUE or FALSE. If the
  1514. // property is not present, the method sets this to FALSE and returns S_FALSE.
  1515. //@rvalue S_OK | Success.
  1516. //@rvalue MAILMSG_E_PROPNOTFOUND | Failure. The property was not present. *pdwValue is set to FALSE.
  1517. //@xref <om ISMTPParams.PutBool>
  1518. [helpstring("Read a boolean property.")]
  1519. HRESULT GetBool([in] DWORD dwPropID,
  1520. [out/*,ptr*/] DWORD *pbValue);
  1521. };
  1522. /*
  1523. @interface IMailMsgLoggingPropertyBag | Interface to the logging facilities.
  1524. @meth HRESULT | WriteToLog | Write to the log
  1525. */
  1526. [
  1527. helpstring("Interface to the logging facilities."),
  1528. local,
  1529. object,
  1530. pointer_default(unique),
  1531. uuid(4cb17416-ec53-11d1-aa65-00c04fa35b82)
  1532. ]
  1533. interface IMailMsgLoggingPropertyBag : IMailMsgPropertyBag
  1534. {
  1535. // @method HRESULT | IMailMsgLoggingPropertyBag | WriteToLog | Write to the log
  1536. // @parm LPCWSTR | pszClientHostName | [in] Specifies the Client Host Name. May be NULL.
  1537. // @parm LPCWSTR | pszClientUserName | [in] Specifies the Client User Name. May be NULL.
  1538. // @parm LPCWSTR | pszServerAddress | [in] Specifies the Server Address May be NULL.
  1539. // @parm LPCWSTR | pszOperation | [in] Specifies the operation. May be NULL.
  1540. // @parm LPCWSTR | pszTarget | [in] Specifies the target. May be NULL.
  1541. // @parm LPCWSTR | pszParameters | [in] Specifies the parameters. May be NULL.
  1542. // @parm LPCWSTR | pszVersion | [in] Specifies the version. May be NULL.
  1543. // @parm DWORD | dwBytesSent | [in] Specifies the number of bytes sent.
  1544. // @parm DWORD | dwBytesReceived | [in] Specifies the number of bytes received.
  1545. // @parm DWORD | dwProcessingTimeMS | [in] Specifies the time spent processing, in milliseconds.
  1546. // @parm DWORD | dwWin32Status | [in] Specifies the Win32 status code.
  1547. // @parm DWORD | dwProtocolStatus | [in] Specifies the protocol status code.
  1548. // @parm DWORD | dwPort | [in] Specifies the port.
  1549. // @parm LPCWSTR | pszHTTPHeader | [in] Specifies the HTTP header. May be NULL.
  1550. // @rvalue S_OK | Success
  1551. // @rvalue E_FAIL | Failure.
  1552. // @rvalue E_NOTIMPL | Failure, not implemented.
  1553. // @xref <i ISMTPParams>
  1554. HRESULT WriteToLog([in] LPCSTR pszClientHostName,
  1555. [in] LPCSTR pszClientUserName,
  1556. [in] LPCSTR pszServerAddress,
  1557. [in] LPCSTR pszOperation,
  1558. [in] LPCSTR pszTarget,
  1559. [in] LPCSTR pszParameters,
  1560. [in] LPCSTR pszVersion,
  1561. [in] DWORD dwBytesSent,
  1562. [in] DWORD dwBytesReceived,
  1563. [in] DWORD dwProcessingTimeMS,
  1564. [in] DWORD dwWin32Status,
  1565. [in] DWORD dwProtocolStatus,
  1566. [in] DWORD dwPort,
  1567. [in] LPCSTR pszHTTPHeader);
  1568. };
  1569. /*
  1570. @interface IMailMsgCleanupCallback | Interface to receive notification that an object is about to be destroyed.
  1571. @meth HRESULT | CleanupCallback | Receives notification that an object is about to be destryoed.
  1572. */
  1573. [
  1574. helpstring("MailMsg Interface to receive a callback"),
  1575. local,
  1576. object,
  1577. pointer_default(unique),
  1578. uuid(951C04A1-29F0-4b8e-9ED5-836C73766051)
  1579. ]
  1580. interface IMailMsgCleanupCallback : IUnknown
  1581. {
  1582. // @method HRESULT | CleanupCallback | Receives notification that an object is about to be destryoed.
  1583. // @parm IUnknown | pObject | [in] IUnknown interface to the object about to be destroyed.
  1584. // @parm PVOID | pvContext | [in] Context previously specified to RegisterCleanupCallback
  1585. HRESULT CleanupCallback(
  1586. [in] IUnknown *pObject,
  1587. [in] PVOID pvContext);
  1588. };
  1589. /*
  1590. @interface IMailMsgRegisterCleanupCallback | Interface to register a callback.
  1591. @meth HRESULT | RegisterCleanupCallback | Register a callback to be called just before the object is destroyed.
  1592. */
  1593. [
  1594. helpstring("MailMsg Interface to register a callback"),
  1595. local,
  1596. object,
  1597. pointer_default(unique),
  1598. uuid(00561C2F-5E90-49e5-9E73-7BF9129298A0)
  1599. ]
  1600. interface IMailMsgRegisterCleanupCallback : IUnknown
  1601. {
  1602. // @method HRESULT | RegisterCleanupCallback | Register a callback to be called just before the object is destroyed.
  1603. // @parm IMailMsgCleanupCallback | pICallback | [in] Specifies the interface to call back.
  1604. // @parm PVOID | pvContext | [in] Specifies a context to be passed to the callback routine.
  1605. // @rvalue S_OK | Success
  1606. // @rvalue E_OUTOFMEMORY | Out of memory.
  1607. HRESULT RegisterCleanupCallback(
  1608. [in] IMailMsgCleanupCallback *pICallback,
  1609. [in] PVOID pvContext);
  1610. };
  1611. //
  1612. // The caller should NULL out all members & fillout only those that are relevant.
  1613. // If some member is null-ed out the LogMsgTrack method will use the info in IMailMsgProperties.
  1614. //
  1615. typedef struct _MSG_TRACK_INFO
  1616. {
  1617. LPSTR pszClientIp;
  1618. LPSTR pszClientName;
  1619. LPSTR pszPartnerName;
  1620. LPSTR pszServerIp;
  1621. LPSTR pszServerName;
  1622. LPSTR pszRecipientAddress;
  1623. LPSTR pszSenderAddress;
  1624. DWORD dwEventId;
  1625. LPSTR pszMessageId;
  1626. DWORD dwPriority;
  1627. DWORD dwRcptReportStatus;
  1628. DWORD cbMessageSize;
  1629. DWORD cRcpts;
  1630. DWORD dwTimeTaken;
  1631. DWORD dwEncryption;
  1632. LPSTR pszVersion;
  1633. LPSTR pszLinkMsgId;
  1634. LPSTR pszSubject;
  1635. } MSG_TRACK_INFO, *LPMSG_TRACK_INFO;
  1636. typedef struct _EVENT_LOG_INFO
  1637. {
  1638. DWORD dwEventId;
  1639. DWORD dwErrorCode;
  1640. LPSTR pszEventLogMsg;
  1641. } EVENT_LOG_INFO, *LPEVENT_LOG_INFO;
  1642. // Structure for info passed to SMTP event logging event
  1643. typedef struct _SMTP_LOG_EVENT_INFO
  1644. {
  1645. DWORD idMessage;
  1646. WORD idCategory;
  1647. WORD cSubstrings;
  1648. LPCSTR *rgszSubstrings;
  1649. WORD wType;
  1650. DWORD errCode;
  1651. WORD iDebugLevel;
  1652. LPCSTR szKey;
  1653. DWORD dwOptions;
  1654. DWORD iMessageString;
  1655. HMODULE hModule;
  1656. } SMTP_LOG_EVENT_INFO, *LPSMTP_LOG_EVENT_INFO;
  1657. /*
  1658. @interface ISMTPServer | Interface to the SMTP server.
  1659. @meth HRESULT | AllocMessage | Allocate a message object.
  1660. @meth HRESULT | SubmitMessage | Submit a message for delivery.
  1661. */
  1662. [
  1663. helpstring("Interface to the SMTP server."),
  1664. local,
  1665. object,
  1666. pointer_default(unique),
  1667. uuid(22625594-d822-11d1-9ff7-00c04fa37348)
  1668. ]
  1669. interface ISMTPServer : IUnknown
  1670. {
  1671. //@method HRESULT | ISMTPServer | AllocMessage | Allocate a message object.
  1672. //@parm IMailMsgProperties ** | ppMsg | [out] Receives the result.
  1673. //@rvalue S_OK | Success.
  1674. [helpstring("Allocate a message object.")]
  1675. HRESULT AllocMessage([out] IMailMsgProperties **ppMsg);
  1676. //@method HRESULT | ISMTPServer | SubmitMessage | Submit a message for delivery.
  1677. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message.
  1678. //@rvalue S_OK | Success.
  1679. [helpstring("Submit a message for delivery.")]
  1680. HRESULT SubmitMessage([in] IMailMsgProperties *pMsg);
  1681. //@method HRESULT | ISMTPServer | TriggerLocalDelivery | Trigger the local delivery event.
  1682. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message.
  1683. //@parm DWORD | dwRecipCount | [in] Specifies the count of the recipients for this delivery.
  1684. //@parm DWORD * | pdwRecipIndexes | [in,size_is(dwRecipCount)] Specifies the indexes of the recipients
  1685. // for this delivery.
  1686. //@rvalue S_OK | Success.
  1687. [helpstring("Trigger the local delivery event.")]
  1688. HRESULT TriggerLocalDelivery([in] IMailMsgProperties *pMsg, DWORD dwRecipientCount, DWORD * pdwRecipIndexes);
  1689. HRESULT ReadMetabaseString([in] DWORD MetabaseId,
  1690. [in, out, size_is(*BufferSize), length_is(*BufferSize)] char * Buffer,
  1691. [in, out] DWORD * BufferSize,
  1692. [in] BOOL fSecure);
  1693. HRESULT ReadMetabaseDword([in] DWORD MetabaseId,
  1694. [out] DWORD * dwValue);
  1695. HRESULT ServerStartHintFunction ();
  1696. HRESULT ServerStopHintFunction ();
  1697. HRESULT TriggerServerEvent([in] DWORD dwEventID,
  1698. [in] PVOID pvContext);
  1699. HRESULT WriteLog( [in] LPMSG_TRACK_INFO pMsgTrackInfo,
  1700. [in] IMailMsgProperties *pMsg,
  1701. [in] LPEVENT_LOG_INFO pEventLogInfo,
  1702. [in] LPSTR pszProtocolLog );
  1703. HRESULT ReadMetabaseData([in] DWORD MetabaseId,
  1704. [in, out, size_is(*BufferSize), length_is(*BufferSize)] BYTE * Buffer,
  1705. [in, out] DWORD * BufferSize);
  1706. };
  1707. [
  1708. helpstring("Extended Interface to the SMTP server."),
  1709. local,
  1710. object,
  1711. pointer_default(unique),
  1712. uuid(52ae6373-90f6-470c-9d38-526e9060b07d)
  1713. ]
  1714. interface ISMTPServerEx : IUnknown
  1715. {
  1716. // Triggers a Log event - the default handler here logs everything but can be overridden
  1717. // to allow for configurable logging levels
  1718. HRESULT TriggerLogEvent([in] DWORD idMessage,
  1719. [in] WORD idCategory,
  1720. [in] WORD cSubstrings,
  1721. [in] LPCSTR *rgszSubstrings,
  1722. [in] WORD wType,
  1723. [in] DWORD errCode,
  1724. [in] WORD iDebugLevel,
  1725. [in] LPCSTR szKey,
  1726. [in] DWORD dwOptions,
  1727. [in] DWORD iMessageString,
  1728. [in] HMODULE hModule);
  1729. // Reset any history about events using this message and key,
  1730. // so that the next TriggerLogEvent with one-time or periodic logging
  1731. // will cause the event to be logged.
  1732. HRESULT ResetLogEvent( [in] DWORD idMessage,
  1733. [in] LPCSTR szKey);
  1734. };
  1735. /*
  1736. @interface ISMTPServerAsync | Async Interface to the SMTP server.
  1737. @meth HRESULT | TriggerLocalDeliveryAsync | Locally deliver a msg.
  1738. */
  1739. [
  1740. helpstring("Async Interface to the SMTP server."),
  1741. local,
  1742. object,
  1743. pointer_default(unique),
  1744. uuid(F8FAA643-6DD8-461b-AED1-D64B306E870F)
  1745. ]
  1746. interface ISMTPServerAsync : IUnknown
  1747. {
  1748. //@method HRESULT | ISMTPServerAsync | TriggerLocalDeliveryAsync | Trigger the local delivery event.
  1749. //@parm IMailMsgProperties * | pMsg | [in] Specifies the message.
  1750. //@parm DWORD | dwRecipCount | [in] Specifies the count of the recipients for this delivery.
  1751. //@parm DWORD * | pdwRecipIndexes | [in,size_is(dwRecipCount)] Specifies the indexes of the recipients
  1752. // for this delivery.
  1753. //@parm IMailMsgNotify * | pNotify | [in] Specifies the notify class
  1754. //@rvalue S_OK | Success.
  1755. [helpstring("Trigger the local delivery event.")]
  1756. HRESULT TriggerLocalDeliveryAsync([in] IMailMsgProperties *pMsg,
  1757. DWORD dwRecipientCount,
  1758. DWORD * pdwRecipIndexes,
  1759. IMailMsgNotify *pNotify);
  1760. };
  1761. [
  1762. helpstring("SMTP Interface to fire get aux domain info flags event"),
  1763. local,
  1764. object,
  1765. pointer_default(unique),
  1766. uuid(735e9929-1885-4736-8d07-492f962eceb9)
  1767. ]
  1768. interface ISMTPServerGetAuxDomainInfoFlags : IUnknown
  1769. {
  1770. // Trigger the GetAuxDomainInfoFlags event
  1771. //@method HRESULT | ISMTPServerGetAuxDomainInfoFlags | HrTriggerGetAuxDomainInfoFlagsEvent | Trigger the GetAuxDomainInfoFlags event.
  1772. //@parm LPCSTR | pszDomainName | [in] Specifies the domain name
  1773. //@parm DWORD * | pdwDomainInfoFlags | [out] Returns the flags for the specified domain
  1774. //@rvalue S_OK | Success.
  1775. [helpstring("Trigger the local delivery event.")]
  1776. HRESULT HrTriggerGetAuxDomainInfoFlagsEvent(
  1777. [in] LPCSTR pszDomainName,
  1778. [out] DWORD *pdwDomainInfoFlags );
  1779. };
  1780. [
  1781. helpstring("Internal Interface to the SMTP server."),
  1782. local,
  1783. object,
  1784. pointer_default(unique),
  1785. uuid(57EE6C15-1870-11d2-A689-00C04FA3490A)
  1786. ]
  1787. interface ISMTPServerInternal : ISMTPServer
  1788. {
  1789. //Allocates a message that has already been bound to a store driver
  1790. //Returned handle CANNOT be used for normal I/O since it is bound
  1791. //to a completion port in IIS
  1792. HRESULT AllocBoundMessage([out] IMailMsgProperties **ppMsg, [out] PFIO_CONTEXT *phContent);
  1793. };
  1794. [
  1795. helpstring("Mail Message 1.0 Type Library"),
  1796. uuid(daf24820-a8b9-11d1-aa91-00aa006bc80b),
  1797. version(1.0)
  1798. ]
  1799. library MailMsgLib
  1800. {
  1801. importlib("stdole2.tlb");
  1802. };