Platform SDK: SMTP Server Events

IMailMsgStoreDriver::AllocMessage

[This is preliminary documentation and subject to change.]

Allocate a property stream and content file context for a message with optional asynchronous completion.

HRESULT AllocMessage(
   [in,unique] IMailMsgProperties *pMsg,
   [in] DWORD dwFlags,
   [out] IMailMsgPropertyStream **ppStream,
   [out] PFIO_CONTEXT * ppFIOContentFile,
   [in,unique] IMailMsgNotify *pNotify
);
pMsg
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:

See Also

IMailMsgNotify Interface

IMailMsgNotify.Notify

IMailMsgStoreDriver.CloseContentFile