Fix Running .NET Core Under Windows App Compat Shim (dotnet/coreclr#26605)
authorTarek Mahmoud Sayed <tarekms@microsoft.com>
Tue, 10 Sep 2019 18:42:25 +0000 (11:42 -0700)
committerGitHub <noreply@github.com>
Tue, 10 Sep 2019 18:42:25 +0000 (11:42 -0700)
commit176ece871af126034ce3de3fdf8dca4a1bba403e
tree71530790f355e884cf1391591211adf0d136db22
parent57f77edb0e1274322bf7971e72e6366b19f80477
Fix Running .NET Core Under Windows App Compat Shim (dotnet/coreclr#26605)

* Fix Running .NET Core Under Winndows App Compat Shim

.NET Core uses Windows features called sort handles for perf reason to speed up the collation operations (e.g. string comparisons). When enabling Windows app compat shim (e.g. Windows 7 compatibility mode), the calls uses sort handles will fail which cause all collation operations to fail.
The fix here is to detect if the sort handles work before using it to ensure successful run.

* Address the feedback

* More feedback addressing

Commit migrated from https://github.com/dotnet/coreclr/commit/0f1314bdca91add2b4e9dbc95ec687dab638e1a0
src/libraries/System.Private.CoreLib/src/Interop/Windows/Kernel32/Interop.Globalization.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Windows.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Windows.cs