We call Windows to get the sort version. We call Windows passing the structure NlsVersionInfoEx but Windows expect we have to initialize the size of this structure which we are missing.
Commit migrated from https://github.com/dotnet/coreclr/commit/
660a3e67071e0273eaffe44cf08b72ed675c3ddc
Debug.Assert(!_invariantMode);
Interop.Kernel32.NlsVersionInfoEx nlsVersion = new Interop.Kernel32.NlsVersionInfoEx();
+ nlsVersion.dwNLSVersionInfoSize = Marshal.SizeOf(typeof(Interop.Kernel32.NlsVersionInfoEx));
Interop.Kernel32.GetNLSVersionEx(Interop.Kernel32.COMPARE_STRING, _sortName, &nlsVersion);
return new SortVersion(
nlsVersion.dwNLSVersion,