[Applies to UMDF 1.x only]
The OnPrepareHardware method performs any operations that are needed to make a device accessible to the driver.
HRESULT OnPrepareHardware( [in] IWDFDevice3 *pWdfDevice, [in] IWDFCmResourceList *pWdfResourcesRaw, [in] IWDFCmResourceList *pWdfResourcesTranslated );
- 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.
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.
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.
See example code in IWDFDevice3::MapIoSpace.
End of support
|Unavailable in UMDF 2.0 and later.|
Minimum UMDF version