Obtaining an HDAUDIO_BUS_INTERFACE_V2 DDI Object

The following table shows the input parameter values that the function driver writes into the IRP_MN_QUERY_INTERFACE IOCTL to obtain an HDAUDIO_BUS_INTERFACE_V2 structure and a context object for the version of the HD Audio DDI that this structure defines.

Parameter Value

CONST GUID *InterfaceType

GUID_HDAUDIO_BUS_INTERFACE_V2

USHORT Size

sizeof(HDAUDIO_BUS_INTERFACE_V2)

USHORT Version

0x0100

PINTERFACE Interface

Pointer to HDAUDIO_BUS_INTERFACE_V2 structure

PVOID InterfaceSpecificData

NULL

The function driver allocates the storage for the HDAUDIO_BUS_INTERFACE_V2 structure and includes a pointer to this structure in the IOCTL. In the previous table, the pointer to the HDAUDIO_BUS_INTERFACE_V2 structure is cast to type PINTERFACE, which is a pointer to a structure of type INTERFACE. The names and types of the first five members of HDAUDIO_BUS_INTERFACE_V2 match those of the five members of INTERFACE. HDAUDIO_BUS_INTERFACE_V2 contains additional members that are function pointers to the DDI routines. In response to receiving the IOCTL from the function driver, the HD Audio bus driver populates the HDAUDIO_BUS_INTERFACE_V2 structure.

The following table shows the values that the HD Audio bus driver writes into the first five members of the HDAUDIO_BUS_INTERFACE_V2 structure.

Member Value

USHORT Size

sizeof(HDAUDIO_BUS_INTERFACE_V2)

USHORT Version

0x0100

PVOID Context

Context information that must be passed as the first call parameter to every DDI routine.

PINTERFACE_REFERENCE InterfaceReference

A pointer to a routine that increments the context object's reference count.

PINTERFACE_DEREFERENCE InterfaceDereference

A pointer to a routine that decrements the context object's reference count.

In the previous table, the Context member points to a context object that contains information that is specific to the particular instance of the baseline HD Audio DDI. The client obtains this baseline HD Audio DDI from the IOCTL. When the client function driver calls any of the routines in the DDI, it must always specify the Context member value as the first call parameter. The context information is opaque to the client. The HD Audio bus driver creates a different context object for each client. When the context object is no longer required, the client frees the context object by calling the InterfaceDereference routine shown in the previous table. If it is required, a client can create additional references to the object by calling the InterfaceDereference routine, but the client is responsible for releasing these references when it no longer requires them.