I've completely given up trying to build a minifilter for Windows 7 (I guess it's time to drop support for it).
Is there any way to use VS 2022 (and the WDK 8.1 I guess) to build a minifilter for Windows 8.1? Or is this a situation of needing to have a separate VS 2019 installation?
No, you can't target anything pre-Win10 with VS2022. Though we have no problems building drivers for Win7/Win8 with VS2019 and the 21H2 WDK (including minifilters).