Expand Minimize

EvtDeviceFilterRemoveResourceRequirements function

[Applies to KMDF only]

A driver's EvtDeviceFilterRemoveResourceRequirements event callback function can remove resources from a set of hardware resource requirements before the system assigns resources to a device.



NTSTATUS EvtDeviceFilterRemoveResourceRequirements(
  _In_  WDFDEVICE Device,
  _In_  WDFIORESREQLIST IoResourceRequirementsList
{ ... }


Device [in]

A handle to the framework device object to which resources will be assigned.

IoResourceRequirementsList [in]

A handle to a resource-requirements-list object, which represents the device's resource requirements list.

Return value

If the driver encountered no errors it must return STATUS_SUCCESS. Otherwise it must return an NTSTATUS value that NT_SUCCESS evaluates as FALSE.

For more information about return values, see Reporting Device Failures.


Framework-based function drivers can provide an EvtDeviceFilterRemoveResourceRequirements callback function. To register this callback function, drivers call WdfFdoInitSetEventCallbacks.

To remove items from a resource requirements list, the driver calls framework resource-requirements-list object methods and framework resource-range-list object methods, which remove resources from the resource-requirements-list object that is represented by the IoResourceRequirementsList parameter.

For more information about the EvtDeviceFilterRemoveResourceRequirements callback function, see Modifying a Resource Requirements List.

For more information about hardware resources and resource requirements lists, see Hardware Resources for Framework-Based Drivers.


To define an EvtDeviceFilterRemoveResourceRequirements callback function, you must first provide a function declaration that identifies the type of callback function you’re defining. Windows provides a set of callback function types for drivers. Declaring a function using the callback function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it’s a requirement for writing drivers for the Windows operating system.

For example, to define an EvtDeviceFilterRemoveResourceRequirements callback function that is named MyDeviceFilterRemoveResourceRequirements, use the EVT_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS type as shown in this code example:


Then, implement your callback function as follows:

 MyDeviceFilterRemoveResourceRequirements (
    WDFDEVICE  Device,
    WDFIORESREQLIST  IoResourceRequirementsList

The EVT_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS function type is defined in the Wdffdo.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the _Use_decl_annotations_ annotation to your function definition. The _Use_decl_annotations_ annotation ensures that the annotations that are applied to the EVT_WDF_DEVICE_FILTER_RESOURCE_REQUIREMENTS function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for KMDF Drivers. For information about _Use_decl_annotations_, see Annotating Function Behavior.


Minimum KMDF version



Wdffdo.h (include Wdf.h)



See also




Send comments about this topic to Microsoft

© 2014 Microsoft