Runtime: [QUIC] Improve MSQuic OS Version detection

Created on 20 Feb 2020  路  10Comments  路  Source: dotnet/runtime

https://github.com/dotnet/runtime/blob/3be5238a376cd4bca32db1acb732dc7c15091cdf/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs#L144-L146

Environment.OSVersion is an unreliable API that reports old versions for compat purposes. It only reports the correct Win10 version if an app manifest is added. VS and the test runner have this manifest but sample apps and customer apps won't.
https://stackoverflow.com/questions/33328739/system-environment-osversion-returns-wrong-version

We're going to need a different way to check for this support. Worst case we look at the registry.

area-System.Net.Quic bug

Most helpful comment

Microsoft.DotNet.PlatformAbstractions package is obsolete.

P/Invoking Ntdll.RtlGetVersionEx is your best bet.

All 10 comments

Microsoft.DotNet.PlatformAbstractions package is obsolete.

P/Invoking Ntdll.RtlGetVersionEx is your best bet.

It only reports the correct Win10 version if an app manifest is added. VS and the test runner have this manifest but sample apps and customer apps won't.

This is considered to be a feature. It is not necessary something you want to "fix".

Microsoft.DotNet.PlatformAbstractions package is obsolete.

will its sources be removed and dotnet-cli switch to p/invoke?

Edit: nvm, found the issue tracking it - https://github.com/dotnet/runtime/issues/3470

This is considered to be a feature. It is not necessary something you want to "fix".

This version check is to see if the OS has the right TLS 1.3 support. Http3 will have other opt-in guards to maintain compat. Once a developer opts in, false negatives from this version check are an unnecessary hurdle and support burden.

33643 fixed Environment.OSVersion so we can depend on that again.

@Tratcher - do you want me to update #36302 to add back the Environment.OSVersion check?

@jkotalik have you confirmed which version we need?

No, let's just merge what we have in that #36302 for now. I'll need to figure out if the Windows slow preview train has schannel support, which will take a while.

I'm thinking it's better to implement this in MsQuic -- https://github.com/microsoft/msquic/issues/92

Was this page helpful?
0 / 5 - 0 ratings