Shutting Down a Wrapped PST Store Provider

Applies to: Outlook 2013 | Outlook 2016

After you finish using a wrapped Personal Folders file (PST) store provider, you must properly shut down the wrapped PST store provider. For more information about using the wrapped PST store provider, see Using a Wrapped PST Store Provider.

To shut down a wrapped PST store provider, you must call the IMSProvider::Shutdown function. This functions closes down the wrapped PST store provider in an orderly fashion.

In this topic, the IMSProvider::Shutdown function is demonstrated by using a code example from the Sample Wrapped PST Store Provider. The sample implements a wrapped PST provider that is intended to be used in conjunction with the Replication API. For more information about downloading and installing the Sample Wrapped PST Store Provider, see Installing the Sample Wrapped PST Store Provider. For more information about the Replication API, see About the Replication API.

Shut Down Routine

The MAPI spooler calls the IMSProvider::Shutdown function just before it releases the wrapped PST store provider so that the wrapped PST store provider can shut down properly. The function terminates all session objects associated with the wrapped PST store provider.

CMSProvider::ShutDown() Example

STDMETHODIMP CMSProvider::Shutdown(ULONG * pulFlags) 
{ 
    HRESULT hRes = S_OK; 
    Log(true,"CMSProvider::Shutdown\n"); 
    hRes =m_pPSTMS->Shutdown(pulFlags); 
    Log(true,"CMSProvider::Shutdown returned: 0x%08X\n", hRes); 
    return hRes ;  
}

See also

About the Sample Wrapped PST Store Provider

Installing the Sample Wrapped PST Store Provider

Initializing a Wrapped PST Store Provider

Logging On to a Wrapped PST Store Provider

Using a Wrapped PST Store Provider