This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.
Microsoft Public License
6.92k
stars
4.93k
forks
source link
nullFilter: VS2022 compatibility and best practices by default #999
I have been building Minifilter driver lately and was supriced how much issues there are on existing samples and challenges which developers have faced because of it (there is multiple issues because of it in here and other forums).
This PR updates nullFilter sample in way that:
It can be build with Visual Studio 2022 and it as result there is zero warnings.
Removed deprecated Win32 support which is not compatible with VS2022.
INF uses latest standard but still include legacy compatibility for those who needs that.
Latest C and C++ standards are followed.
Code analysis runs with "Microsoft All Rules" on every build as highly recommended in here
Driver verification is on with all rules enabled in on like highly recommended in here
BypassIO support is enabled in INF file as instructed in here
ntstrsafe.h is used instead of dontuse.h. This driver actually don't need that at all but as this is sample it is good idea to share correct way on it.
It attach automatically to all volumes automatically so it can be used with HLK tests.
In addition that this provides better starting point for developers, I did find it also useful to verify that my HLK Client machines are working correctly as cases like File IO 2 Tests needs very special configuration.
I have been building Minifilter driver lately and was supriced how much issues there are on existing samples and challenges which developers have faced because of it (there is multiple issues because of it in here and other forums).
This PR updates nullFilter sample in way that:
ntstrsafe.h
is used instead ofdontuse.h
. This driver actually don't need that at all but as this is sample it is good idea to share correct way on it.In addition that this provides better starting point for developers, I did find it also useful to verify that my HLK Client machines are working correctly as cases like File IO 2 Tests needs very special configuration.