WdfFileObjectGetDevice - NtDoc

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

WDFDEVICE WdfFileObjectGetDevice(
  [in] WDFFILEOBJECT FileObject
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdffileobject-wdffileobjectgetdevice)

WdfFileObjectGetDevice function

Description

[Applies to KMDF and UMDF]

The WdfFileObjectGetDevice method returns the framework device object that is associated with a specified framework file object.

Parameters

FileObject [in]

A handle to a framework file object.

Return value

WdfFileObjectGetDevice returns a handle to the framework device object that is associated with the specified framework file object.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

For more information about framework file objects, see Framework File Objects.

Examples

The following code example shows how an EvtFileClose callback function can obtain the framework device object that is associated with a specified framework file object.

VOID
MyEvtFileClose(
    IN WDFFILEOBJECT  FileObject
    )
{
    WDFDEVICE device;

    device = WdfFileObjectGetDevice(FileObject);
...
}