From 43e93e4dd333760c554d2a46b6e802cbca682343 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Thu, 7 Oct 2021 13:30:34 -0700 Subject: [PATCH 1/2] Fix TimeZones Test failure --- .../System.Runtime/tests/System/TimeZoneInfoTests.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs index 5d942249bcb08..ffef3701c34bf 100644 --- a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs +++ b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs @@ -3101,6 +3101,14 @@ private static unsafe int EnumUiLanguagesCallback(char* lpUiLanguageString, IntP // native string is null terminated var cultureName = new string(lpUiLanguageString); + string tzResourceFilePath = Path.Join(Environment.SystemDirectory, cultureName, "tzres.dll.mui"); + if (!File.Exists(tzResourceFilePath)) + { + // If Windows installed a UI language and not including the time zone resources DLL for that language, + // then skip this language as .NET will not be able to get the localized resources for that language. + return 1; + } + try { var handle = GCHandle.FromIntPtr(lParam); From 6a377c4c68cf23e8e3d74e267d7c3eebe99cebe4 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Thu, 7 Oct 2021 13:53:42 -0700 Subject: [PATCH 2/2] Fix teh comment --- src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs index ffef3701c34bf..cae39b07c5482 100644 --- a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs +++ b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs @@ -3104,7 +3104,7 @@ private static unsafe int EnumUiLanguagesCallback(char* lpUiLanguageString, IntP string tzResourceFilePath = Path.Join(Environment.SystemDirectory, cultureName, "tzres.dll.mui"); if (!File.Exists(tzResourceFilePath)) { - // If Windows installed a UI language and not including the time zone resources DLL for that language, + // If Windows installed a UI language but did not include the time zone resources DLL for that language, // then skip this language as .NET will not be able to get the localized resources for that language. return 1; }