Muokkaa

Jaa


Function Tables for Miniport Drivers

A generic miniport driver's upper-edge interfaces (see WDM Audio Terminology) consist of function tables. Some non-audio miniport drivers supply the function table to the port driver during registration, at which time the miniport driver informs the port driver of the size of the context structure that the miniport driver will require. The port driver copies the function table to some private location, allocates the context structure, and calls an initialization function in the function table, passing a pointer to the context structure.

Similarly, audio miniport drivers use function tables, but they are statically allocated and do not need to be copied by the port driver. The port driver also retrieves its context ("object") memory from a specified pool and installs a pointer to the function table into the context. Because the function table pointer is always the first field in the context, the port driver needs only a context pointer and can access the function table through the context.

This approach was taken because COM supplies a solid, efficient, widely-understood model for creating abstracted objects. The audio miniport driver model leverages industry experience with COM and the body of COM literature. Objects can be implemented and used in C or C++. Assembly language can also be used, but should only be used where portability is not required.