Every user-mode driver must export a DriverProc function. Each DriverProc function must recognize a set of standard driver messages, which are defined in mmsystem.h. A driver receives the following standard messages, in the order listed, when an application uses the driver to perform input or output operations.
Message |
Operation Performed by Driver |
Performs post-load operations. | |
No operations performed under Windows NT. | |
Opens a driver instance. | |
Closes a driver instance. | |
No operations performed under Windows NT. | |
Performs pre-unload operations. |
Additionally, a driver can receive the following standard messages, which are typically sent from a Control Panel application during installation and configuration operations.
Message |
Operation Performed by Driver |
Installs the kernel-mode driver. | |
Installs a kernel-mode driver, using Plug and Play configuration information. | |
Obtains configuration parameters. | |
Indicates whether configuration parameters can be modified. |
Although applications can send standard driver messages directly by calling SendDriverMessage, described in the Win32 SDK, typically they do not. Instead, they call functions provided by higher level multimedia APIs. These APIs in turn act as clients to the user-mode drivers and send messages by:
Besides supporting the standard driver messages, a user-mode multimedia driver’s DriverProc function generally also supports a set of customized driver messages.