WdfWdmDeviceGetWdfDeviceHandle method
[Applies to KMDF only]
The WdfWdmDeviceGetWdfDeviceHandle method returns a handle to the framework device object that is associated with a specified WDM device object.
Syntax
WDFDEVICE WdfWdmDeviceGetWdfDeviceHandle(
[in] PDEVICE_OBJECT DeviceObject
);
Parameters
- DeviceObject [in]
-
A pointer to a WDM DEVICE_OBJECT structure that the calling driver created.
Return value
If the specified WDM device object is valid, WdfWdmDeviceGetWdfDeviceHandle returns a handle to the associated framework device object. Otherwise, the method returns NULL.
Remarks
The WDM DEVICE_OBJECT structure that the driver specifies for the DeviceObject parameter must represent a device object that the calling driver created. For example, the structure cannot represent any of the WDM device objects that the driver specified in a previous call to WdfDeviceMiniportCreate.
Examples
The following code example obtains a handle to the framework device object that is associated with a WDM device object that the calling driver created.
WDFDEVICE device; device = WdfWdmDeviceGetWdfDeviceHandle(pWdmDeviceObject);
Requirements
Minimum KMDF version | 1.0 |
---|---|
Header |
|
Library |
|
IRQL | <=DISPATCH_LEVEL |
DDI compliance rules | DriverCreate, KmdfIrql, KmdfIrql2 |
See also