WdfFileObjectGetDevice method

[Applies to KMDF and UMDF]

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

Syntax


WDFDEVICE WdfFileObjectGetDevice(
  [in]  WDFFILEOBJECT FileObject
);

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

Requirements

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, KmdfIrql, KmdfIrql2

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft