Bewerken

Delen via


Obtaining an HDAUDIO_BUS_INTERFACE 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 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

USHORT Size

sizeof(HDAUDIO_BUS_INTERFACE)

USHORT Version

0x0100

PINTERFACE Interface

Pointer to HDAUDIO_BUS_INTERFACE structure

PVOID InterfaceSpecificData

NULL

The function driver allocates the storage for the HDAUDIO_BUS_INTERFACE structure and includes a pointer to this structure in the IOCTL. In the preceding table, the pointer to the HDAUDIO_BUS_INTERFACE 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 match those of the five members of INTERFACE. HDAUDIO_BUS_INTERFACE 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 fills in the entire HDAUDIO_BUS_INTERFACE structure.

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

Member Value

USHORT Size

sizeof(HDAUDIO_BUS_INTERFACE)

USHORT Version

0x0100

PVOID Context

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

PINTERFACE_REFERENCE InterfaceReference

Pointer to a routine that increments the context object's reference count

PINTERFACE_DEREFERENCE InterfaceDereference

Pointer to a routine that decrements the context object's reference count

In the preceding 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 that the client obtains from the IOCTL. When calling any of the routines in the DDI, the client function driver must always specify the Context pointer 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 preceding table. If required, a client can create additional references to the object by calling the InterfaceReference routine, but the client is responsible for releasing these references when it no longer requires them.