From 120a406e3deb1e9c882b3644e5ab0235181aaaf4 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Fri, 16 Jun 2017 15:53:03 -0700 Subject: [PATCH] Fix CompareInfo.Version on Windows (dotnet/coreclr#12330) 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 --- src/coreclr/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs b/src/coreclr/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs index eb4dc56..0df5463 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs +++ b/src/coreclr/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs @@ -469,6 +469,7 @@ namespace System.Globalization 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, -- 2.7.4