Platform SDK: SMTP Server Events

IMailMsgStoreDriver::ReAllocMessage

[This is preliminary documentation and subject to change.]

Re-allocates a new property stream and/or content file based on existing storage with optional asynchronous completion.

HRESULT ReAllocMessage(
   [in] IMailMsgProperties* pOriginalMsg,
   [in] IMailMsgProperties* pNewMsg,
   [out] IMailMsgPropertyStream** ppStream,
   [out] PFIO_CONTEXT* ppFIOContentFile,
   [in,unique] IMailMsgNotify* pNotify
);
pOriginalMsg
A reference to the MailMsg object from which the re-allocation is to be based. The store obtains the current associated content and stream storage information (file names or some other unique store identifier) for this MailMsg object using the MailMsg IMMPID_MPV_STORE_DRIVER_HANDLE property. The store driver will check the CLSID signature stored in this property, and will only re-open the content and/or property stream for the message if the CLSID in the signature is the CLSID of the store driver object.
pNewMsg
A reference to the new MailMsg object for which the store driver is to provide backing storage.
ppStream
Receives the new MailMsg object's associated property stream.
ppFIOContentFile
Receives the MailMsg object's associated PFIO_CONTEXT content context.
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.
NTE_BAD_SIGNATURE The signature stored in the IMMPID_MPV_STORE_DRIVER_HANDLE property does not match the CLSID of this store driver object.
E_FAIL Failure. The store driver object has not been initialized.
E_POINTER Error. NULL passed in argument list.

Remarks

This method is similar to the AllocMessage method: it allocates a new message internally using the AllocMessage function and then copies the message content from the original (first) message to the content stream for the newly allocated (second) message's content stream, normally using the CopyContentToFile method. Once completed, the new associated PFIO_CONTEXT and IMailMsgPropertyStream references are returned along with the reference to the newly created MailMsg object.

See Also

IMailMsgNotify Interface

IMailMsgNotify.Notify

IMailMsgStoreDriver::CloseContentFile

IMailMsgStoreDriver::AllocMessage

IMailMsgStoreDriver::CopyContentToFile