Normally, your device driver returns control to the application immediately after processing the command message. For many devices, control returns to the application even if it takes several minutes for the hardware to complete the action initiated by the command.
If an application uses the MCI_WAIT flag, your device driver needs to delay returning to the calling application while the device completes the action requested. While your device driver waits for the device to finish, it should periodically call mciDriverYield to let Windows process other tasks and to let it check for the MCI break key.