// wdffdo.h
PDEVICE_OBJECT WdfFdoInitWdmGetPhysicalDevice(
[in] PWDFDEVICE_INIT DeviceInit
);
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF only]
The WdfFdoInitWdmGetPhysicalDevice method retrieves a device's WDM physical device object (PDO).
DeviceInit [in]A pointer to a WDFDEVICE_INIT structure that the driver obtained from its EvtDriverDeviceAdd callback function.
If the operation succeeds, the method returns a pointer to a DEVICE_OBJECT structure. Otherwise the method returns NULL.
The driver must call WdfFdoInitWdmGetPhysicalDevice before calling WdfDeviceCreate. For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.
For more information about the WdfFdoInitWdmGetPhysicalDevice method, see Creating Device Objects in a Function Driver.
The following code example obtains a pointer to a DEVICE_OBJECT structure that represents a device's WDM PDO.
PDEVICE_OBJECT device;
device = WdfFdoInitWdmGetPhysicalDevice(DeviceInit);