MXDM_OPEN

Sent to an audio mixer device driver to allocate a specified device for use by a client application. This message is normally sent to an audio mixer driver in response to a mixerOpen call. Applications using the audio mixer functions are not required to open a device to use it, but they must do so if they desire line and control notification callbacks.

MMSYSERR_ALLOCATED

The device is already allocated by the maximum number of clients the driver supports, or the device cannot be opened because of system resource limitations other than memory.

MMSYSERR_NOMEM

The device cannot be opened because of a failure allocating memory.

MMSYSERR_NOTENABLED

The driver failed to load or initialize.


dwParam1

Specifies a pointer to a MIXEROPENDESC structure. This structure contains additional information for the driver, such as instance data and a callback for the client.

dwParam2

Specifies option flags for opening the device.

CALLBACK_EVENT

Specifies that MIXEROPENDESC.dwCallback is an event handle.

CALLBACK_FUNCTION

Specifies that MIXEROPENDESC.dwCallback is a callback procedure address.

CALLBACK_THREAD

Specifies that MIXEROPENDESC.dwCallback is a thread handle.

CALLBACK_WINDOW

Specifies that MIXEROPENDESC.dwCallback is a window handle.


The driver must determine the number of clients allowed to use a particular device. Once a device is opened for the maximum number of clients that it supports, that driver should return MMSYSERR_ALLOCATED for any additional open requests.

A mixer driver must be written to allow multiple opens on a single device (thus allowing more than one client to receive notifications).

An audio mixer driver must support this message. The Mixer Manager will validate the following parameters for the MXDM_OPEN message before calling the driver. Your driver does not need to check for the following conditions:

1 dwParam1 will contain a valid pointer to a MIXEROPENDESC structure. This structure will be at least large enough to hold the base MIXEROPENDESC structure members. All members of this structure will be valid.

2 dwParam2 will be a valid combination of flags.

Note

The Mixer Manager might combine several opens and closes from many applications. During debugging, if you notice that only one MXDM_OPEN message gets sent even if more than one application opens the device, the Mixer Manager probably has combined the open requests.