Platform SDK: SMTP Server Events

IMailMsgStoreDriver::CloseContentHandle

[This is preliminary documentation and subject to change.]

Close the content file for the MailMsg object's associated PFIO_CONTEXT context.

HRESULT CloseContentFile(
  [in] IMailMsgProperties *pMsg, 
  [in] PFIO_CONTEXT pFIOContentFile
);
pMsg
A reference to the associated MailMsg object for which to close the content file handle. The store obtains the 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.
pFIOContentFile
The PFIO_CONTEXT context to close. This context should have been returned by one of the methods AllocMessage, ReAllocMessage, or ReOpen.

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

The PFIO_CONTEXT must be closed using the ReleaseContext function exported from fcachdll.dll. The store driver also decrements the number of outstanding PFIO_CONTEXT contexts held.

See Also

IMailMsgStoreDriver.ReOpen