EvtDeviceReleaseHardware
EvtDeviceReportedMissing
EvtDeviceUsageNotificationEx
EvtDeviceWdmIrpDispatch
EvtDeviceWdmPostPoFxRegisterDevice
EvtDeviceWdmPrePoFxUnregisterDevice
WDF_DEVICE_INTERFACE_PROPERTY_DATA
WDF_DEVICE_INTERFACE_PROPERTY_DATA_INIT
WDF_DEVICE_PROPERTY_DATA
WDF_DEVICE_PROPERTY_DATA_INIT
WDF_DISPATCH_IRP_TO_IO_QUEUE_FLAGS
WDF_EVENT_TYPE
WDF_IO_TYPE_CONFIG
WDF_IO_TYPE_CONFIG_INIT
WDF_POWER_FRAMEWORK_SETTINGS
WDF_POWER_FRAMEWORK_SETTINGS_INIT
WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE
WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE
WDF_REMOVE_LOCK_OPTIONS
WDF_REMOVE_LOCK_OPTIONS_FLAGS
WDF_REMOVE_LOCK_OPTIONS_INIT
WdfDeviceAllocAndQueryInterfaceProperty method
WdfDeviceAllocAndQueryPropertyEx method
WdfDeviceAssignInterfaceProperty method
WdfDeviceAssignProperty method
WdfDeviceConfigureWdmIrpDispatchCallback method
WdfDeviceGetDeviceStackIoType method
WdfDeviceGetHardwareRegisterMappedAddress
WdfDeviceInitSetIoTypeEx method
WdfDeviceInitSetReleaseHardwareOrderOnFailure method
WdfDeviceInitSetRemoveLockOptions method
WdfDeviceMapIoSpace
WdfDeviceOpenDevicemapKey method
WdfDevicePostEvent
WdfDeviceQueryInterfaceProperty method
WdfDeviceQueryPropertyEx method
WdfDeviceReadFromHardware
WdfDeviceResumeIdleWithTag method
WdfDeviceStopIdleWithTag method
WdfDeviceUnmapIoSpace
WdfDeviceWdmAssignPowerFrameworkSettings method
WdfDeviceWdmDispatchIrp method
WdfDeviceWdmDispatchIrpToIoQueue method
WdfDeviceWriteToHardware
WdfFdoInitAllocAndQueryPropertyEx method
WdfFdoInitQueryPropertyEx method
TOC
折叠目录
展开目录

EvtDeviceReleaseHardware

A driver's EvtDeviceReleaseHardware event callback function performs operations that are needed when a device is no longer accessible.

语法

EVT_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware;

NTSTATUS EvtDeviceReleaseHardware(
  __in  WDFDEVICE Device,
  __in  WDFCMRESLIST ResourcesTranslated
)
{ ... }

参数

Device [in]

A handle to a framework device object.

ResourcesTranslated [in]

A handle to a resource list object that identifies the translated hardware resources that the Plug and Play manager has assigned to the device.

返回值

If the EvtDeviceReleaseHardware callback function encounters no errors, it 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.

评论

To register an EvtDeviceReleaseHardware callback function, your driver must call WdfDeviceInitSetPnpPowerEventCallbacks.

If a driver has registered an EvtDeviceReleaseHardware callback function, the framework calls the callback function if the device is being removed (by either an orderly removal or a surprise removal), or if the Plug and Play manager is attempting to redistribute hardware resources.

The framework calls the EvtDeviceReleaseHardware callback function after the driver's device has been shut off, the Plug and Play manager has reclaimed the hardware resources that it assigned to the device, and the device is no longer accessible. (The PCI configuration state is still accessible.)

For more information about when the framework calls this callback function, see PnP and Power Management Scenarios.

Typically, a EvtDeviceReleaseHardware callback function unmaps memory that the driver's EvtDevicePrepareHardware callback function mapped. Usually, all other hardware shutdown operations should take place in the driver's EvtDeviceD0Exit callback function.

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

For more information about drivers that provide this callback function, see Supporting PnP and Power Management in Function Drivers.

示例

The function type is declared in Wdfdevice.h, as follows.

typedef NTSTATUS
 (EVT_WDF_DEVICE_RELEASE_HARDWARE)(
    IN WDFDEVICE  Device,
    IN WDFCMRESLIST  ResourcesTranslated
    );

To define an EvtDeviceReleaseHardware callback function that is named MyDeviceReleaseHardware, you must first provide a function declaration that SDV and other verification tools require, as follows:

EVT_WDF_DEVICE_RELEASE_HARDWARE  MyDeviceReleaseHardware;

Then, implement your callback function as follows:

NTSTATUS
 MyDeviceReleaseHardware (
    IN WDFDEVICE  Device,
    IN WDFCMRESLIST  ResourcesTranslated
    )
  {...}

要求

版本

Supported by version 1.0 and later versions of KMDF.

标头

Wdfdevice.h (包括Wdf.h)

IRQL

PASSIVE_LEVEL

另请参见

EvtDevicePrepareHardware

 

 

社区附加资源

添加
显示:
© 2016 Microsoft