BUS_INTERFACE_REFERENCE structure (ks.h)

A software device enumerator exports this interface to allow drivers to reference count physical device objects (PDOs) such that the device remains active while in use and is unloaded when not in use.

Syntax

typedef struct {
  INTERFACE                  Interface;
  PFNREFERENCEDEVICEOBJECT   ReferenceDeviceObject;
  PFNDEREFERENCEDEVICEOBJECT DereferenceDeviceObject;
  PFNQUERYREFERENCESTRING    QueryReferenceString;
} BUS_INTERFACE_REFERENCE, *PBUS_INTERFACE_REFERENCE;

Members

Interface

Specifies the exported INTERFACE.

ReferenceDeviceObject

Pointer to a driver-supplied KStrReferenceDeviceObject routine.

DereferenceDeviceObject

Pointer to a driver-supplied KStrDereferenceDeviceObject routine.

QueryReferenceString

Pointer to a driver-supplied KStrQueryReferenceString routine.

Remarks

A driver obtains a BUS_INTERFACE_REFERENCE interface by creating and sending an IRP_MJ_PNP request that specifies an IRP_MN_QUERY_INTERFACE minor function code. To do this, the driver should:

  • Allocate and zero-fill a BUS_INTERFACE_REFERENCE structure from the paged memory pool.
  • Create an IRP for the query interface request and get the next stack location for the new IRP.
  • In the new stack location, provide a pointer to the new BUS_INTERFACE_REFERENCE structure in the Parameters.QueryInterface.Interface member.
  • Set a completion routine and send the request down the driver stack.
  • If your request is successful, the system fills in the BUS_INTERFACE_REFERENCE structure pointed to by Parameters.QueryInterface.Interface.

Requirements

Requirement Value
Header ks.h (include Ks.h)