Getting a PFLT_INSTANCE from a lower frame

Does anybody have a quick and easy way to do this that they’d be willing
to share? FltGetVolumeInstanceFromName works if both MFs are in the
same frame. If there’s a legacy driver between them, however,
FltGetVolumeInstanceFromName doesn’t find the instance because
(apparently, see below), each disk (as in physical volume, but it’s
going to get confusing here) has its own PFLT_VOLUME for that frame.
I.e. The total number of PFLT_VOLUMES for a system with 2 disks and 2
frames is 4.

FltGetLowerInstance doesn’t appear to cross frames either. Lovely.

So is there a way to get the PFLT_VOLUME for the next lower frame in the
same stack? Or am I going to have to do something completely gross,
like IOCTL my lower driver’s CDO with the results of
FltGetDiskDeviceObject (assuming that’s the same between the two frames,
I haven’t checked yet). FltGetVolumeName would probably do the trick if
those weren’t the same between the frames.

Also, pretty please Alex, can the documentation be updated to reflect
the limitations of FltGetVolumeInstanceFromName and FltGetLowerInstance?

The test system is W2K3, by the way.

Thanks,

~Eric

kd> !fltkd.volumes

*** Extension DLL(6526 Free) does not match target system(3790 Free)

Volume List: 81d7d0a0 “Frame 1”
FLT_VOLUME: 81e15c18 “\Device\HarddiskVolume1”
FLT_INSTANCE: 81e15780 "“My Top Instance” “370020”
FLT_VOLUME: 81e1e498 “\Device\HarddiskVolume3”
FLT_INSTANCE: 81e418e0 "“My Top Instance” “370020”
FLT_VOLUME: 81e414f0 “\Device\HarddiskVolume2”
FLT_INSTANCE: 81bcf518 "“My Top Instance” “370020”
Volume List: 81f940a0 “Frame 0”
FLT_VOLUME: 81f2cc18 “\Device\HarddiskVolume1”
FLT_INSTANCE: 81eb7638 “My Bottom Instance” “181300”
FLT_VOLUME: 81eb5c18 “\Device\HarddiskVolume3”
FLT_INSTANCE: 81e53c38 “My Bottom Instance” “181300”
FLT_VOLUME: 81bd6008 “\Device\HarddiskVolume2”
FLT_INSTANCE: 81bcf2f0 “My Bottom Instance” “181300”
FLT_VOLUME: 81bc7008 “\Device\LanmanRedirector”