DRV_OPEN

The DRV_OPEN message requests a user-mode multimedia driver to open a driver instance.

Parameters
dwDriverID
Specifies the driver instance identifier. This value is zero for the DRV_OPEN message.
hDriver
Driver handle.
uMsg
DRV_OPEN
lParam1
Address of a string containing any characters following the driver’s file name in the Windows NT Registry.
lParam2
Typically an interface-specific data structure. For example, MCI drivers received the address of an MCI data structure.
Return Value

The driver should return a nonzero value if the operation succeeds. Otherwise it should return zero. (See the following Comments section.)

Comments

The DRV_OPEN message is one of the standard driver messages. A client sends the message by calling the driver’s DriverProc entry point, passing the specified parameter values.

The nonzero return value is saved by winmm.dll and used as the dwDriverID input value for subsequent calls to DriverProc. Because multiple driver instances can be opened simultaneously, drivers typically use this value to identify driver instance data. For example, the value could be an index into a driver-defined array, where each array element is a local, dynamically allocated structure containing driver instance data. When the driver receives subsequent calls to DriverProc for the open instance, it can use the dwDriverID value to determine which set of instance data to use.

Drivers receive DRV_LOAD and DRV_ENABLE messages before receiving DRV_OPEN.

Audio device drivers receive customized driver messages for opening driver instances. These drivers can ignore DRV_OPEN.