Preparing Data Blocks

Because audio data blocks must be accessed at interrupt time, the memory allocated for them is subject to the requirements mentioned earlier in “Considerations for Interrupt-Driven Drivers.” Rather than have the client application prepare the memory before sending data blocks to the driver, the client requests that the driver do the preparation. Most drivers can respond to this request (the XXX_PREPARE and XXX_UNPREPARE messages) by returning a MMSYSERR_NOTSUPPORTED error. Then, MMSYSTEM will perform the necessary preparation on the data block. This preparation consists of page locking the data block so the driver can access it at interrupt time.

If your device driver does not need the data to be pagelocked (for example, if you immediately copy the data to an on-card buffer) or if you have additional preparation to do to the buffer, you might respond to these messages yourself instead of having MMSYSTEM handle them. You should respond to both XXX_PREPARE and XXX_UNPREPARE, or to neither.