IAllocatorMXF

The IAllocatorMXF interface manages buffer storage for DirectMusic streams. In Windows 98/Me and in Windows 2000 and later, the DMus port driver implements this interface and exposes it to the DMus miniport driver. The DMus port driver creates an IAllocatorMXF object and passes a pointer to this object to the DMus miniport driver's IMiniportDMus::NewStream method. IAllocatorMXF inherits from the IMXF interface.

IAllocatorMXF is the interface through which the miniport driver communicates with the port driver's internal allocator, which allocates and manages the reuse of a pool of DMUS_KERNEL_EVENT structures. Each structure can contain a time-stamped MIDI event.

The allocator also abstracts the allocation of the additional memory that is needed to store large events. The uData member of DMUS_KERNEL_EVENT is a union that is the size of a pointer: four bytes on a 32-bit system and eight bytes on a 64-bit system. If the data is small enough to fit in that space, then uData will contain the actual MIDI data. If the data for that event is larger than the 4- or 8-byte pointer, however, the cbEvent member indicates this fact and uData contains a pointer to a buffer instead of the actual MIDI data. This buffer is managed by the allocator and is a constant size for any port-driver implementation.

In addition to the methods that IAllocatorMXF inherits from the IMXF interface, IAllocatorMXF supports the following methods:

IAllocatorMXF::GetBuffer

IAllocatorMXF::GetBufferSize

IAllocatorMXF::GetMessage

IAllocatorMXF::PutBuffer

 

 

Send comments about this topic to Microsoft

Show: