WdfFileObjectWdmGetFileObject method

[Applies to KMDF only]

The WdfFileObjectWdmGetFileObject method returns the Windows Driver Model (WDM) file object that is associated with a specified framework file object.

Syntax


PFILE_OBJECT WdfFileObjectWdmGetFileObject(
  [in]  WDFFILEOBJECT FileObject
);

Parameters

FileObject [in]

A handle to a framework file object.

Return value

WdfFileObjectWdmGetFileObject returns a pointer to the FILE_OBJECT structure that is associated with the specified framework file object, or NULL if there is no WDM file object for the specified framework file object.

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

Remarks

The pointer that the WdfFileObjectWdmGetFileObject method returns is valid until the framework file object is deleted. If the driver provides an EvtCleanupCallback function for the framework file object, the pointer is valid until the callback function returns.

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

Examples

The following code example obtains a handle to the WDM file object that is associated with a specified framework file object.


PFILE_OBJECT  pReturnedFileObject;

pReturnedFileObject = WdfFileObjectWdmGetFileObject(fileObject);

Requirements

Minimum KMDF version

1.0

Header

Wdffileobject.h (include Wdf.h)

Library

Wdf01000.sys (see Framework Library Versioning.)

IRQL

<=DISPATCH_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2

See also

FILE_OBJECT

 

 

Send comments about this topic to Microsoft

Показ:
© 2014 Microsoft