IAllocatorMXF interface manages buffer storage for DirectMusic streams. 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.
The IAllocatorMXF interface inherits from the IUnknown interface. IAllocatorMXF also has these types of members:
The IAllocatorMXF interface has these methods.
|IAllocatorMXF::GetBuffer||The GetBuffer method allocates a buffer for long MIDI events.|
|IAllocatorMXF::GetBufferSize||The GetBufferSize method gets the buffer size from the allocator.|
|IAllocatorMXF::GetMessage||The GetMessage method serves as the retrieval point for any DirectMusic kernel-mode component that utilizes the port driver's allocator to reuse DMUS_KERNEL_EVENT structures.|
|IAllocatorMXF::PutBuffer||This method is not currently used by the miniport driver. The PutBuffer method passes a buffer to the allocator, but this occurs automatically when IMXF::PutMessage is called anyway.|