Preparing Data Blocks

Because audio data blocks must be accessed at interrupt time, the memory allocated for them is subject to the requirements mentioned in . 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 appropriate _PREPARE and _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 either respond to both the _PREPARE and _UNPREPARE message or to neither.