A reference to the MailMsg object for which to allocate the content and property stream files. This may be NULL.
dwFlags
Must be MAILMSG_AMF_MUSTCREATE.
ppStream
On successful return, a reference to an object used to persist the MailMsg object's transport envelope properties.
ppFIOContentFile
On successful return, contains a reference to a PFIO_CONTEXT context for the associated message content. The content file is opened with CreateFile using the FILE_FLAG_OVERLAPPED option and associated with an FIO_CONTEXT structure using the AssociateFile function. This context should only be released using the IMailMsgStoreDriver::CloseContentFile method.
pNotify
Interface to notify for asynchronous completion. If this value is NULL, then the operation will complete synchronously. Even if this value is non-NULL, the operation may still complete synchronously (i.e. it may return S_OK instead of MAILMSG_S_PENDING).
Return Values
Value
Description
S_OK
Success. The method completed synchronously.
MAILMSG_S_PENDING
Success. The operation will complete asynchronously. When it completes, you will be notified through the interface you passed using the pNotify parameter. The result of the operation will be returned with the notification callback method.
Remarks
This method is called on store driver objects by the SMTP service to request backing storage for an incoming message. The store driver is responsible for creating the following:
A FIO_CONTEXT context used to persist the message contents. This context is comprised of a file handle (HANDLE) created using the FILE_FLAG_OVERLAPPED flag and associated with an FIO_CONTEXT structure using the AssociateFile function exported by the fcachdll.dll library. This context will be used to read and write the message contents to a physical storage location such as the file system. For example, the FIO_CONTEXT returned by the default SMTP (NTFS) store driver contains a HANDLE to a file in the SMTP Queue directory prepared as just described. Such files have the ".EML" file extension.
If successfully created, the store driver object sets the IMMPID_MPV_STORE_DRIVER_HANDLE property in the MailMsg object. This property is comprised of a GUID value and any other optional information appended to the data, such as the full path to the file on the file system. This value is set using the IMailMsgProperties::PutProperty method. The GUID should be the CLSID of the store driver object. It is up to the store driver implementation as to what information, beyond the CLSID of the class, is stored in this property.
A reference to an object exposing the IMailMsgPropertyStream interface. This object will be used to persist the transport envelope properties for the MailMsg object. For example, the default SMTP (NTFS) store driver returns an object that internally writes property blocks to disk into a file in the SMTP Queue directory with the ".STM" file extension.