WdfFileObjectWdmGetFileObject - NtDoc

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

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

NtDoc

No description available.

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

WdfFileObjectWdmGetFileObject function

Description

[Applies to KMDF only]

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

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

See also

FILE_OBJECT