IPnpCallbackHardware2::OnReleaseHardware method

[Applies to UMDF 1.x only]

The OnReleaseHardware method performs operations that are needed when a device is no longer accessible.

Syntax


HRESULT OnReleaseHardware(
  [in] IWDFDevice3        *pWdfDevice,
  [in] IWDFCmResourceList *pWdfResourcesTranslated
);

Parameters

pWdfDevice [in]

A pointer to the IWDFDevice3 interface for the framework device object.

pWdfResourcesTranslated [in]

A pointer to the IWDFCmResourceList interface for the framework resource-list object that identifies the translated hardware resources that the Plug and Play manager has assigned to the device.

Return value

OnReleaseHardware returns S_OK if the operation succeeds. Otherwise, this method returns one of the error codes that are defined in Winerror.h. Do not return HRESULT_FROM_NT(STATUS_NOT_SUPPORTED).

Remarks

A driver registers the IPnpCallbackHardware2 interface when the driver calls the IWDFDriver::CreateDevice method to create a device object.

The OnReleaseHardware method must free resources that were allocated during the call to the driver's IPnpCallbackHardware2::OnPrepareHardware method, regardless of whether OnPrepareHardware succeeded or failed. As such, OnReleaseHardware must be able to handle the cleanup of partial resources.

For information about deleting an interrupt object, see Deleting an Interrupt Object.

For information about parsing hardware resources, see Finding and Mapping Hardware Resources in a UMDF Driver.

Examples

See example code in IWDFDevice3::MapIoSpace.

Requirements

Target platform

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.11

Header

Wudfddi.h

See also

IPnpCallbackHardware2
OnPrepareHardware

 

 

Send comments about this topic to Microsoft

Show: