MCI calls the entry point DriverProc in response to the mciSendCommand, mciSendString, or mciExecute functions. With the exception of system messages (MCI_SOUND, MCI_BREAK, and MCI_SYSINFO) and the MCI_OPEN and MCI_CLOSE messages, MCI sends the mciSendCommand parameters directly to DriverProc.
For mciSendString and mciExecute, MCI translates the string parameters to parameters used by DriverProc. MCI uses the information stored in the MCI command tables to convert MCI command strings to MCI command messages.
If you are writing a device driver that uses a command set already defined for the device type, you can use an existing command table to convert the command strings to command messages. When using a command table that is already defined, you only need to create the handler for the command messages. MCI will automatically translate the command strings to the command messages. In this case, the information you need to know is contained in the sections on handling MCI Messages.
If your device driver extends command messages or adds new command messages, then you will need to write the message handler and extend the command tables. Writing the message handler is described in the sections on handling MCI Messages. Creating a new message or extending a message is described in “Adding New MCI Commands,” later in this chapter.