// wdfrequest.h
WDFFILEOBJECT WdfRequestGetFileObject(
[in] WDFREQUEST Request
);
View the official Windows Driver Kit DDI reference
No description available.
[Applies to KMDF and UMDF]
The WdfRequestGetFileObject method retrieves the framework file object that is associated with a specified I/O request.
Request
[in]A handle to a framework request object.
WdfRequestGetFileObject returns a handle to the framework file object, if the framework has created a file object for the specified request. Otherwise, this method returns NULL. (A driver typically tests for a NULL return value only if it sets the WdfFileObjectCanBeOptional bit flag in the WDF_FILEOBJECT_CONFIG structure.)
A bug check occurs if the driver supplies an invalid object handle.
The WdfRequestGetFileObject method returns NULL if either:
For more information about WdfRequestGetFileObject and framework file objects, see Framework File Objects.
The following code example obtains an I/O request's file object and then calls a driver-defined routine that obtains a pointer to the file object's context space.
VOID
MyEvtIoWrite(
IN WDFQUEUE Queue,
IN WDFREQUEST Request,
IN size_t Length
)
{
WDFFILEOBJECT fileObject;
PFILE_OPEN_CONTEXT pOpenContext;
fileObject = WdfRequestGetFileObject(Request);
pOpenContext = GetFileObjectContext(fileObject)->OpenContext;
}
WdfDeviceInitSetFileObjectConfig