// video.h
PVIDEO_HW_QUERY_INTERFACE PvideoHwQueryInterface;
VP_STATUS PvideoHwQueryInterface(
PVOID HwDeviceExtension,
PQUERY_INTERFACE QueryInterface
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
HwVidQueryInterface returns a miniport driver-implemented functional interface that a child device can call.
HwDeviceExtensionPointer to the miniport driver's per-adapter storage area. For more information, see Device Extensions.
QueryInterfacePointer to a QUERY_INTERFACE structure in which the miniport driver should return information about the interface it supports.
HwVidQueryInterface should return NO_ERROR upon success; otherwise it should return the appropriate error code. For example, a miniport driver should return ERROR_OUTOFMEMORY if it cannot allocate memory to complete the operation.
HwVidQueryInterface exposes a communication mechanism between the video miniport driver and the driver of a child device. A miniport driver that exposes such a mechanism should implement this function.
The video port calls HwVidQueryInterface when it receives an IRP_MN_QUERY_INTERFACE request. If the miniport driver fails the call, the video port driver passes the request to the parent of the miniport driver's device.
HwVidQueryInterface should fill in the members of the INTERFACE structure to which QueryInterface->Interface points as follows:
A miniport driver that returns an interface is responsible for referencing the interface by calling QueryInterface->Interface.InterfaceReference. The child driver requesting the interface is responsible for dereferencing it when the driver no longer requires the interface by calling QueryInterface->Interface.InterfaceDereference. If the child driver passes the interface to another component, the child is responsible for taking out another reference, and the other component is responsible for removing the additional reference when it no longer needs access to the interface. Referencing allows a parent to determine when the interface is still required by the child device, and consequently when the parent can free any interface-associated resources.
The driver of a child device can call into the miniport driver through the functions exposed by HwVidQueryInterface at any time without the video port driver's knowledge. Consequently, the miniport driver must synchronize access to itself by acquiring and releasing the video port driver-maintained device lock in all of the functions exposed by HwVidQueryInterface.
A child device is enumerated by HwVidGetVideoChildDescriptor.
HwVidQueryInterface should be made pageable.