Platform SDK: MAPI |
Every service provider DLL has an entry point function that MAPI calls to load it. Be aware that this entry point function is not the same as DllMain, the Win32 DLL entry point function. For information about Win32 DLL entry point functions, see the Win32 Programmer's Reference.
Depending on the type of your provider, your provider entry point function conforms to a different prototype. MAPI defines four different entry point function prototypes for service providers:
Address book providers | ABProviderInit |
---|---|
Message store providers | MSProviderInit |
Transport providers | XPProviderInit |
Messaging hook providers | HPProviderInit |
Much of the functionality in these prototypes is the same for all service provider types. Messaging hook providers do not implement the same functionality as the other providers. Whereas the other providers instantiate provider and logon objects, messaging hook providers instantiate spooler hook objects, or objects that implement the ISpoolerHook interface.
Address book, message store, and transport providers perform these two main tasks in their entry point functions:
These parameters are 32-bit unsigned integers composed of three parts:
Although the major version number rarely changes, the minor version number changes whenever MAPI is released and the SPI has changed. The micro version is the Microsoft internal build version; it is used to track changes during the development process.
MAPI defines the CURRENT_SPI_VERSION constant, documented in the MAPISPI.H header file, for indicating the present SPI version. Fail your check with the error MAPI_E_VERSION if you are using a version of the SPI that is newer than the version that MAPI is using.
Just as the entry point function prototype differs depending on the type of your provider, so does the type of provider object. If you are writing an address book provider, implement IABProvider.
If you are writing a message store provider, implement IMSProvider. See Loading Message Store Providers.
If you are writing a transport provider, implement IXPProvider. See Initializing the Transport Provider.