Audio Device Messages for MIDI
In Windows XP and later versions of Windows (including Windows Vista), the operating system communicates with musical instrument digital interface (MIDI) input and output drivers by using audio device messages.
Every MIDI input and output driver must have one DriverProc entry-point function to enable or disable the driver. Additionally, it must have an additional entry-point function to process messages from the Windows operating system. In the case of MIDI output drivers, the additional entry-point function is modMessage, which must be provided by the manufacturer of the MIDI device. This function processes messages that WINMM sends to the MIDI output driver. WINMM is a Windows dynamic link library (DLL) module that contains functions that help the operating system and the MIDI output driver communicate with each other. Specifically, WINMM helps to manage 16-bit multimedia applications that run on Windows.
Each message received by the modMessage function comes with two pointers to DWORD variables (DWORD_PTR). For some messages, one of these parameters points to a structure that contains additional information from the client, or it points to an empty structure for the driver to fill with information for the client. One example of such a structure is MIDIOPENDESC. There are two other structures used by MIDI output device drivers and they are discussed in the Windows SDK. For more information about these structures, see MIDIHDR and MIDIOUTCAPS.
The following is a list of the audio device messages and the modMessage entry-point function that processes them for a MIDI output driver: