// wdffileobject.h
PFILE_OBJECT WdfFileObjectWdmGetFileObject(
[in] WDFFILEOBJECT FileObject
);
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF only]
The WdfFileObjectWdmGetFileObject method returns the Windows Driver Model (WDM) file object that is associated with a specified framework file object.
FileObject [in]A handle to a framework file object.
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.
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.
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);