Partager via


Shutting Down a Message Store Provider

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

If your provider is a message store provider, it can be shut down in one of the following ways:

  • When a client or the MAPI spooler calls IMsgStore::StoreLogoff. Shutting down a message store provider with StoreLogoff causes the shutdown to occur in an orderly and controlled manner.

  • When a client calls IMAPISession::Logoff.

Your implementation of IMsgStore::StoreLogoff should begin by calling IMAPISupport::StoreLogoffTransports to inform MAPI that it is being shut down, indicating that any related transport providers should be logged off. When IMsgStore::StoreLogoff returns, its caller invokes your message store's IUnknown::Release method. Implement this Release method by calling the support object's IUnknown::Release method.

MAPI performs the following tasks in its implementation of IUnknown::Release for message stores:

  1. Removes all of the MAPIUID structures registered by the message store provider.

  2. Removes the message store provider's row from the status table.

  3. Calls IMSLogon::Logoff to release all open objects, subobjects, and status objects.

  4. Calls IUnknown::Release to release the message store provider's logon object.

Some clients might omit the call to IMsgStore::StoreLogoff, initiating the shutdown of your message store provider with the call to the message store's IUnknown::Release method. A shutdown under these circumstances without the call to StoreLogoff is less orderly and controlled. Write your message store's Release method to handle this possibility and keep track of whether or not a call to IMAPISupport::StoreLogoffTransports has occurred. StoreLogoffTransports must be called once during the shutdown process. If you detect in your Release method that StoreLogoffTransports has not yet been called, invoke it with the LOGOFF_ABORT flag.

See Also

Concepts

Shutting Down a Service Provider