Last modified: July 23, 2011

Applies to: Outlook

Registers a transport provider's preprocessor function (a function that conforms to the PreprocessMessage prototype).

HRESULT RegisterPreprocessor(
LPSTR lpszAdrType,
LPSTR lpszDLLName,
LPSTR lpszPreprocess,
LPSTR lpszRemovePreprocessInfo,
ULONG ulFlags


[in] A pointer to the MAPIUID structure that contains the identifier that the preprocessor function handles. The lpMuid parameter can be NULL.


[in] A pointer to the address type for the messages the function operates on, such as FAX, SMTP, or X500. The lpszAdrType parameter can be NULL.


[in] A pointer to the name of the dynamic-link library (DLL) that contains the entry point for the preprocessor function.


[in] A pointer to the name of the preprocessor function. The lpszPreprocess parameter can be NULL.


[in] A pointer to the name of the function that removes preprocessor information (a function that conforms to the RemovePreprocessInfo prototype). The lpszRemovePreprocessInfo parameter can be NULL.


Reserved; must be zero.


The preprocessor function was successfully registered.

The IMAPISupport::RegisterPreprocessor method is implemented for transport provider support objects only. Transport providers call RegisterPreprocessor to register a preprocessor function (a function that conforms to the PreprocessMessage prototype). A preprocessor function must be registered before the MAPI spooler can call it.

The lpszPreprocess, lpszRemovePreprocessInfo, and lpszDLLName parameters should all point to strings that can be used in conjunction with calls to the Win32 GetProcAddress function, allowing the preprocessor's DLL entry point to be called correctly.

Calls to preprocessors are specific to transport provider order. This means that if another transport provider ahead of your provider is able to handle a message, your preprocessor function will not be called for that message. Your preprocessor function will be called only for messages that you will handle.

You can write preprocessor functions to handle either a specific identifier stored in a MAPIUID structure or a type of address. If you specify both a MAPIUID structure in the lpMuid parameter and an address type in the lpszAdrType parameter, your function will be called for message recipients that match either the MAPIUID or the address type. If lpMuid is NULL and lpszAdrType is non-NULL, your function will be called only for recipients that have an address that matches the type pointed to by lpszAdrType. If lpMuid is non-NULL and lpszAdrType is NULL, your function will be called for recipients that match MAPIUID, regardless of their address type. If both are NULL, your function is called for all recipients of the message.