Registering Extensions

Before an extension can be used within the Microsoft Exchange client, it must be registered. Registering an extension lets Microsoft Exchange know about its existence and provides other information about the extension so that Microsoft Exchange can work with it in an efficient manner.

On 16-bit versions of Windows, extensions are registered by adding entries to the [Extensions] section of the EXCHNG.INI file. These 16-bit clients include Windows 3.1 and Windows for Workgroups 3.x. Information on shared extensions is read from the [Extensions] section of the SHARED.INI file on 16-bit versions of Windows.

On 32-bit versions of Windows, Microsoft Exchange obtains extension-specific information from HKEY_LOCAL_MACHINE\Software\Microsoft\Exchange\Client\Extensions in the Windows NT or Windows 95 registry.

Information on shared extensions is read from the SHARED32.INI file on these 32-bit versions of Windows. The location of the SHARED.INI file is specified by the SharedExtsDir entry in the [Exchange] section of the EXCHNG.INI file. The location of the SHARED32.INI file is specified in the SharedExtsDir entry in HKEY_LOCAL_MACHINE\Software\Microsoft\Exchange\Client\Extensions.

If the directory is on a network drive, the SharedExtsServer entry can contain the name of the server and the SharedExtsPassword entry contains an unencrypted password. If this is the case, a connection to the server is made without redirecting a local device name.

The 32-bit clients cannot use 16-bit extensions, nor can 16-bit clients use 32-bit extensions.

When registering an extension, a specific syntax places your entry in the .INI file or registry. This syntax is as follows:

Tag=Version;<ExtsDir>DllName;[Ordinal];[ContextMap];[InterfaceMap];[Provider]

The following table shows the parameters used in the syntax line.

Parameter Description
Tag An extension identifier that uniquely identifies the .INI entry from other .INI entries.
Version The version number of the Microsoft Exchange client; for example '4.0'.
DLLName The path to the DLL containing the extension.
Ordinal An optional field that specifies the entry point in the DLL to retrieve the extension object. If this field is empty, the default value is 1.
ContextMap An optional string made up of '0' and '1' characters which indicates the contexts in which the extension should be loaded. Any unspecified values after the end of the string are assumed to be zero. If no context map is provided, the extension will be loaded in all contexts. For more information on context map bit positions, see the table later in this section.
InterfaceMap An optional string made up of '0' and '1' characters that indicates the interfaces the extension supports. Although supported interfaces can be obtained through IUnknown::QueryInterface, registering which interfaces your extension supports can increase system performance. For more information on interface map bit positions, see the table later in this section.
Message Service An optional string containing the PR_SERVICE_NAME, not the display name, of a message service that your extension is designed to work with. For example, if your extension is designed to work with a custom address book, place the PR_SERVICE_NAME of the address book in this parameter. If your extension is not provider-specific, this parameter should be omitted.

An example of this syntax is:

MyExtension=4.0;<ExtsDir>MYEXT.DLL;2;010001;1100000
 

In this example, EECONTEXT_VIEWER=0x00000002 and EECONTEXT_SENDNOTEMESSAGE =0x00000006 so the ContextMap string '010001' indicates that the extension located at MYEXT.DLL;2 should be loaded only for these two contexts. The interface map, specified by the string 1100000, indicates that the extension implements only the IExchExtCommands : IUnknown and IExchExtUserEvents : IUnknown interfaces.

Throughout the string, all occurrences of the string '<ExtsDir>' are replaced with the value of the SharedExtsDir entry described below. Extensions that are not shared should not use this.

The following tables indicate which positions in the Context Map and Interface Map correspond to which contexts and interfaces, respectively.

Context Map Bit Positions

Position Context
1 EECONTEXT_SESSION
2 EECONTEXT_VIEWER
3 EECONTEXT_REMOTEVIEWER
4 EECONTEXT_SEARCHVIEWER
5 EECONTEXT_ADDRBOOK
6 EECONTEXT_SENDNOTEMESSAGE
7 EECONTEXT_READNOTEMESSAGE
8 EECONTEXT_SENDPOSTMESSAGE
9 EECONTEXT_READPOSTMESSAGE
10 EECONTEXT_READREPORTMESSAGE
11 EECONTEXT_SENDRESENDMESSAGE
12 EECONTEXT_PROPERTYSHEETS
13 EECONTEXT_ADVANCEDCRITERIA
14 EECONTEXT_TASK

Interface Map Bit Positions

Position Interface
1 IExchExtCommands
2 IExchExtUserEvents
3 IExchExtSessionEvents
4 IExchExtMessageEvents
5 IExchExtAttachedFileEvents
6 IExchExtPropertySheets
7 IExchExtAdvancedCriteria