Declarations

To bypass the PSTDisableGrow policy and to follow the steps in this article, make sure that you have the following declarations in the MAPI header files of the Windows Platform software development kit (SDK).

You must sign this DLL by using a digital certificate that is trusted on a user's computer. Any digital certificate that is trusted for code signing will work. For more information about how to sign and check code, visit the following Microsoft Developer Network (MSDN) Web site:

The PST provider uses the WinTrust API to verify that the DLL is signed and trusted.

The PST provider loads the DLL that calls the HrTrustedPSTOverrideHandlerCallback export statement. The export statement passes an IMsgStore* pointer to the PST’s store object. The export statement also passes an IUnknown pointer and the LPVOID parameter from step 1 to the PST’s override object.

Notes

We recommend that the DLL use the IMsgStore* pointer to verify that the particular store is one that the third-party code can use.

We recommend that the DLL checks the process to make sure that the DLL is not unlocking the PST for code it does not know about.

The DLL calls the QueryInterface function on the override object for the IPSTOVERRIDE1 interface.

The DLL calls the IPSTOVERRIDE1::OverridePSTDisableGrow() method, and this method sets a flag to unlock the store for the rest of the session.

If the DLL wants to unlock the PST for other processes, the DLL calls the IPSTOVERRIDE1::SetPersistedRegistrations() method by passing the path of the DLL in a SPropValue property that has the following characteristics:

A ulPropTag of PROP_TAG(PT_MV_UNICODE, PROP_ID_NULL)

A Value.MVszW property that is set to an array of strings

The SPropValue property is stored in a MAPI property in the PST’s internal range. This property is inaccessible to ordinary MAPI applications.

Notes

The IPSTOVERRIDE1::SetPersistedRegistrations() method is not implemented for non-Unicode PSTs.

To avoid dynamic linking concerns with .exe files, the IPSTOVERRIDE1::SetPersistedRegistrations() method will preemptively fail if any of the paths in the array do not have a file name extension of .dll.

When you use persisted registrations, this adversely affects the performance of applications, such as Outlook and Windows Desktop Search, that open PSTs. Developers should consider the performance effect when they use or expand the usage of persisted registrations.

Control flow for future unlocks

When you load the PST provider, it detects that one or more DLLs were registered by using the IPSTOVERRIDE1::SetPersistedRegistrations() method.

The PST provider calls the IPSTOVERRIDEREQ::RegisterTrustedPSTOverrideHandler method by using the path of the DLL.

Note The LPVOID parameter will be NULL in this scenario.

Steps 2 through 6 of the “Control flow for the initial unlock” section are now repeated.