The HPProviderInit function initializes a messaging hook provider for operation.
Header file: | MAPIHOOK.H |
Implemented by: | Messaging hook providers |
Called by: | MAPI |
HRESULT HPProviderInit(
LPMAPISESSION lpSession,
HINSTANCE hInstance,
LPALLOCATEBUFFER lpAllocateBuffer,
LPALLOCATEMORE lpAllocateMore,
LPFREEBUFFER lpFreeBuffer,
LPMAPIUID lpSectionUID,
ULONG ulFlags,
LPSPOOLERHOOK FAR * lppSpoolerHook
);
MAPI calls the entry point function HPProviderInit to initialize a messaging hook provider following a client logon. HPProviderInit is called once for each messaging hook provider specified in the client's profile.
A messaging hook provider must implement HPProviderInit as an entry point function in the provider's DLL. The implementation must be based on the HPPROVIDERINIT function prototype, also specified in MAPIHOOK.H. MAPI defines HPPROVIDERINIT to use the standard MAPI initialization call type, STDMAPIINITCALLTYPE, which causes HPProviderInit to follow the CDECL calling convention. An advantage of CDECL is that calls can be attempted even if the number of calling parameters does not match the number of defined parameters.
A provider can be initialized multiple times as a result of appearing in several profiles in simultaneous use or of appearing more than once in the same profile. Because the provider object contains context, HPProviderInit must return a different provider object in lppSpoolerHook for each initialization, even for multiple initializations in the same process.
The messaging hook provider should use the functions pointed to by lpAllocateBuffer, lpAllocateMore, and lpFreeBuffer for most memory allocation and deallocation. In particular, the provider must use these functions to allocate memory for use by client applications when calling object interfaces such as IMAPIProp::GetProps and IMAPITable::QueryRows.
If the provider needs to use mutex objects or critical sections, it should set them up during initialization using HPProviderInit. A mutex object should be owned by the message-hook provider object created by this function.
For more information on writing HPProviderInit, see Implementing HPProviderInit for Hook Providers. For more information on entry point functions, see Implementing a Service Provider Entry Point Function.
Provider Initialization Functions, ABProviderInit, IMAPISession : IUnknown, MSProviderInit, XPProviderInit