WdfWdmDeviceGetWdfDeviceHandle - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfdevice.h

WDFDEVICE WdfWdmDeviceGetWdfDeviceHandle(
  [in] PDEVICE_OBJECT DeviceObject
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfdevice-wdfwdmdevicegetwdfdevicehandle)

WdfWdmDeviceGetWdfDeviceHandle function

Description

[Applies to KMDF only]

The WdfWdmDeviceGetWdfDeviceHandle method returns a handle to the framework device object that is associated with a specified WDM device object.

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);

See also

WdfDeviceMiniportCreate