// wdfdevice.h
WDFDEVICE WdfWdmDeviceGetWdfDeviceHandle(
[in] PDEVICE_OBJECT DeviceObject
);
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF only]
The WdfWdmDeviceGetWdfDeviceHandle method returns a handle to the framework device object that is associated with a specified WDM device object.
DeviceObject [in]A pointer to a WDM DEVICE_OBJECT structure that the calling driver created.
If the specified WDM device object is valid, WdfWdmDeviceGetWdfDeviceHandle returns a handle to the associated framework device object. Otherwise, the method returns NULL.
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.
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);