Multiple windows versions. Problem with FLTFL_REGISTRATION_SUPPORT_NPFS_MSFS and IRP_MJ_CREATE_NAMED

Hi, I need to run my driver on multiple versions of system: Windows 7, Windows 8, Windows 8.1 and Windows 10.
To do this, in the project settings, I specified:
Properties->Driver Settings->Target OS Version: Windows 7

If I specify Windows 8, 8.1 or 10, then when trying to run on Windows 7, a BSOD appears when executing: GsDriverEntry->__security_init_cookie

At the same time, I register a callback in the driver to intercept IRP_MJ_CREATE_NAMED_PIPE. In FLT_REGISTRATION, I set the FLTFL_REGISTRATION_SUPPORT_NPFS_MSFS flag.
This flag aviable starting from Windows 8. (On windows 7, I do not set the flag).
On Windows 10, this callback works, but on Windows 8.1 or on Windows server 2019, the callback does not work, as if it was not registered
If I switch Properties->Driver Settings->Target OS Version: Windows 10, then everything works stably, but does not run on Windows 7.

Can someone tell me what the problem is? Or how to solve it?

https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/building-drivers-for-different-versions-of-windows#guidelines-that-apply-to-building-kernel-mode-drivers

See the comment about changing the buffer overflow library.