Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IPnpCallbackHardware2::OnPrepareHardware method

[Applies to UMDF 1.x only]

The OnPrepareHardware method performs any operations that are needed to make a device accessible to the driver.

Syntax


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

Parameters

pWdfDevice [in]

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

pWdfResourcesRaw [in]

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

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

OnPrepareHardware 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).

If OnPrepareHardware returns an error code, the framework will still call the IPnpCallbackHardware2::OnReleaseHardware method. The OnReleaseHardware method can then free resources that were allocated during the call to OnPrepareHardware. Because OnReleaseHardware must free resources for both success and failure cases of OnPrepareHardware, OnReleaseHardware must be able to handle the cleanup of partial resources.

Remarks

The IPnpCallbackHardware2::OnPrepareHardware method differs from the IPnpCallbackHardware::OnPrepareHardware method in that it receives raw and translated resources.

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

Examples

See example code in IWDFDevice3::MapIoSpace.

Requirements

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.11

Header

Wudfddi.h

See also

IPnpCallbackHardware2
OnReleaseHardware

 

 

Send comments about this topic to Microsoft

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.