## MMPM/2 Device Driver Reference

[prev][next][parent][TOC]

### MCI_AUDIO_HPI Field - pvCallBack ()

pvCallBack () (VOID FAR *) Pointer to the callback routine. The application passes the address of a callback routine (under DOS) or system semaphore handle (under OS/2) in pvCallBack (). Notice that the DOS callback routine must be an interrupt routine, that is, it must return with an IRET, not a RET instruction. Care must be taken not to re-enter DOS. For example, the interrupt can occur while executing a DOS call. Any call to DOS made in the callback routine will result in DOS being entered a second time and will probably cause a system halt.

If not NULL, the address is called (under DOS) or the semaphore is cleared (under OS/2) based on the state of the CBDATA, CBBLOCK, CBIOBUF, and CBERROR flags in usRunFlags:

CBDATA The address is called (under DOS) or the semaphore is cleared (under OS/2) for each data byte sent to, or received from, the device. Notice that some devices transfer data to and from the host only in blocks, in which case this bit has the same effect as CBBLOCK.

CBBLOCK The address is called or the semaphore is cleared for each complete block of data sent to, or received from, the device.

CBIOBUF The address is called or the semaphore is cleared each time the entire contents of IOBUF are sent to, or received from, the device.

CBERROR The address is called or the semaphore is cleared each time a device error is detected by the device.

CBUNDERRUN The address is called or the semaphore is cleared each time an underrun or overrun is detected by the device.

This process will continue until either the device is stopped (or closed) or the AUDIO_HPI function is called again with pvCallBack () set to NULL. The device interrupt rate generally corresponds with the position resolution returned in lResolution of the MCI_AUDIO_INIT structure.