Bewerken

Delen via


EVT_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY callback function (wdfpdo.h)

[Applies to KMDF only]

A bus driver's EvtDeviceResourceRequirementsQuery event callback function creates a resource requirements list that represents the device's required hardware resources.

Syntax

EVT_WDF_DEVICE_RESOURCE_REQUIREMENTS_QUERY EvtWdfDeviceResourceRequirementsQuery;

NTSTATUS EvtWdfDeviceResourceRequirementsQuery(
  [in] WDFDEVICE Device,
  [in] WDFIORESREQLIST IoResourceRequirementsList
)
{...}

Parameters

[in] Device

A handle to a framework device object.

[in] IoResourceRequirementsList

A handle to a framework resource-requirements-list object that represents an empty resource requirements list.

Return value

If the driver did not encounter any errors, it must return STATUS_SUCCESS (whether or not it specifies any required hardware resource). If the driver encounters errors, it must return an NTSTATUS value that NT_SUCCESS evaluates as FALSE.

For more information about this callback function's return values, see Reporting Device Failures.

Remarks

Framework-based bus drivers can provide an EvtDeviceResourceRequirementsQuery callback function. To register this callback function, bus drivers call WdfPdoInitSetEventCallbacks.

The framework calls the bus driver's EvtDeviceResourceRequirementsQuery callback function to obtain a resource requirements list for the device.

The driver must populate the supplied resource-requirements-list object with logical configurations of hardware resources that will allow the device to operate properly.

To create a resource requirements list, the driver calls framework resource-range-list object methods, which add resource descriptors to logical configurations, and framework resource-requirements-list object methods, which add logical configurations to the resource requirements list.

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

If a driver is running on an operating system version that is earlier than Windows 7, a bus driver can use EvtDeviceResourceRequirementsQuery to set a device property on a child device prior to enumerating the child.

To set a device property on Windows 7 or later, a bus driver can provide a preprocess routine for IRP_MN_DEVICE_ENUMERATED.

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Header wdfpdo.h (include Wdf.h)
IRQL PASSIVE_LEVEL

See also

EvtDeviceResourcesQuery