From: Tarek Mahmoud Sayed Date: Fri, 16 Jun 2017 22:53:03 +0000 (-0700) Subject: Fix CompareInfo.Version on Windows (#12330) X-Git-Tag: accepted/tizen/base/20180629.140029~1083^2~405 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=660a3e67071e0273eaffe44cf08b72ed675c3ddc;p=platform%2Fupstream%2Fcoreclr.git Fix CompareInfo.Version on Windows (#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. --- diff --git a/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs b/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs index eb4dc56..0df5463 100644 --- a/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs +++ b/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,