Using a wrapped PST store provider
Applies to: Outlook 2013 | Outlook 2016
Before you can use a wrapped Personal Folders file (PST) store provider, you must initialize and configure the wrapped PST store provider. After the wrapped PST store provider is configured, you must implement functions so that MAPI and the MAPI spooler can log on to the message store provider. For more information about initializing and logging on to a wrapped PST store provider, see Initializing a Wrapped PST Store Provider and Logging On to a Wrapped PST Store Provider.
The IMAPISupport::IUnknown interface provides implementations for tasks that are commonly performed by message store providers. This interface must be wrapped for the Sample Wrapped PST Store Provider to work. The IMAPISupport::OpenProfileSection function requires special implementation. All other functions can pass their parameters to the underlying wrapped object.
In this topic, the IMAPISupport::OpenProfileSection 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.
When you finish using a wrapped PST store provider, you must properly shut down the wrapped PST store provider. For more information, see Shutting Down a Wrapped PST Store Provider.
Open Profile Section routine
The IMAPISupport::OpenProfileSection function opens a section of the current profile. The function requires special handling in the wrapped PST store provider implementation. When the pgNSTGlobalProfileSectionGuid
is requested, the function returns the profile section that is cached.
CSupport::OpenProfileSection() example
STDMETHODIMP CSupport::OpenProfileSection(
LPMAPIUID lpUid,
ULONG ulFlags,
LPPROFSECT * lppProfileObj)
{
Log(true,"CSupport::OpenProfileSection\n");
if (lpUid &&
IsEqualMAPIUID(lpUid, (void *)&pbNSTGlobalProfileSectionGuid) &&
m_lpProfSect)
{
// Allow the opening of the Global Section
if (m_lpProfSect)
{
*lppProfileObj = m_lpProfSect;
(*lppProfileObj)->AddRef();
return S_OK;
}
}
return m_pMAPISup->OpenProfileSection(lpUid, ulFlags, lppProfileObj);
}