Bewerken

Delen via


EVT_WDF_DEVICE_QUERY_STOP callback function (wdfdevice.h)

[Applies to KMDF and UMDF]

A driver's EvtDeviceQueryStop event callback function determines whether a specified device can be stopped so that the PnP manager can redistribute system hardware resources.

Syntax

EVT_WDF_DEVICE_QUERY_STOP EvtWdfDeviceQueryStop;

NTSTATUS EvtWdfDeviceQueryStop(
  [in] WDFDEVICE Device
)
{...}

Parameters

[in] Device

A handle to a framework device object.

Return value

If the driver determines that the device can be stopped, the EvtDeviceQueryStop callback function must return STATUS_SUCCESS or another status value for which NT_SUCCESS(status) equals TRUE. Otherwise it must return a status value for which NT_SUCCESS(status) equals FALSE. Do not return STATUS_NOT_SUPPORTED.

Remarks

To register an EvtDeviceQueryStop callback function, a driver must call WdfDeviceInitSetPnpPowerEventCallbacks.

If the device and driver support idle power-down, the device might not be in its working state when the framework calls the driver's EvtDeviceQueryStop callback function. The callback function can call WdfDeviceStopIdle to force the device into its working (D0) state, and then the callback function can call WdfDeviceResumeIdle before it returns.

For more information about the EvtDeviceQueryStop callback function, see Handling Requests to Stop a Device.

The framework does not synchronize the EvtDeviceQueryStop callback function with other PnP and power management callback functions. For information about how the framework synchronizes the execution of a driver's event callback functions, see Using Automatic Synchronization.

Requirements

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

See also

EvtDeviceQueryRemove