Closed vatsan-madhavan closed 1 year ago
Have you tried using CsWin32 for this function? I think it would use kernel32.
CsWin32 supports VerSetConditionMask, but I haven't given it a try. I'm frequently dealing with dual-mode API's (ones that are documented & available on both kernel and user mode) which CsWin32 doesn't support today (https://github.com/microsoft/win32metadata/issues/242).
In general, its simpler to rely on one system of P/Invokes [dotnet/pinvoke] over having a hybrid dependency on dotnet/pinvoke for some and CsWin32 for others (although I've found CsWin32 to be very helpful in a few other situations where I didn't expect to need dual-mode API's).
VerSetConditionMask relies on the API set DLL
api-ms-win-core-sysinfo-l1-2-0
, which causes calls to it to fail on Windows 7.https://github.com/dotnet/pinvoke/blob/2634eea66089c199790fcb72982936fd123bba24/src/Kernel32/Kernel32.cs#L728-L730
What's the policy on Win7 support? If our goal is to keep these libraries in general working condition on Win7, it would make sense to point
VerSetConditionMask
atKernel32
directly instead of an APISet DLL.