PDEVICE_OBJECT
IoGetRelatedDeviceObject(
IN PFILE_OBJECT FileObject
);
IoGetRelatedDeviceObject returns a pointer to the device object represented by the given file object.
IoGetRelatedDeviceObject returns a pointer to the device object.
The caller must be running at IRQL <= DISPATCH_LEVEL. Usually, callers of this routine are running at IRQL PASSIVE_LEVEL.