DriverProc Parameters

The DriverProc function is defined as follows:

LRESULT WINAPI DriverProc (
    DWORD dwDriverID,
    HDRVR hDriver,
    UINT uMsg,
    LPARAM lParam1,
    LPARAM lParam2
    );

When winmm.dll passes MCI messages to DriverProc, the function parameters are used as follows:

dwDriverID
Contains the driver identifier created by MCI.
hDriver
Contains a handle to the device driver.
uMsg
Contains an MCI message constant value.
lParam1
Contains message-specific MCI flags.
lParam2
Points to a message-specific MCI data structure.

The lParam1 and lParam2 parameters generally are used to represent MCI command arguments. Some arguments can simply be represented as flags in lParam1. Other arguments are passed as members of a data structure pointed to by lParam2. In this latter case, lParam1 flags are used to indicate the presence of valid members within the structure pointed to by lParam2. This structure is also used for returning information to the application.

There is a unique lParam2 data structure for each MCI message. Additionally, driver developers can define customized structures for extended commands. All of the data structures provided by Microsoft are defined in mmsystem.h and described in the Win32 SDK. Refer to Creating New MCI Command Structures to learn how to create custom structures.