To build a device-driver DLL, you must have a module-definition (.DEF) file. In the module-definition file, you must export at least two of the following entry-point functions:
DriverProc must be exported for all audio device drivers.
wodMessage must be exported for waveform output drivers.
widMessage must be exported for waveform input drivers.
modMessage must be exported for MIDI output drivers.
midMessage must be exported for MIDI input drivers.
auxMessage must be exported for auxiliary audio drivers.
Functions are exported by ordinal, as shown in the following example SNDBLST2.DEF file:
LIBRARY SNDBLST2
DESCRIPTION 'wave,midi:Creative Labs Sound Blaster 1.5'
EXETYPEWINDOWS
PROTMODE
CODEMOVEABLE DISCARDABLE LOADONCALL
DATAFIXED SINGLE PRELOAD
SEGMENTS
_TEXTFIXEDPRELOAD
INITMOVEABLEDISCARDABLEPRELOAD
COMMONMOVEABLEDISCARDABLEPRELOAD
WAVEMOVEABLEDISCARDABLEPRELOAD
MIDIMOVEABLEDISCARDABLEPRELOAD
HEAPSIZE148
EXPORTS
DriverProc@1
wodMessage@2
widMessage@3
modMessage@4
midMessage@5
The actual ordinal values you assign to each exported function are not significant, though each must be unique within the DLL.
See “Entry-Point Functions,” later in this chapter, for more information on the entry-point functions listed in this example.
The module name line should specify a unique module name for your device driver. Windows will not load two different modules with the same module name. It's a good idea to use the base of your driver filename since, in certain instances, LoadLibrary will assume that to be your module name. For example, the previous fragment used LIBRARY SNDBLST2.
The module description line in the module-definition file should specify the type of device the driver supports. For example, here's the module description line from the module-definition file for the Sound Blaster driver:
DESCRIPTION 'wave,midi:Microsoft Sound Blaster waveform and MIDI driver'
The beginning of the module description indicates the driver supports both waveform and MIDI devices. Use one of the following device-type names, followed by a colon (:) to indicate the type of device your driver supports. If the driver supports more than one type of device, separate each device-type name with a comma (,).
wave for waveform audio devices
midi for MIDI audio devices
aux for auxiliary audio devices
The Drivers option in the Control Panel uses these names to identify different types of drivers and to create the entry in the [Drivers] section of SYSTEM.INI when installing a driver.