WdfFdoInitWdmGetPhysicalDevice method
[Applies to KMDF only]
The WdfFdoInitWdmGetPhysicalDevice method retrieves a device's WDM physical device object (PDO).
Syntax
PDEVICE_OBJECT WdfFdoInitWdmGetPhysicalDevice(
  [in]  PWDFDEVICE_INIT DeviceInit
);
Parameters
- DeviceInit [in]
- 
A pointer to a WDFDEVICE_INIT structure that the driver obtained from its EvtDriverDeviceAdd callback function. 
Return value
If the operation succeeds, the method returns a pointer to a DEVICE_OBJECT structure. Otherwise the method returns NULL.
Remarks
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.
Examples
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);
Requirements
| Minimum KMDF version | 1.0 | 
|---|---|
| Header | 
 | 
| Library | 
 | 
| IRQL | <= DISPATCH_LEVEL | 
| DDI compliance rules | DeviceInitAPI, DriverCreate, KmdfIrql, KmdfIrql2 | 

