DriverProc Syntax

The DriverProc entry point has the following calling syntax:

LRESULT WINAPI DriverProc (dwDriverID, hDriver, uMsg, lParam1, lParam2)

This entry point has the task of responding to the messages received in uMsg. The lParam1 and lParam2 parameters contain any flags and data needed for the task requested by uMsg. The definition of these parameters depends upon the message received. The low-order word of the dwDriverID parameter contains the device ID. The hdriver parameter contains the device handle. When you add this entry point to your device driver, remember that you must export it.

The return values for the low-order word of DriverProc are listed in the function and message reference for MCI commands. General error returns are listed with the mciSendCommand function. Error returns specific to opening a device are listed with the MCI_OPEN message. (The error returns listed with mciSendString are returned by MCI and your device driver does not need to return them.)

The high-order word of DriverProc return value is used by mciSendString to translate information returned in data structure used with lParam2. For information on the contents of the high-order word of the DriverProc return value, see “Returning Information in the MCI Data Structure,” later in this chapter.