Friday, June 17, 2016

May I Make a Feature Request?

Yes, please fill this form. Please note that not every feature request will be accepted.

How Do I Get the WDM Device Object of a Bus Filter?

BFF provides the following routine for this purpose:
PDEVICE_OBJECT BffDeviceWdmGetDeviceObject(WDFOBJECT BffDevice);

where BffDevice is the WDF general object handle to the bus filter device object.

Thursday, June 16, 2016

BffDeviceWdmGetPhysicalDevice

Description


Retrieve the PDO from the device stack of the specified WDF object.

Declaration

PDEVICE_OBJECT BffDeviceWdmGetPhysicalDevice(WDFOBJECT BffDevice);

Parameter


BffDeviceThe WDF object as a bus filter device object.

Return value


The PDO for success; NULL otherwise.

BffDeviceWdmGetAttachedDevice

Description


Retrieve the next lower WDM device object in the device stack of the specified WDF object.

Declaration

PDEVICE_OBJECT BffDeviceWdmGetAttachedDevice(WDFOBJECT BffDevice);

Parameter


BffDeviceThe WDF object as a bus filter device object.

Return value


The next lower WDM device object for success; NULL otherwise.

BffDeviceWdmGetDeviceObject

Description


Retrieve the WDM bus filter device object that is associated with the specified WDF object.

Declaration

PDEVICE_OBJECT BffDeviceWdmGetDeviceObject(WDFOBJECT BffDevice);

Parameter


BffDeviceThe WDF object as a bus filter device object.

Return value


The WDM bus filter device object for success; NULL otherwise.

BffPreprocessQueryBusRelations

Description


The callback function for an upper filter driver to preprocess IRP_MN_QUERY_DEVICE_RELATIONS/BusRelations before KMDF. This routine can be passed as EvtDeviceWdmIrpPreprocess into WdfDeviceInitAssignWdmIrpPreprocessCallback for IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS, or be invoked in an upper filter driver's EvtDeviceWdmIrpPreprocess callback function. In the latter case, the upper filter driver must return the value that this routine returns.

Declaration

NTSTATUS BffPreprocessQueryBusRelations(WDFDEVICE Device, PIRP Irp);

Parameters


DeviceThe WDF device object representing an upper filter device object.
IrpThe IRP_MN_QUERY_DEVICE_RELATIONS I/O request packet.

Return value


The value that WdfDeviceWdmDispatchPreprocessedIrp returns.

BffAllocateContext

Description


Allocate context space for an upper filter device object on behalf of Bus Filter Framework. This routine is typically called in the EvtDriverDeviceAdd callback function.

Declaration

NTSTATUS BffAllocateContext(WDFDEVICE Device);

Parameters


DeviceThe WDF device object representing an upper filter device object.

Return value


The value that WdfObjectAllocateContext returns.