WdfFileObjectGetDevice function (wdffileobject.h)
[Applies to KMDF and UMDF]
The WdfFileObjectGetDevice method returns the framework device object that is associated with a specified framework file object.
WDFDEVICE WdfFileObjectGetDevice(
[in] WDFFILEOBJECT FileObject
);
[in] FileObject
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);
...
}
Requirement | Value |
---|---|
Target Platform | Universal |
Minimum KMDF version | 1.0 |
Minimum UMDF version | 2.0 |
Header | wdffileobject.h (include Wdf.h) |
Library | Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF) |
IRQL | <=DISPATCH_LEVEL |
DDI compliance rules | DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf) |