MDM provides resource management to MCDs using the following messages:
MCIDRV_RESTORE and MCIDRV_SAVE allow the MDM to tell the MCD when to make a device context active and inactive. These commands are always sent with the MCI_WAIT flag on. Not all MCDs need to support these messages completely, but they are provided. The MCIDRV_SAVE and MCIDRV_RESTORE messages are not sent by applications.
After sending an MCI_OPEN message, the MDM sends an MCIDRV_RESTORE message to the MCD to make the device context active. The MCD should not expect to always receive an MCIDRV_RESTORE message right after an MCI_OPEN. Certain conditions require a device context to be opened but not made active. One such condition is if a device context is opened as non-shareable, and then a second device context is opened as shareable. The second device context is opened and put in the inactive stack by the MDM. Therefore, MCDs should not make a device context active on an open, but only on an MCIDRV_RESTORE.
MDM sends an MCIDRV_SAVE message to the MCD to make an instance inactive. When the MCD receives the save message, it should query the state of the device (its file location, track, volume level, and so on) and save this data in the instance structure. The instance should also be placed in a paused state. Upon receiving the restore command, the driver should restore the device based on the state information in the instance. If the device was playing or recording when it was saved, then it should be put back into that state on the restore.
The following commands can be sent to inactive instances:
MCDs should be able to handle these commands at any time for any device context. Once the first RESTORE is complete, other commands can be processed.
Note: For detailed descriptions of MCIDRV_RESTORE and MCIDRV_SAVE, refer to "Subsystem Messages" in the OS/2 Multimedia Programming Reference.