// wdffileobject.h
WDFDEVICE WdfFileObjectGetDevice(
[in] WDFFILEOBJECT FileObject
);
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF and UMDF]
The WdfFileObjectGetDevice method returns the framework device object that is associated with a specified framework file object.
FileObject [in]A handle to a framework file object.
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.
For more information about framework file objects, see Framework File Objects.
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);
...
}