2.3.10 Extended Device Driver interface model

The interface model for the Telephony SPI is an extension of the Installable Device Driver model as described in the Windows SDK. In keeping, with this model, Telephony Service Providers are DLLs that implement the standard Device Driver entry point DriverProc in addition to the usual LibMain and WEP entry points as other DLLs. The DriverProc procedure must handle at least the six driver messages defined for loading and unloading drivers:

DRV_CLOSE

Notifies an installable driver that Windows will decrement the use count for the driver and send a DRV_FREE message if the usage count reaches zero.


For completeness, it is best if a Service Provider implements the full set of defined driver messages, with at least a default implementation. The sample DriverProc supplied with Windows 3.1 SDK online help documentation is an excellent starting point, and may be ideal for most Telephony Service Providers.

Traditional Device Drivers have no more than the three entry points mentioned above. All requests to the driver are expressed as additional device-specific messages passed to the DriverProc procedure. The TSPI departs from this entry point model. It adds a procedure for each additional, device-specific function. These additional procedures are EXPORTED procedures just as in any DLL. The TAPI DLL calls these functions once the driver is loaded using the standard dynamic linkage mechanism for calling DLLs. Since the TAPI DLL can interact concurrently with several different Service Providers, it dynamically loads a table of entry points from each driver for all the TSPI functions it calls.

The TSPI also defines several circumstances in which the Service Provider informs the TAPI DLL of some occurrence. During early initialization, the TAPI DLL passes pointers to several callback procedures that the Service Provider, on its own initiative, calls to report these events. There is no directly corresponding mechanism in the traditional device driver model.