情報
要求されたトピックは次のとおりです。しかし、このトピックはこのライブラリには含まれていません。

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 (includeWdf.h)

IRQL

PASSIVE_LEVEL

参照

EvtDevicePrepareHardware

 

 

コミュニティの追加

表示:
© 2014 Microsoft