How to implement a PST override handler to bypass the PSTDisableGrow policy in Outlook 2007
| Article ID | : | 956070 |
| Last Review | : | August 6, 2008 |
| Revision | : | 1.0 |
INTRODUCTION
MORE INFORMATION
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).
// {892EBC6D-24DC-4d90-BA48-C6CBEC14A86A} DEFINE_GUID(IID_IPSTOVERRIDEREQ, 0x892ebc6d, 0x24dc, 0x4d90, 0xba, 0x48, 0xc6, 0xcb, 0xec, 0x14, 0xa8, 0x6a); // {FBB68D34-F561-44fb-A8CA-AE36696342CA} DEFINE_GUID(IID_IPSTOVERRIDE1, 0xfbb68d34, 0xf561, 0x44fb, 0xa8, 0xca, 0xae, 0x36, 0x69, 0x63, 0x42, 0xca); // IPSTOVERRIDEREQ #define MAPI_IPSTOVERRIDEREQ_METHODS(IPURE) MAPIMETHOD(RegisterTrustedPSTOverrideHandler) (THIS_ LPCWSTR pwzDllPath, LPVOID pvClientData) IPURE; #undef INTERFACE #define INTERFACE IPSTOVERRIDEREQ DECLARE_MAPI_INTERFACE_(IPSTOVERRIDEREQ, IUnknown) { BEGIN_INTERFACE MAPI_IUNKNOWN_METHODS(PURE) MAPI_IPSTOVERRIDEREQ_METHODS(PURE) }; // IPSTOVERRIDE1 #define MAPI_IPSTOVERRIDE1_METHODS(IPURE) MAPIMETHOD(GetPersistedRegistrations)(THIS_ SPropValue **ppmval) IPURE; MAPIMETHOD(SetPersistedRegistrations)(THIS_ SPropValue *pmval) IPURE; MAPIMETHOD(OverridePSTDisableGrow)(THIS) IPURE; #undef INTERFACE #define INTERFACE IPSTOVERRIDE1 DECLARE_MAPI_INTERFACE_(IPSTOVERRIDE1, IUnknown) { BEGIN_INTERFACE MAPI_IUNKNOWN_METHODS(PURE) MAPI_IPSTOVERRIDE1_METHODS(PURE) };
Setup
Assume that you have a DLL that was created by a third-party. The DLL contains the following export statement.
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:
extern C HRESULT __cdecl HrTrustedPSTOverrideHandlerCallback(IMsgStore *pmstore, IUnknown *pOverride, LPVOID pvClientData)
After you sign the DLL, you must enable the PSTDisableGrowAllowAuthenticodeOverrides registry value to bypass the PSTDisableGrow policy. To do this, follow these steps:
| a. | Click Start, click Run, type regedit, and then click OK. |
| b. | Locate the following registry subkey:
HKCU Software Policies Microsoft Office <version> Outlook PST
|
| c. | Click the Edit menu, point to New, and then click DWORD Value. |
| d. | Type PSTDisableGrowAllowAuthenticodeOverrides, and then press ENTER. |
| e. | Right-click PSTDisableGrowAllowAuthenticodeOverrides, and then click Modify. |
| f. | In the Value data box, type 1, and then click OK. |
After you enable this registry value, you must manage the user’s trust list, especially the list of Trusted Root Certification Authorities.
Control flow for the initial unlock
The following sequence of events occurs after the Setup process:
| 1. | The application code loads a PST store, it calls the QueryInterface function on the message store for the IPSTOVERRIDEREQ interface, and then it calls the following method:
|
||||||||||
| 2. | The PST provider uses the WinTrust API to verify that the DLL is signed and trusted. | ||||||||||
| 3. | The PST provider loads the DLL that calls the HrTrustedPSTOverrideHandlerCallback export statement. The export statement passes in 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
|
||||||||||
| 4. | The DLL calls the QueryInterface function on the override object for the IPSTOVERRIDE1 interface. | ||||||||||
| 5. | The DLL calls the IPSTOVERRIDE1::OverridePSTDisableGrow() method, and this method sets a flag to unlock the store for the rest of the session. | ||||||||||
| 6. | 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:
The SPropValue property is stored in a MAPI property in the PST’s internal range. This property is inaccessible to ordinary MAPI applications. Notes
|
Control flow for future unlocks
| 1. | When you load the PST provider, the PST provider detects that one or more DLLs have been registered by using the IPSTOVERRIDE1::SetPersistedRegistrations() method. |
| 2. | 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. |
| 3. | Steps 2 through 6 of the “Control flow for the initial unlock†section are now repeated. |
REFERENCES
Keywords: |
kbpubtypekc kbinfo kbhowto KB956070 |
Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
Microsoft Corporation. All rights reserved. Terms of Use | Trademarks
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Back to the top
Leave a Reply