The midiOutUnprepareHeader function cleans up the preparation performed by the midiOutPrepareHeader function.
MMRESULT midiOutUnprepareHeader(
HMIDIOUT hmo,
LPMIDIHDR lpMidiOutHdr,
UINT cbMidiOutHdr
);
Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following:
Value | Description | |
---|---|---|
MIDIERR_STILLPLAYING | The buffer pointed to by lpMidiOutHdr is still in the queue. | |
MMSYSERR_INVALHANDLE | The specified device handle is invalid. | |
MMSYSERR_INVALPARAM | The specified pointer or structure is invalid. |
This function is complementary to the midiOutPrepareHeader function. You must call midiOutUnprepareHeader before freeing the buffer. After passing a buffer to the device driver with the midiOutLongMsg function, you must wait until the device driver is finished with the buffer before calling midiOutUnprepareHeader.
Unpreparing a buffer that has not been prepared has no effect, and the function returns MMSYSERR_NOERROR.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in mmsystem.h.
Import Library: Use winmm.lib.
Musical Instrument Digital Interface (MIDI) Overview, MIDI Functions, midiOutPrepareHeader, MIDIHDR, midiOutLongMsg