MXDM_OPEN

The MXDM_OPEN message requests a user-mode mixer driver to open an instance of the specified device.

Parameters

uDeviceId

Device identifier (0, 1, 2, and so on) for the target device.

uMsg

MXDM_OPEN

dwUser

Address of location into which driver places instance identifier.

lParam1

Pointer to a MIXEROPENDESC structure.

lParam2

Contains flag values. This is always CALLBACK_FUNCTION. (See Comments section below.)

Return Value

The driver should return MMSYSERR_NOERROR if the operation succeeds. Otherwise it should return one of the MMSYSERR or MIXERR error codes defined in mmsystem.h. See mixerOpen return values in the Win32 SDK.

Comments

A client sends the MXDM_OPEN message by calling the user-mode driver's mxdMessage entry point, passing the specified parameters.

Often, creating a driver instance simply entails creating an instance-specific data structure. The instance identifier can be a handle to this structure.

Even though the description of mixerOpen in the Win32 SDK lists numerous flag values, these flags are handled within winmm.dll.

According to the description of mixerOpen in the Win32 SDK, the only acceptable callback target is a window handle. Code within winmm.dll pre-empts this callback target by placing the address of a local callback function in the MIXEROPENDESC structure, and setting the CALLBACK_FUNCTION flag in lParam2. The driver calls DriverCallback at the appropriate times, specifying the callback function. The callback function, within winmm.dll, then sends a callback message to the client-specified window handle.