diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-03-19 06:59:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-19 06:59:33 -0700 |
commit | e7bb40f52d46671f5001012284a2f54eaa658e35 (patch) | |
tree | b303ba0ec6f7c19942cd0ceefe6c38eb6b5f941b | |
parent | 259006de1cb285e5c15490013289e0b214c6cb21 (diff) | |
download | coreclr-e7bb40f52d46671f5001012284a2f54eaa658e35.tar.gz coreclr-e7bb40f52d46671f5001012284a2f54eaa658e35.tar.bz2 coreclr-e7bb40f52d46671f5001012284a2f54eaa658e35.zip |
Delete unused downlevel globalization support (#17022)
Delete ENABLE_DOWNLEVEL_FOR_NLS and everything under it
28 files changed, 14 insertions, 5984 deletions
diff --git a/src/binder/fusionhelpers.cpp b/src/binder/fusionhelpers.cpp index bb32856a52..4372bcf344 100644 --- a/src/binder/fusionhelpers.cpp +++ b/src/binder/fusionhelpers.cpp @@ -12,7 +12,6 @@ #include "fusionhelpers.hpp" #include "shlwapi.h" -#include "newapis.h" #define IS_UPPER_A_TO_Z(x) (((x) >= L'A') && ((x) <= L'Z')) #define IS_LOWER_A_TO_Z(x) (((x) >= L'a') && ((x) <= L'z')) @@ -36,7 +35,7 @@ namespace #ifdef FEATURE_USE_LCID int iRet = WszLCMapString(g_lcid, LCMAP_UPPERCASE, &wc, 1, &wTmp, 1); #else - int iRet = NewApis::LCMapStringEx(g_lcid, LCMAP_UPPERCASE, &wc, 1, &wTmp, 1, NULL, NULL, 0); + int iRet = LCMapStringEx(g_lcid, LCMAP_UPPERCASE, &wc, 1, &wTmp, 1, NULL, NULL, 0); #endif if (!iRet) { _ASSERTE(!"LCMapString failed!"); diff --git a/src/classlibnative/inc/nlsinfo.h b/src/classlibnative/inc/nlsinfo.h index 0593a4f034..ec06913f92 100644 --- a/src/classlibnative/inc/nlsinfo.h +++ b/src/classlibnative/inc/nlsinfo.h @@ -43,8 +43,6 @@ class COMNlsInfo { public: - static INT32 CallGetUserDefaultUILanguage(); - // // Native helper functions for methods in DateTimeFormatInfo // diff --git a/src/classlibnative/nls/nlsinfo.cpp b/src/classlibnative/nls/nlsinfo.cpp index 76c08c2301..e12e41b1c9 100644 --- a/src/classlibnative/nls/nlsinfo.cpp +++ b/src/classlibnative/nls/nlsinfo.cpp @@ -34,55 +34,12 @@ #include "nls.h" #include "nlsinfo.h" -#include "newapis.h" - // // Constant Declarations. // #define MAX_STRING_VALUE 512 -// TODO: NLS Arrowhead -Be nice if we could depend more on the OS for this -// Language ID for CHT (Taiwan) -#define LANGID_ZH_TW 0x0404 -// Language ID for CHT (Hong-Kong) -#define LANGID_ZH_HK 0x0c04 - - -INT32 COMNlsInfo::CallGetUserDefaultUILanguage() -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - SO_TOLERANT; - } CONTRACTL_END; - - static INT32 s_lcid = 0; - - // The user UI language cannot change within a process (in fact it cannot change within a logon session), - // so we cache it. We dont take a lock while initializing s_lcid for the same reason. If two threads are - // racing to initialize s_lcid, the worst thing that'll happen is that one thread will call - // GetUserDefaultUILanguage needlessly, but the final result is going to be the same. - if (s_lcid == 0) - { - INT32 s_lcidTemp = GetUserDefaultUILanguage(); - if (s_lcidTemp == LANGID_ZH_TW) - { - // If the UI language ID is 0x0404, we need to do extra check to decide - // the real UI language, since MUI (in CHT)/HK/TW Windows SKU all uses 0x0404 as their CHT language ID. - if (!NewApis::IsZhTwSku()) - { - s_lcidTemp = LANGID_ZH_HK; - } - } - s_lcid = s_lcidTemp; - } - - return s_lcid; -} - //////////////////////////////////////////////////////////////////////////// // // InternalGetGlobalizedHashCode @@ -117,7 +74,7 @@ INT32 QCALLTYPE COMNlsInfo::InternalGetGlobalizedHashCode(INT_PTR handle, LPCWST // Assert if we might hit an AV in LCMapStringEx for the invariant culture. _ASSERTE(length > 0 || (dwFlags & LCMAP_LINGUISTIC_CASING) == 0); { - byteCount=NewApis::LCMapStringEx(handle != NULL ? NULL : localeName, dwFlags, string, length, NULL, 0, NULL, NULL, (LPARAM) handle); + byteCount=::LCMapStringEx(handle != NULL ? NULL : localeName, dwFlags, string, length, NULL, 0, NULL, NULL, (LPARAM) handle); } //A count of 0 indicates that we either had an error or had a zero length string originally. @@ -134,7 +91,7 @@ INT32 QCALLTYPE COMNlsInfo::InternalGetGlobalizedHashCode(INT_PTR handle, LPCWST BYTE* pByte = (BYTE*)qbBuffer.AllocThrows(byteCount); { - NewApis::LCMapStringEx(handle != NULL ? NULL : localeName, dwFlags, string, length, (LPWSTR)pByte, byteCount, NULL,NULL, (LPARAM) handle); + ::LCMapStringEx(handle != NULL ? NULL : localeName, dwFlags, string, length, (LPWSTR)pByte, byteCount, NULL,NULL, (LPARAM) handle); } iReturnHash = COMNlsHashProvider::s_NlsHashProvider.HashSortKey(pByte, byteCount); diff --git a/src/inc/downlevel.h b/src/inc/downlevel.h deleted file mode 100644 index b32673288c..0000000000 --- a/src/inc/downlevel.h +++ /dev/null @@ -1,239 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -//////////////////////////////////////////////////////////////////////////// -// -// File: downlevel.h -// - - -// -// Purpose: emulation on downlevel platforms. -// -//////////////////////////////////////////////////////////////////////////// - - - -// Vista LCTYPES -#ifndef LOCALE_SNAN -#define LOCALE_SNAN 0x00000069 // Not a Number -#endif - -#ifndef LOCALE_SPOSINFINITY -#define LOCALE_SPOSINFINITY 0x0000006a // + Infinity -#endif - -#ifndef LOCALE_SNEGINFINITY -#define LOCALE_SNEGINFINITY 0x0000006b // - Infinity -#endif - -#ifndef LOCALE_SPARENT -#define LOCALE_SPARENT 0x0000006d // Fallback name for resources, eg "en" for "en-US" -#endif - -// Win7 LCTYPES -#ifndef LOCALE_IREADINGLAYOUT -#define LOCALE_IREADINGLAYOUT 0x00000070 // Returns one of the following 4 reading layout values: - // 0 - Left to right (eg en-US) - // 1 - Right to left (eg arabic locales) - // 2 - Vertical top to bottom with columns to the left and also left to right (ja-JP locales) - // 3 - Vertical top to bottom with columns proceeding to the right -#endif - -#ifndef LOCALE_INEUTRAL -#define LOCALE_INEUTRAL 0x00000071 // Returns 0 for specific cultures, 1 for neutral cultures. -#endif - -// Win7 LCTypes -// -// These are the various forms of the name of the locale: -// -#define LOCALE_SLOCALIZEDDISPLAYNAME 0x00000002 // localized name of locale, eg "German (Germany)" in UI language -#define LOCALE_SENGLISHDISPLAYNAME 0x00000072 // Display name (language + country usually) in English, eg "German (Germany)" -#define LOCALE_SNATIVEDISPLAYNAME 0x00000073 // Display name in native locale language, eg "Deutsch (Deutschland) - -#define LOCALE_SLOCALIZEDLANGUAGENAME 0x0000006f // Language Display Name for a language, eg "German" in UI language -#define LOCALE_SENGLISHLANGUAGENAME 0x00001001 // English name of language, eg "German" -#define LOCALE_SNATIVELANGUAGENAME 0x00000004 // native name of language, eg "Deutsch" - -#define LOCALE_SLOCALIZEDCOUNTRYNAME 0x00000006 // localized name of country, eg "Germany" in UI language -#define LOCALE_SENGLISHCOUNTRYNAME 0x00001002 // English name of country, eg "Germany" -#define LOCALE_SNATIVECOUNTRYNAME 0x00000008 // native name of country, eg "Deutschland" - -#define LOCALE_INEGATIVEPERCENT 0x00000074 // Returns 0-11 for the negative percent format -#define LOCALE_IPOSITIVEPERCENT 0x00000075 // Returns 0-3 for the positive percent formatIPOSITIVEPERCENT -#define LOCALE_SPERCENT 0x00000076 // Returns the percent symbol -#define LOCALE_SPERMILLE 0x00000077 // Returns the permille (U+2030) symbol -#define LOCALE_SMONTHDAY 0x00000078 // Returns the preferred month/day format -#define LOCALE_SSHORTTIME 0x00000079 // Returns the preferred short time format (ie: no seconds, just h:mm) -#define LOCALE_SOPENTYPELANGUAGETAG 0x0000007a // Open type language tag, eg: "latn" or "dflt" -#define LOCALE_SSORTLOCALE 0x0000007b // Name of locale to use for sorting/collation/casing behavior. - -// TODO: These didn't make it to windows -// const LCTYPE RESERVED_SADERA = 0x000008b; // Era name for gregorian calendar (ie: A.D.) -// const LCTYPE RESERVED_SABBREVADERA = 0x000008c; // Abbreviated era name for gregorian calendar (ie: AD) - -// Vista CALTypes -#ifndef CAL_SSHORTESTDAYNAME1 -#define CAL_SSHORTESTDAYNAME1 0x00000031 -#define CAL_SSHORTESTDAYNAME2 0x00000032 -#define CAL_SSHORTESTDAYNAME3 0x00000033 -#define CAL_SSHORTESTDAYNAME4 0x00000034 -#define CAL_SSHORTESTDAYNAME5 0x00000035 -#define CAL_SSHORTESTDAYNAME6 0x00000036 -#define CAL_SSHORTESTDAYNAME7 0x00000037 -#endif - -// Win7 CALTypes -#define CAL_SMONTHDAY 0x00000038 // Month/day format -#define CAL_SABBREVERASTRING 0x00000039 // Abbreviated era string (eg: AD) - -// Vista linguistic comparison flags -#ifndef LINGUISTIC_IGNORECASE -#define LINGUISTIC_IGNORECASE 0x00000010 // linguistically appropriate 'ignore case' -#endif - -#ifndef LINGUISTIC_IGNOREDIACRITIC -#define LINGUISTIC_IGNOREDIACRITIC 0x00000020 // linguistically appropriate 'ignore nonspace' -#endif - -#ifndef NORM_LINGUISTIC_CASING -#define NORM_LINGUISTIC_CASING 0x08000000 // use linguistic rules for casing -#endif - -#ifndef LCMAP_TITLECASE -#define LCMAP_TITLECASE 0x00000300 // reserved for title case behavior -#endif - -#ifndef CALINFO_ENUMPROCEXEX -typedef BOOL (CALLBACK* CALINFO_ENUMPROCEXEX)(LPWSTR, CALID, LPWSTR, LPARAM); -#endif - -#ifndef DATEFMT_ENUMPROCEXEX -typedef BOOL (CALLBACK* DATEFMT_ENUMPROCEXEX)(LPWSTR, CALID, LPARAM); -#endif - -#ifndef TIMEFMT_ENUMPROCEX -typedef BOOL (CALLBACK* TIMEFMT_ENUMPROCEX)(LPWSTR, LPARAM); -#endif - -#ifndef HIGH_SURROGATE_START -#define HIGH_SURROGATE_START 0xd800 -#define HIGH_SURROGATE_END 0xdbff -#define LOW_SURROGATE_START 0xdc00 -#define LOW_SURROGATE_END 0xdfff -#endif - -#ifndef PRIVATE_USE_BEGIN -#define PRIVATE_USE_BEGIN 0xe000 -#define PRIVATE_USE_END 0xf8ff -#endif - -#ifndef LCMAP_TITLECASE -#define LCMAP_TITLECASE 0x00000300 // Title Case Letters -#endif - -#ifndef __out_xcount_opt -#define __out_xcount_opt(var) __out -#endif - -namespace DownLevel -{ - // User /system defaults - // TODO: I don't think we need all of these. - int GetSystemDefaultLocaleName(__out_ecount(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName); - __success(return == 1) DWORD GetUserPreferredUILanguages (__in DWORD dwFlags, __out PULONG pulNumLanguages, __out_ecount_opt(*pcchLanguagesBuffer) PWSTR pwszLanguagesBuffer, __in PULONG pcchLanguagesBuffer); - int GetUserDefaultLocaleName(__out_ecount(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName); - - // Locale and calendar information - int GetLocaleInfoEx (__in LPCWSTR lpLocaleName, __in LCTYPE LCType, __out_ecount_opt(cchData) LPWSTR lpLCData, __in int cchData); - int GetDateFormatEx(__in LPCWSTR lpLocaleName, __in DWORD dwFlags, __in_opt CONST SYSTEMTIME* lpDate, __in_opt LPCWSTR lpFormat, - __out_ecount(cchDate) LPWSTR lpDateStr, __in int cchDate, __in_opt LPCWSTR lpCalendar); - __success(return != 0) - int GetCalendarInfoEx(__in LPCWSTR lpLocaleName, - __in CALID Calendar, - __in_opt LPCWSTR pReserved, - __in CALTYPE CalType, - __out_ecount_opt(cchData) LPWSTR lpCalData, - __in int cchData, - __out_opt LPDWORD lpValue); - - // Compareinfo type information - int TurkishCompareStringIgnoreCase(LCID lcid, DWORD dwCmpFlags, LPCWSTR lpString1, int cchCount1, LPCWSTR lpString2, int cchCount2); - - int CompareStringEx(__in LPCWSTR lpLocaleName, __in DWORD dwCmpFlags, __in_ecount(cchCount1) LPCWSTR lpString1, __in int cchCount1, __in_ecount(cchCount2) LPCWSTR lpString2, - __in int cchCount2, __in_opt LPNLSVERSIONINFO lpVersionInformation, __in_opt LPVOID lpReserved, __in_opt LPARAM lParam ); - - int CompareStringOrdinal(__in_ecount(cchCount1) LPCWSTR string1, __in int cchCount1, __in_ecount(cchCount2) LPCWSTR string2, __in int cchCount2, __in BOOL bIgnoreCase); - - __success(return != 0) - int LCMapStringEx(__in LPCWSTR lpLocaleName, - __in DWORD dwMapFlags, - __in_ecount(cchSrc) LPCWSTR lpSrcStr, - __in int cchSrc, - __out_xcount_opt(cchDest) LPWSTR lpDestStr, - __in int cchDest, - __in_opt LPNLSVERSIONINFO lpVersionInformation, - __in_opt LPVOID lpReserved, - __in_opt LPARAM lParam); - - __success(return != -1) - int FindNLSStringEx(__in LPCWSTR lpLocaleName, - __in DWORD dwFindNLSStringFlags, - __in_ecount(cchSource) LPCWSTR lpStringSource, - __in int cchSource, - __in_ecount(cchValue) LPCWSTR lpStringValue, - __in int cchValue, - __out_opt LPINT pcchFound, - __in_opt LPNLSVERSIONINFO lpVersionInformation, - __in_opt LPVOID lpReserved, - __in_opt LPARAM lParam); - - BOOL IsNLSDefinedString(NLS_FUNCTION Function, DWORD dwFlags, LPNLSVERSIONINFOEX lpVersionInfo, LPCWSTR lpString, int cchStr ); - - // Enumerations - namespace LegacyCallbacks - { - BOOL EnumDateFormatsExEx(DATEFMT_ENUMPROCEXEX lpDateFmtEnumProcExEx, LPCWSTR lpLocaleName, DWORD dwFlags, LPARAM lParam); - BOOL EnumTimeFormatsEx(TIMEFMT_ENUMPROCEX lpTimeFmtEnumProcEx, LPCWSTR lpLocaleName, DWORD dwFlags, LPARAM lParam); - BOOL EnumCalendarInfoExEx(CALINFO_ENUMPROCEXEX pCalInfoEnumProcExEx, LPCWSTR lpLocaleName, CALID Calendar, LPCWSTR lpReserved, CALTYPE CalType, LPARAM lParam); - } - - // This is where we fudge data the OS doesn't know (even on Vista) - namespace UplevelFallback - { - __success(return != 0) - int LCMapStringEx(__in LPCWSTR lpLocaleName, - __in DWORD dwMapFlags, - __in_ecount(cchSrc) LPCWSTR lpSrcStr, - __in int cchSrc, - __out_xcount_opt(cchDest) LPWSTR lpDestStr, - __in int cchDest, - __in_opt LPNLSVERSIONINFO lpVersionInformation, - __in_opt LPVOID lpReserved, - __in_opt LPARAM lParam); - - int GetLocaleInfoEx(__in LPCWSTR lpLocaleName, __in LCID lcid, __in LCTYPE LCType, __out_ecount_opt(cchData) LPWSTR lpLCData, __in int cchData); - int GetCalendarInfoEx(__in LPCWSTR lpLocaleName, - __in CALID Calendar, - __in_opt LPCWSTR pReserved, - __in CALTYPE CalType, - __out_ecount_opt(cchData) LPWSTR lpCalData, - __in int cchData, - __out_opt LPDWORD lpValue); - } - - int LCIDToLocaleName(__in LCID Locale, __out_ecount_opt(cchName) LPWSTR lpName, __in int cchName, __in DWORD dwFlags); - LCID LocaleNameToLCID(__in LPCWSTR lpName , __in DWORD dwFlags); - - int ResolveLocaleName(__in LPCWSTR lpNameToResolve, __in_ecount_opt(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName); - - __success(return) - BOOL GetThreadPreferredUILanguages( __in DWORD dwFlags, - __out PULONG pulNumLanguages, - __out_ecount_opt(*pcchLanguagesBuffer) PWSTR pwszLanguagesBuffer, - __inout PULONG pcchLanguagesBuffer); - -}; - - diff --git a/src/inc/newapis.h b/src/inc/newapis.h deleted file mode 100644 index e0e6d999e1..0000000000 --- a/src/inc/newapis.h +++ /dev/null @@ -1,354 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -//////////////////////////////////////////////////////////////////////////// -// -// File: newapis.h -// - - -// -// Purpose: functions that need to be emulated on downlevel platforms. -// -//////////////////////////////////////////////////////////////////////////// - -#ifndef MUI_LANGUAGE_NAME -#define MUI_LANGUAGE_NAME 0 -#endif - -#ifndef CALINFO_ENUMPROCEXEX -typedef BOOL (CALLBACK* CALINFO_ENUMPROCEXEX)(LPWSTR, CALID, LPWSTR, LPARAM); -#endif - -#ifndef DATEFMT_ENUMPROCEXEX -typedef BOOL (CALLBACK* DATEFMT_ENUMPROCEXEX)(LPWSTR, CALID, LPARAM); -#endif - -#ifndef TIMEFMT_ENUMPROCEX -typedef BOOL (CALLBACK* TIMEFMT_ENUMPROCEX)(LPWSTR, LPARAM); -#endif - -#ifndef LOCALE_ENUMPROCEX -typedef BOOL (CALLBACK* LOCALE_ENUMPROCEX)(LPWSTR, DWORD, LPARAM); -#endif - -#if !defined(LPNLSVERSIONINFOEX) -#define LPNLSVERSIONINFOEX LPNLSVERSIONINFO -#endif - -#ifndef COMPARE_OPTIONS_ORDINAL -#define COMPARE_OPTIONS_ORDINAL 0x40000000 -#endif - -#ifndef LINGUISTIC_IGNORECASE -#define LINGUISTIC_IGNORECASE 0x00000010 // linguistically appropriate 'ignore case' -#endif - -#ifndef FIND_STARTSWITH -#define FIND_STARTSWITH 0x00100000 // see if value is at the beginning of source -#endif - -#ifndef FIND_ENDSWITH -#define FIND_ENDSWITH 0x00200000 // see if value is at the end of source -#endif - -#ifndef FIND_FROMSTART -#define FIND_FROMSTART 0x00400000 // look for value in source, starting at the beginning -#endif - -#ifndef FIND_FROMEND -#define FIND_FROMEND 0x00800000 // look for value in source, starting at the end -#endif - -#ifndef NORM_LINGUISTIC_CASING -#define NORM_LINGUISTIC_CASING 0x08000000 // use linguistic rules for casing -#endif - -#ifndef LCMAP_LINGUISTIC_CASING -#define LCMAP_LINGUISTIC_CASING 0x01000000 // use linguistic rules for casing -#endif - -#ifndef LCMAP_TITLECASE -#define LCMAP_TITLECASE 0x00000300 // Title Case Letters -#endif - -#ifndef LCMAP_SORTHANDLE -#define LCMAP_SORTHANDLE 0x20000000 -#endif - -#ifndef LCMAP_HASH -#define LCMAP_HASH 0x00040000 -#endif - -#ifndef LOCALE_ALL -#define LOCALE_ALL 0 // enumerate all named based locales -#endif // LOCALE_ALL - -#ifndef LOCALE_WINDOWS -#define LOCALE_WINDOWS 0x00000001 // shipped locales and/or replacements for them -#endif // LOCALE_WINDOWS - -#ifndef LOCALE_SUPPLEMENTAL -#define LOCALE_SUPPLEMENTAL 0x00000002 // supplemental locales only -#endif // LOCALE_SUPPLEMENTAL - -#ifndef LOCALE_ALTERNATE_SORTS -#define LOCALE_ALTERNATE_SORTS 0x00000004 // alternate sort locales -#endif // LOCALE_ALTERNATE_SORTS - -#ifndef LOCALE_NEUTRALDATA -#define LOCALE_NEUTRALDATA 0x00000010 // Locales that are "neutral" (language only, region data is default) -#endif // LOCALE_NEUTRALDATA - -#ifndef LOCALE_SPECIFICDATA -#define LOCALE_SPECIFICDATA 0x00000020 // Locales that contain language and region data -#endif // LOCALE_SPECIFICDATA - -#ifndef LOCALE_INEUTRAL -#define LOCALE_INEUTRAL 0x00000071 // Returns 0 for specific cultures, 1 for neutral cultures. -#endif // LOCALE_INEUTRAL - -#ifndef LOCALE_SSORTLOCALE -#define LOCALE_SSORTLOCALE 0x0000007b // Name of locale to use for sorting/collation/casing behavior. -#endif // LOCALE_SSORTLOCALE - -#ifndef LOCALE_RETURN_NUMBER -#define LOCALE_RETURN_NUMBER 0x20000000 // return number instead of string -#endif // LOCALE_RETURN_NUMBER - -#ifndef LOCALE_ALLOW_NEUTRAL_NAMES -#define LOCALE_ALLOW_NEUTRAL_NAMES 0x08000000 //Flag to allow returning neutral names/lcids for name conversion -#endif // LOCALE_ALLOW_NEUTRAL_NAMES - -#ifndef LOCALE_SNAME -#define LOCALE_SNAME 0x0000005c -#endif - -#define FIND_NLS_STRING_FLAGS_NEGATION (~(FIND_STARTSWITH | FIND_ENDSWITH | FIND_FROMSTART | FIND_FROMEND)) -#define CASING_BITS (NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE | NORM_IGNORECASE) - - -#ifndef __out_xcount_opt -#define __out_xcount_opt(var) -#endif - - // TODO: NLS Arrowhead -This isn't really right, custom locales could start with en- and have different sort behavior - // IS_FAST_COMPARE_LOCALE is used to do the fast ordinal index of when having string of Lower Ansi codepoints - // that less than 0x80. There are some locales that we cannot do optimization with, like Turkish and Azeri - // because of Turkish I problem and Humgerian because of lower Ansi compressions. -#define IS_FAST_COMPARE_LOCALE(loc) \ - (wcsncmp(loc,W("tr-"),3)!=0 && wcsncmp(loc,W("az-"),3)!=0 && wcsncmp(loc,W("hu-"),3)!=0) - -#define TURKISH_LOCALE_NAME W("tr-TR") -#define AZERBAIJAN_LOCALE_NAME W("az-Latn-AZ") -#define TURKISH_SORTING_LOCALE_NAME W("tr-TR_turkic") -#define AZERBAIJAN_SORTING_LOCALE_NAME W("az-Latn-AZ_turkic") - -#define MUI_MERGE_SYSTEM_FALLBACK 0x10 -#define MUI_MERGE_USER_FALLBACK 0x20 - - -namespace NewApis -{ -#if defined(FEATURE_CORESYSTEM) - __inline bool IsWindows7Platform() - { - return true; - } - - __inline bool IsVistaPlatform() - { - return false; - } - - __inline BOOL IsZhTwSku() - { - return false; - } - -#else - // Return true if we're on Windows 7 or up (ie: if we have neutral native support and sorting knows about versions) - __inline bool IsWindows7Platform() - { - static int isRunningOnWindows7 = -1; // -1 notinitialized, 0 not running on Windows 7, other value means running on Windows 7 - - if (isRunningOnWindows7 == -1) - { - OSVERSIONINFOEX sVer; - ZeroMemory(&sVer, sizeof(OSVERSIONINFOEX)); - sVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - sVer.dwMajorVersion = 6; - sVer.dwMinorVersion = 1; - sVer.dwPlatformId = VER_PLATFORM_WIN32_NT; - - DWORDLONG dwlConditionMask = 0; - VER_SET_CONDITION(dwlConditionMask, CLR_VER_MAJORVERSION, VER_GREATER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, CLR_VER_MINORVERSION, VER_GREATER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, CLR_VER_PLATFORMID, VER_EQUAL); - - if(VerifyVersionInfo(&sVer, CLR_VER_MAJORVERSION|CLR_VER_MINORVERSION|CLR_VER_PLATFORMID, dwlConditionMask)) - { - isRunningOnWindows7 = 1; - } - else - { - isRunningOnWindows7 = 0; - } - } - - return isRunningOnWindows7 == 1; - } - - // - // IsVistaPlatform return true if running on Vista and false if running on pre or post Vista - // - __inline BOOL IsVistaPlatform() - { - static int isRunningOnVista = -1; // -1 notinitialized, 0 not running on Vista, other value meanse running on Vista - - if (isRunningOnVista == -1) - { - OSVERSIONINFOEX sVer; - ZeroMemory(&sVer, sizeof(OSVERSIONINFOEX)); - sVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - sVer.dwMajorVersion = 6; - sVer.dwMinorVersion = 0; - sVer.dwPlatformId = VER_PLATFORM_WIN32_NT; - - DWORDLONG dwlConditionMask = 0; - VER_SET_CONDITION(dwlConditionMask, CLR_VER_MAJORVERSION, VER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, CLR_VER_MINORVERSION, VER_EQUAL); - VER_SET_CONDITION(dwlConditionMask, CLR_VER_PLATFORMID, VER_EQUAL); - - if(VerifyVersionInfo(&sVer, CLR_VER_MAJORVERSION|CLR_VER_MINORVERSION|CLR_VER_PLATFORMID, dwlConditionMask)) - { - isRunningOnVista = 1; - } - else - { - isRunningOnVista = 0; - } - } - - return isRunningOnVista == 1; - } - - - __inline BOOL IsZhTwSku() - { - const INT32 LANGID_ZH_TW = 0x0404; - LPCWSTR DEFAULT_REGION_NAME_0404 = W("\x53f0\x7063"); - - if(::GetSystemDefaultUILanguage() == LANGID_ZH_TW) - { - WCHAR wszBuffer[32]; - int result = ::GetLocaleInfoW(LANGID_ZH_TW, LOCALE_SNATIVECTRYNAME, wszBuffer, 32); - if (result) - { - if (wcsncmp(wszBuffer, DEFAULT_REGION_NAME_0404, 3) != 0) - { - return true; - } - } - } - return false; - } -#endif // FEATURE_CORESYSTEM - - __inline BOOL NotLeakingFrameworkOnlyCultures(__in LPCWSTR lpLocaleName) - { - return wcscmp(lpLocaleName, W("zh-CHS")) != 0 - && wcscmp(lpLocaleName, W("zh-CHT")) != 0; - } - - // System/user defaults - __success(return == TRUE) BOOL - GetUserPreferredUILanguages (__in DWORD dwFlags, __out PULONG pulNumLanguages, __out_ecount_opt(*pcchLanguagesBuffer) PWSTR pwszLanguagesBuffer, __in PULONG pcchLanguagesBuffer); - - __success(return > 0) int - GetSystemDefaultLocaleName(__out_ecount(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName); - - __success(return != 0) int - GetUserDefaultLocaleName(__out_ecount(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName); - - // Comparison functions (ala CompareInfo) - int CompareStringEx(__in LPCWSTR lpLocaleName, __in DWORD dwCmpFlags, __in_ecount(cchCount1) LPCWSTR lpString1, __in int cchCount1, __in_ecount(cchCount2) LPCWSTR lpString2, - __in int cchCount2, __in_opt LPNLSVERSIONINFO lpVersionInformation, __in_opt LPVOID lpReserved, __in_opt LPARAM lParam ); - - int CompareStringOrdinal(__in_ecount(cchCount1) LPCWSTR lpString1, __in int cchCount1, __in_ecount(cchCount2) LPCWSTR lpString2, __in int cchCount2, __in BOOL bIgnoreCase); - - int LCMapStringEx (__in LPCWSTR lpLocaleName, __in DWORD dwMapFlags, __in_ecount(cchSrc) LPCWSTR lpSrcStr, __in int cchSrc, - __out_xcount_opt(cchDest) LPWSTR lpDestStr, __in int cchDest, __in_opt LPNLSVERSIONINFO lpVersionInformation, __in_opt LPVOID lpReserved, __in_opt LPARAM lParam ); - - LPWSTR GetLingusticLocaleName(__in LPWSTR pLocaleName, __in DWORD dwFlags); - - int IndexOfString(__in LPCWSTR lpLocaleName, - __in_ecount(cchCount1) LPCWSTR pString1, // String to search in - __in int cchCount1, // length of pString1 - __in_ecount(cchCount2) LPCWSTR pString2, // String we're looking for - __in int cchCount2, // length of pString2 - __in DWORD dwFlags, // search flags - __in BOOL startWith, - __out_opt LPINT pcchFound); - - int LastIndexOfString(__in LPCWSTR lpLocaleName, - __in_ecount(cchCount1) LPCWSTR pString1, // String to search in - __in int cchCount1, // length of pString1 - __in_ecount(cchCount2) LPCWSTR pString2, // String we're looking for - __in int cchCount2, // length of pString2 - __in DWORD dwFlags, - __in BOOL endWith, - __out_opt LPINT pcchFound); - - int FindNLSStringEx(__in LPCWSTR lpLocaleName, - __in DWORD dwFindNLSStringFlags, - __in_ecount(cchSource) LPCWSTR lpStringSource, - __in int cchSource, - __in_ecount(cchValue) LPCWSTR lpStringValue, - __in int cchValue, - __out_opt LPINT pcchFound, - __in_opt LPNLSVERSIONINFO lpVersionInformation, - __in_opt LPVOID lpReserved, - __in_opt LPARAM lParam); - - BOOL IsNLSDefinedString(__in NLS_FUNCTION Function, __in DWORD dwFlags, __in_opt LPNLSVERSIONINFOEX lpVersionInfo, __in LPCWSTR lpString, __in int cchStr ); - - // Calendar and locale information - __success(return != 0) int - GetCalendarInfoEx(__in LPCWSTR lpLocaleName, __in CALID Calendar, __in_opt LPCWSTR pReserved, __in CALTYPE CalType, __out_ecount_opt(cchData) LPWSTR lpCalData, __in int cchData, __out_opt LPDWORD lpValue ); - - __success(return != 0) int - GetLocaleInfoEx (__in LPCWSTR lpLocaleName, __in LCTYPE LCType, __out_ecount_opt(cchData) LPWSTR lpLCData, __in int cchData); - - __success(return != 0) int - GetDateFormatEx(__in LPCWSTR lpLocaleName, __in DWORD dwFlags, __in_opt CONST SYSTEMTIME* lpDate, __in_opt LPCWSTR lpFormat, - __out_ecount(cchDate) LPWSTR lpDateStr, __in int cchDate, __in_opt LPCWSTR lpCalendar); - - // Enumeration functions - __success(return != 0) BOOL - EnumDateFormatsExEx (DATEFMT_ENUMPROCEXEX lpDateFmtEnumProcExEx, LPCWSTR lpLocaleName, DWORD dwFlags, LPARAM lParam); - __success(return != 0) - BOOL EnumTimeFormatsEx(TIMEFMT_ENUMPROCEX lpTimeFmtEnumProcEx, LPCWSTR lpLocaleName, DWORD dwFlags, LPARAM lParam); - __success(return != 0) - BOOL EnumCalendarInfoExEx(CALINFO_ENUMPROCEXEX pCalInfoEnumProcExEx, LPCWSTR lpLocaleName, CALID Calendar, CALTYPE CalType, LPARAM lParam); - - int LCIDToLocaleName(__in LCID Locale, __out_ecount_opt(cchName) LPWSTR lpName, __in int cchName, __in DWORD dwFlags); - LCID LocaleNameToLCID(__in LPCWSTR lpName , __in DWORD dwFlags); - - int ResolveLocaleName(__in LPCWSTR lpNameToResolve, __in_ecount_opt(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName); - - __success(return == TRUE) BOOL - GetThreadPreferredUILanguages(__in DWORD dwFlags, - __out PULONG pulNumLanguages, - __out_ecount_opt(*pcchLanguagesBuffer) PWSTR pwszLanguagesBuffer, - __inout PULONG pcchLanguagesBuffer); - - BOOL WINAPI EnumSystemLocalesEx(__in LOCALE_ENUMPROCEX lpLocaleEnumProc, - __in DWORD dwFlags, - __in LPARAM lParam, - __in_opt LPVOID lpReserved); - -}; - - - diff --git a/src/inc/utilcode.h b/src/inc/utilcode.h index 9226d682e2..ef823e68de 100644 --- a/src/inc/utilcode.h +++ b/src/inc/utilcode.h @@ -595,7 +595,7 @@ BOOL CLRFreeLibrary(HMODULE hModule); // Load a string using the resources for the current module. STDAPI UtilLoadStringRC(UINT iResouceID, __out_ecount (iMax) LPWSTR szBuffer, int iMax, int bQuiet=FALSE); -#if defined(ENABLE_DOWNLEVEL_FOR_NLS) || defined(FEATURE_USE_LCID) +#ifdef FEATURE_USE_LCID STDAPI UtilLoadStringRCEx(LCID lcid, UINT iResourceID, __out_ecount (iMax) LPWSTR szBuffer, int iMax, int bQuiet, int *pcwchUsed); #endif diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index 7aadbda126..60f4a81c66 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -299,40 +299,6 @@ typedef long time_t; #define _TIME_T_DEFINED #endif // !PAL_STDCPP_COMPAT -#if ENABLE_DOWNLEVEL_FOR_NLS -#define MAKELCID(lgid, srtid) ((DWORD)((((DWORD)((WORD )(srtid))) << 16) | \ - ((DWORD)((WORD )(lgid))))) -#define LANGIDFROMLCID(lcid) ((WORD)(lcid)) -#define SORTIDFROMLCID(lcid) ((WORD)((((DWORD)(lcid)) >> 16) & 0xf)) - -#define LANG_NEUTRAL 0x00 -#define LANG_INVARIANT 0x7f -#define SUBLANG_NEUTRAL 0x00 // language neutral -#define SUBLANG_DEFAULT 0x01 // user default -#define SORT_DEFAULT 0x0 // sorting default -#define SUBLANG_SYS_DEFAULT 0x02 // system default - -#define MAKELANGID(p, s) ((((WORD )(s)) << 10) | (WORD )(p)) -#define PRIMARYLANGID(lgid) ((WORD )(lgid) & 0x3ff) -#define SUBLANGID(lgid) ((WORD )(lgid) >> 10) - -#define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT)) -#define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)) -#define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)) -#define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)) -#define LOCALE_NEUTRAL (MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT)) -#define LOCALE_US_ENGLISH (MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)) -#define LOCALE_INVARIANT (MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT)) - -#define SUBLANG_ENGLISH_US 0x01 -#define SUBLANG_CHINESE_TRADITIONAL 0x01 /* Chinese (Traditional) */ - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - - -#define CT_CTYPE1 0x00000001 /* ctype 1 information */ -#define CT_CTYPE2 0x00000002 /* ctype 2 information */ -#define CT_CTYPE3 0x00000004 /* ctype 3 information */ #define C1_UPPER 0x0001 /* upper case */ #define C1_LOWER 0x0002 /* lower case */ #define C1_DIGIT 0x0004 /* decimal digits */ @@ -342,31 +308,6 @@ typedef long time_t; #define C1_BLANK 0x0040 /* blank characters */ #define C1_XDIGIT 0x0080 /* other digits */ #define C1_ALPHA 0x0100 /* any linguistic character */ -#define C2_LEFTTORIGHT 0x0001 /* left to right */ -#define C2_RIGHTTOLEFT 0x0002 /* right to left */ -#define C2_EUROPENUMBER 0x0003 /* European number, digit */ -#define C2_EUROPESEPARATOR 0x0004 /* European numeric separator */ -#define C2_EUROPETERMINATOR 0x0005 /* European numeric terminator */ -#define C2_ARABICNUMBER 0x0006 /* Arabic number */ -#define C2_COMMONSEPARATOR 0x0007 /* common numeric separator */ -#define C2_BLOCKSEPARATOR 0x0008 /* block separator */ -#define C2_SEGMENTSEPARATOR 0x0009 /* segment separator */ -#define C2_WHITESPACE 0x000A /* white space */ -#define C2_OTHERNEUTRAL 0x000B /* other neutrals */ -#define C2_NOTAPPLICABLE 0x0000 /* no implicit directionality */ -#define C3_NONSPACING 0x0001 /* nonspacing character */ -#define C3_DIACRITIC 0x0002 /* diacritic mark */ -#define C3_VOWELMARK 0x0004 /* vowel mark */ -#define C3_SYMBOL 0x0008 /* symbols */ -#define C3_KATAKANA 0x0010 /* katakana character */ -#define C3_HIRAGANA 0x0020 /* hiragana character */ -#define C3_HALFWIDTH 0x0040 /* half width character */ -#define C3_FULLWIDTH 0x0080 /* full width character */ -#define C3_IDEOGRAPH 0x0100 /* ideographic character */ -#define C3_KASHIDA 0x0200 /* Arabic kashida character */ -#define C3_LEXICAL 0x0400 /* lexical character */ -#define C3_ALPHA 0x8000 /* any ling. char (C1_ALPHA) */ -#define C3_NOTAPPLICABLE 0x0000 /* ctype 3 is not applicable */ #define DLL_PROCESS_ATTACH 1 #define DLL_THREAD_ATTACH 2 @@ -2906,84 +2847,6 @@ FlushInstructionCache( IN LPCVOID lpBaseAddress, IN SIZE_T dwSize); -#if ENABLE_DOWNLEVEL_FOR_NLS - -PALIMPORT -BOOL -PALAPI -GetStringTypeExW( - IN LCID Locale, - IN DWORD dwInfoType, - IN LPCWSTR lpSrcStr, - IN int cchSrc, - OUT LPWORD lpCharType); - -#ifdef UNICODE -#define GetStringTypeEx GetStringTypeExW -#endif - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - - -#define NORM_IGNORECASE 0x00000001 // ignore case -#define NORM_IGNOREWIDTH 0x00020000 // ignore width - -#define NORM_LINGUISTIC_CASING 0x08000000 // use linguistic rules for casing - -#ifdef __APPLE__ -#define NORM_IGNORENONSPACE 0x00000002 // ignore nonspacing chars -#define NORM_IGNORESYMBOLS 0x00000004 // ignore symbols -#define NORM_IGNOREKANATYPE 0x00010000 // ignore kanatype -#define SORT_STRINGSORT 0x00001000 // use string sort method -#endif // __APPLE__ - - -typedef struct nlsversioninfo { - DWORD dwNLSVersionInfoSize; - DWORD dwNLSVersion; - DWORD dwDefinedVersion; -} NLSVERSIONINFO, *LPNLSVERSIONINFO; - -#define CSTR_LESS_THAN 1 -#define CSTR_EQUAL 2 -#define CSTR_GREATER_THAN 3 - -#if ENABLE_DOWNLEVEL_FOR_NLS - - -PALIMPORT -int -PALAPI -CompareStringW( - IN LCID Locale, - IN DWORD dwCmpFlags, - IN LPCWSTR lpString1, - IN int cchCount1, - IN LPCWSTR lpString2, - IN int cchCount2); - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - - -PALIMPORT -int -PALAPI -CompareStringEx( - IN LPCWSTR lpLocaleName, - IN DWORD dwCmpFlags, - IN LPCWSTR lpString1, - IN int cchCount1, - IN LPCWSTR lpString2, - IN int cchCount2, - IN LPNLSVERSIONINFO lpVersionInformation, - IN LPVOID lpReserved, - IN LPARAM lParam); - - -#ifdef UNICODE -#define CompareString CompareStringW -#endif - #define MAX_LEADBYTES 12 #define MAX_DEFAULTCHAR 2 @@ -3054,692 +2917,6 @@ WideCharToMultiByte( IN LPCSTR lpDefaultChar, OUT LPBOOL lpUsedDefaultChar); -#if ENABLE_DOWNLEVEL_FOR_NLS - -PALIMPORT -LANGID -PALAPI -GetSystemDefaultLangID( - void); - -PALIMPORT -LANGID -PALAPI -GetUserDefaultLangID( - void); - -PALIMPORT -BOOL -PALAPI -SetThreadLocale( - IN LCID Locale); - -PALIMPORT -LCID -PALAPI -GetThreadLocale( - void); - -#endif //ENABLE_DOWNLEVEL_FOR_NLS - -// -// Locale Types. -// -// These types are used for the GetLocaleInfo NLS API routine. -// - -#ifdef __APPLE__ - -// -// The following LCTypes may be used in combination with any other LCTypes. -// -// LOCALE_NOUSEROVERRIDE is also used in GetTimeFormat and -// GetDateFormat. -// -// LOCALE_RETURN_NUMBER will return the result from GetLocaleInfo as a -// number instead of a string. This flag is only valid for the LCTypes -// beginning with LOCALE_I. -// -#define LOCALE_NOUSEROVERRIDE 0x80000000 /* do not use user overrides */ -#define LOCALE_RETURN_NUMBER 0x20000000 /* return number instead of string */ -#define LOCALE_RETURN_GENITIVE_NAMES 0x10000000 //Flag to return the Genitive forms of month names - -#define LOCALE_SLOCALIZEDDISPLAYNAME 0x00000002 // localized name of locale, eg "German (Germany)" in UI language -#define LOCALE_SENGLISHDISPLAYNAME 0x00000072 // Display name (language + country usually) in English, eg "German (Germany)" -#define LOCALE_SNATIVEDISPLAYNAME 0x00000073 // Display name in native locale language, eg "Deutsch (Deutschland) - -#define LOCALE_SLOCALIZEDLANGUAGENAME 0x0000006f // Language Display Name for a language, eg "German" in UI language -#define LOCALE_SENGLISHLANGUAGENAME 0x00001001 // English name of language, eg "German" -#define LOCALE_SNATIVELANGUAGENAME 0x00000004 // native name of language, eg "Deutsch" - -#define LOCALE_SLOCALIZEDCOUNTRYNAME 0x00000006 // localized name of country, eg "Germany" in UI language -#define LOCALE_SENGLISHCOUNTRYNAME 0x00001002 // English name of country, eg "Germany" -#define LOCALE_SNATIVECOUNTRYNAME 0x00000008 // native name of country, eg "Deutschland" - -// -// The following LCTypes are mutually exclusive in that they may NOT -// be used in combination with each other. -// -#define LOCALE_ILANGUAGE 0x00000001 /* language id */ -#define LOCALE_SLANGUAGE 0x00000002 /* localized name of language */ -#define LOCALE_SENGLANGUAGE 0x00001001 /* English name of language */ -#define LOCALE_SABBREVLANGNAME 0x00000003 /* abbreviated language name */ -#define LOCALE_SNATIVELANGNAME 0x00000004 /* native name of language */ -#define LOCALE_ICOUNTRY 0x00000005 /* country code */ -#define LOCALE_SCOUNTRY 0x00000006 /* localized name of country */ - -#define LOCALE_SENGCOUNTRY 0x00001002 /* English name of country */ -#define LOCALE_SABBREVCTRYNAME 0x00000007 /* abbreviated country name */ -#define LOCALE_SNATIVECTRYNAME 0x00000008 /* native name of country */ - -#define LOCALE_SLIST 0x0000000C /* list item separator */ -#define LOCALE_IMEASURE 0x0000000D /* 0 = metric, 1 = US */ - -#define LOCALE_SDECIMAL 0x0000000E /* decimal separator */ -#define LOCALE_STHOUSAND 0x0000000F /* thousand separator */ -#define LOCALE_SGROUPING 0x00000010 /* digit grouping */ -#define LOCALE_IDIGITS 0x00000011 /* number of fractional digits */ -#define LOCALE_ILZERO 0x00000012 /* leading zeros for decimal */ -#define LOCALE_INEGNUMBER 0x00001010 /* negative number mode */ -#define LOCALE_SNATIVEDIGITS 0x00000013 /* native ascii 0-9 */ - -#define LOCALE_SCURRENCY 0x00000014 /* local monetary symbol */ -#define LOCALE_SINTLSYMBOL 0x00000015 /* intl monetary symbol */ -#define LOCALE_SMONDECIMALSEP 0x00000016 /* monetary decimal separator */ -#define LOCALE_SMONTHOUSANDSEP 0x00000017 /* monetary thousand separator */ -#define LOCALE_SMONGROUPING 0x00000018 /* monetary grouping */ -#define LOCALE_ICURRDIGITS 0x00000019 /* # local monetary digits */ -#define LOCALE_IINTLCURRDIGITS 0x0000001A /* # intl monetary digits */ -#define LOCALE_ICURRENCY 0x0000001B /* positive currency mode */ -#define LOCALE_INEGCURR 0x0000001C /* negative currency mode */ - -#define LOCALE_SSHORTDATE 0x0000001F /* short date format string */ -#define LOCALE_SLONGDATE 0x00000020 /* long date format string */ -#define LOCALE_STIMEFORMAT 0x00001003 /* time format string */ -#define LOCALE_S1159 0x00000028 /* AM designator */ -#define LOCALE_S2359 0x00000029 /* PM designator */ - -#define LOCALE_ICALENDARTYPE 0x00001009 /* type of calendar specifier */ -#define LOCALE_IFIRSTDAYOFWEEK 0x0000100C /* first day of week specifier */ -#define LOCALE_IFIRSTWEEKOFYEAR 0x0000100D /* first week of year specifier */ - -#define LOCALE_SDAYNAME1 0x0000002A /* long name for Monday */ -#define LOCALE_SDAYNAME2 0x0000002B /* long name for Tuesday */ -#define LOCALE_SDAYNAME3 0x0000002C /* long name for Wednesday */ -#define LOCALE_SDAYNAME4 0x0000002D /* long name for Thursday */ -#define LOCALE_SDAYNAME5 0x0000002E /* long name for Friday */ -#define LOCALE_SDAYNAME6 0x0000002F /* long name for Saturday */ -#define LOCALE_SDAYNAME7 0x00000030 /* long name for Sunday */ -#define LOCALE_SABBREVDAYNAME1 0x00000031 /* abbreviated name for Monday */ -#define LOCALE_SABBREVDAYNAME2 0x00000032 /* abbreviated name for Tuesday */ -#define LOCALE_SABBREVDAYNAME3 0x00000033 /* abbreviated name for Wednesday */ -#define LOCALE_SABBREVDAYNAME4 0x00000034 /* abbreviated name for Thursday */ -#define LOCALE_SABBREVDAYNAME5 0x00000035 /* abbreviated name for Friday */ -#define LOCALE_SABBREVDAYNAME6 0x00000036 /* abbreviated name for Saturday */ -#define LOCALE_SABBREVDAYNAME7 0x00000037 /* abbreviated name for Sunday */ -#define LOCALE_SMONTHNAME1 0x00000038 /* long name for January */ -#define LOCALE_SMONTHNAME2 0x00000039 /* long name for February */ -#define LOCALE_SMONTHNAME3 0x0000003A /* long name for March */ -#define LOCALE_SMONTHNAME4 0x0000003B /* long name for April */ -#define LOCALE_SMONTHNAME5 0x0000003C /* long name for May */ -#define LOCALE_SMONTHNAME6 0x0000003D /* long name for June */ -#define LOCALE_SMONTHNAME7 0x0000003E /* long name for July */ -#define LOCALE_SMONTHNAME8 0x0000003F /* long name for August */ -#define LOCALE_SMONTHNAME9 0x00000040 /* long name for September */ -#define LOCALE_SMONTHNAME10 0x00000041 /* long name for October */ -#define LOCALE_SMONTHNAME11 0x00000042 /* long name for November */ -#define LOCALE_SMONTHNAME12 0x00000043 /* long name for December */ -#define LOCALE_SMONTHNAME13 0x0000100E /* long name for 13th month (if exists) */ -#define LOCALE_SABBREVMONTHNAME1 0x00000044 /* abbreviated name for January */ -#define LOCALE_SABBREVMONTHNAME2 0x00000045 /* abbreviated name for February */ -#define LOCALE_SABBREVMONTHNAME3 0x00000046 /* abbreviated name for March */ -#define LOCALE_SABBREVMONTHNAME4 0x00000047 /* abbreviated name for April */ -#define LOCALE_SABBREVMONTHNAME5 0x00000048 /* abbreviated name for May */ -#define LOCALE_SABBREVMONTHNAME6 0x00000049 /* abbreviated name for June */ -#define LOCALE_SABBREVMONTHNAME7 0x0000004A /* abbreviated name for July */ -#define LOCALE_SABBREVMONTHNAME8 0x0000004B /* abbreviated name for August */ -#define LOCALE_SABBREVMONTHNAME9 0x0000004C /* abbreviated name for September */ -#define LOCALE_SABBREVMONTHNAME10 0x0000004D /* abbreviated name for October */ -#define LOCALE_SABBREVMONTHNAME11 0x0000004E /* abbreviated name for November */ -#define LOCALE_SABBREVMONTHNAME12 0x0000004F /* abbreviated name for December */ -#define LOCALE_SABBREVMONTHNAME13 0x0000100F /* abbreviated name for 13th month (if exists) */ - -#define LOCALE_SPOSITIVESIGN 0x00000050 /* positive sign */ -#define LOCALE_SNEGATIVESIGN 0x00000051 /* negative sign */ - -#define LOCALE_FONTSIGNATURE 0x00000058 /* font signature */ -#define LOCALE_SISO639LANGNAME 0x00000059 /* ISO abbreviated language name */ -#define LOCALE_SISO3166CTRYNAME 0x0000005A /* ISO abbreviated country name */ - -#define LOCALE_SENGCURRNAME 0x00001007 /* english name of currency */ -#define LOCALE_SNATIVECURRNAME 0x00001008 /* native name of currency */ -#define LOCALE_SYEARMONTH 0x00001006 /* year month format string */ -#define LOCALE_IDIGITSUBSTITUTION 0x00001014 /* 0 = context, 1 = none, 2 = national */ - -#define LOCALE_SNAME 0x0000005C /* locale name <language>[-<Script>][-<REGION>[_<sort order>]] */ -#define LOCALE_SDURATION 0x0000005d /* time duration format */ -#define LOCALE_SKEYBOARDSTOINSTALL 0x0000005e /* (windows only) keyboards to install */ -#define LOCALE_SSHORTESTDAYNAME1 0x00000060 /* Shortest day name for Monday */ -#define LOCALE_SSHORTESTDAYNAME2 0x00000061 /* Shortest day name for Tuesday */ -#define LOCALE_SSHORTESTDAYNAME3 0x00000062 /* Shortest day name for Wednesday */ -#define LOCALE_SSHORTESTDAYNAME4 0x00000063 /* Shortest day name for Thursday */ -#define LOCALE_SSHORTESTDAYNAME5 0x00000064 /* Shortest day name for Friday */ -#define LOCALE_SSHORTESTDAYNAME6 0x00000065 /* Shortest day name for Saturday */ -#define LOCALE_SSHORTESTDAYNAME7 0x00000066 /* Shortest day name for Sunday */ -#define LOCALE_SISO639LANGNAME2 0x00000067 /* 3 character ISO abbreviated language name */ -#define LOCALE_SISO3166CTRYNAME2 0x00000068 /* 3 character ISO country name */ -#define LOCALE_SNAN 0x00000069 /* Not a Number */ -#define LOCALE_SPOSINFINITY 0x0000006a /* + Infinity */ -#define LOCALE_SNEGINFINITY 0x0000006b /* - Infinity */ -#define LOCALE_SSCRIPTS 0x0000006c /* Typical scripts in the locale */ -#define LOCALE_SPARENT 0x0000006d /* Fallback name for resources */ -#define LOCALE_SCONSOLEFALLBACKNAME 0x0000006e /* Fallback name for within the console */ -#define LOCALE_SLANGDISPLAYNAME 0x0000006f /* Language Display Name for a language */ -#define LOCALE_IREADINGLAYOUT 0x00000070 // Returns one of the following 4 reading layout values: - // 0 - Left to right (eg en-US) - // 1 - Right to left (eg arabic locales) - // 2 - Vertical top to bottom with columns to the left and also left to right (ja-JP locales) - // 3 - Vertical top to bottom with columns proceeding to the right -#define LOCALE_INEUTRAL 0x00000071 // Returns 0 for specific cultures, 1 for neutral cultures. -#define LOCALE_INEGATIVEPERCENT 0x00000074 // Returns 0-11 for the negative percent format -#define LOCALE_IPOSITIVEPERCENT 0x00000075 // Returns 0-3 for the positive percent formatIPOSITIVEPERCENT -#define LOCALE_SPERCENT 0x00000076 // Returns the percent symbol -#define LOCALE_SPERMILLE 0x00000077 // Returns the permille (U+2030) symbol -#define LOCALE_SMONTHDAY 0x00000078 // Returns the preferred month/day format -#define LOCALE_SSHORTTIME 0x00000079 // Returns the preferred short time format (ie: no seconds, just h:mm) -#define LOCALE_SOPENTYPELANGUAGETAG 0x0000007a // Open type language tag, eg: "latn" or "dflt" -#define LOCALE_SSORTLOCALE 0x0000007b // Name of locale to use for sorting/collation/casing behavior. - -#define LCMAP_LINGUISTIC_CASING 0x01000000 /* Use linguistic casing */ - -#define CAL_RETURN_GENITIVE_NAMES LOCALE_RETURN_GENITIVE_NAMES // return genitive forms of month names - -#define CAL_SSHORTESTDAYNAME1 0x00000031 -#define CAL_SSHORTESTDAYNAME2 0x00000032 -#define CAL_SSHORTESTDAYNAME3 0x00000033 -#define CAL_SSHORTESTDAYNAME4 0x00000034 -#define CAL_SSHORTESTDAYNAME5 0x00000035 -#define CAL_SSHORTESTDAYNAME6 0x00000036 -#define CAL_SSHORTESTDAYNAME7 0x00000037 - -#define CAL_SMONTHDAY 0x00000038 // Month/day pattern (reserve for potential inclusion in a future version) -#define CAL_SERASTRING 0x00000004 // era name for IYearOffsetRanges, eg A.D. -#define CAL_SABBREVERASTRING 0x00000039 // Abbreviated era string (eg: AD) - -#define CAL_SSHORTDATE 0x00000005 /* short date format string */ -#define CAL_SLONGDATE 0x00000006 /* long date format string */ -#define CAL_SDAYNAME1 0x00000007 /* native name for Monday */ -#define CAL_SDAYNAME2 0x00000008 /* native name for Tuesday */ -#define CAL_SDAYNAME3 0x00000009 /* native name for Wednesday */ -#define CAL_SDAYNAME4 0x0000000a /* native name for Thursday */ -#define CAL_SDAYNAME5 0x0000000b /* native name for Friday */ -#define CAL_SDAYNAME6 0x0000000c /* native name for Saturday */ -#define CAL_SDAYNAME7 0x0000000d /* native name for Sunday */ -#define CAL_SABBREVDAYNAME1 0x0000000e /* abbreviated name for Monday */ -#define CAL_SABBREVDAYNAME2 0x0000000f /* abbreviated name for Tuesday */ -#define CAL_SABBREVDAYNAME3 0x00000010 /* abbreviated name for Wednesday */ -#define CAL_SABBREVDAYNAME4 0x00000011 /* abbreviated name for Thursday */ -#define CAL_SABBREVDAYNAME5 0x00000012 /* abbreviated name for Friday */ -#define CAL_SABBREVDAYNAME6 0x00000013 /* abbreviated name for Saturday */ -#define CAL_SABBREVDAYNAME7 0x00000014 /* abbreviated name for Sunday */ -#define CAL_SMONTHNAME1 0x00000015 /* native name for January */ -#define CAL_SMONTHNAME2 0x00000016 /* native name for February */ -#define CAL_SMONTHNAME3 0x00000017 /* native name for March */ -#define CAL_SMONTHNAME4 0x00000018 /* native name for April */ -#define CAL_SMONTHNAME5 0x00000019 /* native name for May */ -#define CAL_SMONTHNAME6 0x0000001a /* native name for June */ -#define CAL_SMONTHNAME7 0x0000001b /* native name for July */ -#define CAL_SMONTHNAME8 0x0000001c /* native name for August */ -#define CAL_SMONTHNAME9 0x0000001d /* native name for September */ -#define CAL_SMONTHNAME10 0x0000001e /* native name for October */ -#define CAL_SMONTHNAME11 0x0000001f /* native name for November */ -#define CAL_SMONTHNAME12 0x00000020 /* native name for December */ -#define CAL_SMONTHNAME13 0x00000021 /* native name for 13th month (if any) */ -#define CAL_SABBREVMONTHNAME1 0x00000022 /* abbreviated name for January */ -#define CAL_SABBREVMONTHNAME2 0x00000023 /* abbreviated name for February */ -#define CAL_SABBREVMONTHNAME3 0x00000024 /* abbreviated name for March */ -#define CAL_SABBREVMONTHNAME4 0x00000025 /* abbreviated name for April */ -#define CAL_SABBREVMONTHNAME5 0x00000026 /* abbreviated name for May */ -#define CAL_SABBREVMONTHNAME6 0x00000027 /* abbreviated name for June */ -#define CAL_SABBREVMONTHNAME7 0x00000028 /* abbreviated name for July */ -#define CAL_SABBREVMONTHNAME8 0x00000029 /* abbreviated name for August */ -#define CAL_SABBREVMONTHNAME9 0x0000002a /* abbreviated name for September */ -#define CAL_SABBREVMONTHNAME10 0x0000002b /* abbreviated name for October */ -#define CAL_SABBREVMONTHNAME11 0x0000002c /* abbreviated name for November */ -#define CAL_SABBREVMONTHNAME12 0x0000002d /* abbreviated name for December */ -#define CAL_SABBREVMONTHNAME13 0x0000002e /* abbreviated name for 13th month (if any) */ -#define CAL_SYEARMONTH 0x0000002f /* year month format string */ - - -#else // __APPLE__ - -#define LOCALE_SDECIMAL 0x0000000E /* decimal separator */ -#define LOCALE_STHOUSAND 0x0000000F /* thousand separator */ -#define LOCALE_ILZERO 0x00000012 /* leading zeros for decimal */ -#define LOCALE_SCURRENCY 0x00000014 /* local monetary symbol */ -#define LOCALE_SMONDECIMALSEP 0x00000016 /* monetary decimal separator */ -#define LOCALE_SMONTHOUSANDSEP 0x00000017 /* monetary thousand separator */ - -#endif // __APPLE__ - - -#if ENABLE_DOWNLEVEL_FOR_NLS - -PALIMPORT -int -PALAPI -GetLocaleInfoW( - IN LCID Locale, - IN LCTYPE LCType, - OUT LPWSTR lpLCData, - IN int cchData); - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - -PALIMPORT -int -PALAPI -GetLocaleInfoEx( - IN LPCWSTR lpLocaleName, - IN LCTYPE LCType, - OUT LPWSTR lpLCData, - IN int cchData); - - -PALIMPORT -int -PALAPI -CompareStringOrdinal( - IN LPCWSTR lpString1, - IN int cchCount1, - IN LPCWSTR lpString2, - IN int cchCount2, - IN BOOL bIgnoreCase); - -typedef struct _nlsversioninfoex { - DWORD dwNLSVersionInfoSize; - DWORD dwNLSVersion; - DWORD dwDefinedVersion; - DWORD dwEffectiveId; - GUID guidCustomVersion; - } NLSVERSIONINFOEX, *LPNLSVERSIONINFOEX; - -PALIMPORT -int -PALAPI -FindNLSStringEx( - IN LPCWSTR lpLocaleName, - IN DWORD dwFindNLSStringFlags, - IN LPCWSTR lpStringSource, - IN int cchSource, - IN LPCWSTR lpStringValue, - IN int cchValue, - OUT LPINT pcchFound, - IN LPNLSVERSIONINFOEX lpVersionInformation, - IN LPVOID lpReserved, - IN LPARAM lParam ); - -typedef enum { - COMPARE_STRING = 0x0001, -} NLS_FUNCTION; - -PALIMPORT -BOOL -PALAPI -IsNLSDefinedString( - IN NLS_FUNCTION Function, - IN DWORD dwFlags, - IN LPNLSVERSIONINFOEX lpVersionInfo, - IN LPCWSTR lpString, - IN int cchStr ); - - -PALIMPORT -int -PALAPI -ResolveLocaleName( - IN LPCWSTR lpNameToResolve, - OUT LPWSTR lpLocaleName, - IN int cchLocaleName ); - -PALIMPORT -BOOL -PALAPI -GetThreadPreferredUILanguages( - IN DWORD dwFlags, - OUT PULONG pulNumLanguages, - OUT PWSTR pwszLanguagesBuffer, - IN OUT PULONG pcchLanguagesBuffer); - - -PALIMPORT -int -PALAPI -GetSystemDefaultLocaleName( - OUT LPWSTR lpLocaleName, - IN int cchLocaleName); - -#ifdef UNICODE -#define GetLocaleInfo GetLocaleInfoW -#endif - -#if ENABLE_DOWNLEVEL_FOR_NLS -PALIMPORT -LCID -PALAPI -GetUserDefaultLCID( - void); -#endif - - -PALIMPORT -int -PALAPI -GetUserDefaultLocaleName( - OUT LPWSTR lpLocaleName, - IN int cchLocaleName); - - -#define LCID_INSTALLED 0x00000001 // installed locale ids -#define LCID_SUPPORTED 0x00000002 // supported locale ids -#ifdef __APPLE__ -#define LCID_ALTERNATE_SORTS 0x00000004 // alternate sort locale ids -#endif // __APPLE__ - -#if ENABLE_DOWNLEVEL_FOR_NLS -PALIMPORT -BOOL -PALAPI -IsValidLocale( - IN LCID Locale, - IN DWORD dwFlags); -#endif // ENABLE_DOWNLEVEL_FOR_NLS - - -typedef DWORD CALID; -typedef DWORD CALTYPE; - -#define CAL_ITWODIGITYEARMAX 0x00000030 // two digit year max -#define CAL_RETURN_NUMBER 0x20000000 // return number instead of string - -#define CAL_GREGORIAN 1 // Gregorian (localized) calendar -#define CAL_GREGORIAN_US 2 // Gregorian (U.S.) calendar -#define CAL_JAPAN 3 // Japanese Emperor Era calendar -#define CAL_TAIWAN 4 // Taiwan Era calendar -#define CAL_KOREA 5 // Korean Tangun Era calendar -#define CAL_HIJRI 6 // Hijri (Arabic Lunar) calendar -#define CAL_THAI 7 // Thai calendar -#define CAL_HEBREW 8 // Hebrew (Lunar) calendar -#define CAL_GREGORIAN_ME_FRENCH 9 // Gregorian Middle East French calendar -#define CAL_GREGORIAN_ARABIC 10 // Gregorian Arabic calendar -#define CAL_GREGORIAN_XLIT_ENGLISH 11 // Gregorian Transliterated English calendar -#define CAL_GREGORIAN_XLIT_FRENCH 12 // Gregorian Transliterated French calendar -#define CAL_JULIAN 13 - -#if ENABLE_DOWNLEVEL_FOR_NLS -PALIMPORT -int -PALAPI -GetCalendarInfoW( - IN LCID Locale, - IN CALID Calendar, - IN CALTYPE CalType, - OUT LPWSTR lpCalData, - IN int cchData, - OUT LPDWORD lpValue); - -#ifdef UNICODE -#define GetCalendarInfo GetCalendarInfoW -#endif - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - - -PALIMPORT -int -PALAPI -GetCalendarInfoEx( - IN LPCWSTR lpLocaleName, - IN CALID Calendar, - IN LPCWSTR lpReserved, - IN CALTYPE CalType, - OUT LPWSTR lpCalData, - IN int cchData, - OUT LPDWORD lpValue); - -#if ENABLE_DOWNLEVEL_FOR_NLS -typedef BOOL (CALLBACK* LOCALE_ENUMPROCW)(LPWSTR); - -PALIMPORT -BOOL -PALAPI -EnumSystemLocalesW( - IN LOCALE_ENUMPROCW lpLocaleEnumProc, - IN DWORD dwFlags); -#endif // ENABLE_DOWNLEVEL_FOR_NLS - -#define DATE_SHORTDATE 0x00000001 // use short date picture -#define DATE_LONGDATE 0x00000002 // use long date picture -#define DATE_YEARMONTH 0x00000008 // use year month picture - -typedef BOOL (CALLBACK* DATEFMT_ENUMPROCEXW)(LPWSTR, CALID); - -#if ENABLE_DOWNLEVEL_FOR_NLS - -PALIMPORT -BOOL -PALAPI -EnumDateFormatsExW( - IN DATEFMT_ENUMPROCEXW lpDateFmtEnumProcEx, - IN LCID Locale, - IN DWORD dwFlags); - -#else // ENABLE_DOWNLEVEL_FOR_NLS - -typedef BOOL (CALLBACK* DATEFMT_ENUMPROCEXEXW)(LPWSTR, CALID, LPARAM); - -PALIMPORT -BOOL -PALAPI -EnumDateFormatsExEx( - IN DATEFMT_ENUMPROCEXEXW lpDateFmtEnumProcEx, - IN LPCWSTR lpLocaleName, - IN DWORD dwFlags, - IN LPARAM lParam); - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - -typedef BOOL (CALLBACK* TIMEFMT_ENUMPROCW)(LPWSTR); - -#if ENABLE_DOWNLEVEL_FOR_NLS - -PALIMPORT -BOOL -PALAPI -EnumTimeFormatsW( - IN TIMEFMT_ENUMPROCW lpTimeFmtEnumProc, - IN LCID Locale, - IN DWORD dwFlags); - -#else // ENABLE_DOWNLEVEL_FOR_NLS - -typedef BOOL (CALLBACK* TIMEFMT_ENUMPROCEXW)(LPWSTR, LPARAM); - -PALIMPORT -BOOL -PALAPI -EnumTimeFormatsEx( - IN TIMEFMT_ENUMPROCEXW lpTimeFmtEnumProc, - IN LPCWSTR lpLocaleName, - IN DWORD dwFlags, - IN LPARAM lParam); - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - -#define ENUM_ALL_CALENDARS 0xffffffff // enumerate all calendars -#define CAL_ICALINTVALUE 0x00000001 // calendar type -#define CAL_NOUSEROVERRIDE LOCALE_NOUSEROVERRIDE // do not use user overrides -#define CAL_SCALNAME 0x00000002 // native name of calendar - -typedef BOOL (CALLBACK* CALINFO_ENUMPROCEXW)(LPWSTR,CALID); - -#if ENABLE_DOWNLEVEL_FOR_NLS - -PALIMPORT -BOOL -PALAPI -EnumCalendarInfoExW( - IN CALINFO_ENUMPROCEXW lpCalInfoEnumProc, - IN LCID Locale, - IN CALID Calendar, - IN CALTYPE CalType); - -#else // ENABLE_DOWNLEVEL_FOR_NLS - -typedef BOOL (CALLBACK* CALINFO_ENUMPROCEXEXW)(LPWSTR, CALID, LPWSTR, LPARAM); - -PALIMPORT -BOOL -PALAPI -EnumCalendarInfoExEx( - IN CALINFO_ENUMPROCEXEXW lpCalInfoEnumProc, - IN LPCWSTR lpLocaleName, - IN CALID Calendar, - IN LPCWSTR lpReserved, - IN CALTYPE CalType, - IN LPARAM lParam); - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - -#define LCMAP_LOWERCASE 0x00000100 -#define LCMAP_UPPERCASE 0x00000200 - -#if ENABLE_DOWNLEVEL_FOR_NLS - -PALIMPORT -int -PALAPI -LCMapStringW( - IN LCID Locale, - IN DWORD dwMapFlags, - IN LPCWSTR lpSrcStr, - IN int cchSrc, - OUT LPWSTR lpDestStr, - IN int cchDest); - -#ifdef UNICODE -#define LCMapString LCMapStringW -#endif - - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - - -PALIMPORT -int -PALAPI -LCMapStringEx( - IN LPCWSTR lpLocaleName, - IN DWORD dwMapFlags, - IN LPCWSTR lpSrcStr, - IN int cchSrc, - OUT LPWSTR lpDestStr, - IN int cchDest, - IN LPNLSVERSIONINFO lpVersionInformation, - IN LPVOID lpReserved, - IN LPARAM lParam ); - -PALIMPORT -int -PALAPI -PAL_LCMapCharW( - IN LPCWSTR lpLocaleName, - IN DWORD dwMapFlags, - IN WCHAR srcChar, - OUT WCHAR *destChar, - LPNLSVERSIONINFO lpVersionInformation, - LPVOID lpReserved, - LPARAM lParam ); - -PALIMPORT -int -PALAPI -PAL_NormalizeStringExW( - IN LPCWSTR lpLocaleName, - IN DWORD dwMapFlags, - IN LPCWSTR lpSrcStr, - IN int cchSrc, - OUT LPWSTR lpDestStr, - IN int cchDest); - -PALIMPORT -int -PALAPI -PAL_ParseDateW( - IN LPCWSTR lpLocaleName, - IN LPCWSTR lpFormat, - IN LPCWSTR lpString, - OUT LPSYSTEMTIME lpTime); - -PALIMPORT -int -PALAPI -PAL_GetCalendar( - IN LPCWSTR lpLocaleName, - OUT CALID* pCalendar); - -#define GEOID_NOT_AVAILABLE -1 - -#define DATE_USE_ALT_CALENDAR 0x00000004 - -#if ENABLE_DOWNLEVEL_FOR_NLS - -PALIMPORT -int -PALAPI -GetDateFormatW( - IN LCID Locale, - IN DWORD dwFlags, - IN CONST SYSTEMTIME *lpDate, - IN LPCWSTR lpFormat, - OUT LPWSTR lpDateStr, - IN int cchDate); - -#else - -PALIMPORT -int -PALAPI -GetDateFormatEx( - IN LPCWSTR Locale, - IN DWORD dwFlags, - IN CONST SYSTEMTIME *lpDate, - IN LPCWSTR lpFormat, - OUT LPWSTR lpDateStr, - IN int cchDate, - IN LPCWSTR lpCalendar); - - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - -PALIMPORT -int -PALAPI -GetDateFormatEx( - IN LPCWSTR lpLocaleName, - IN DWORD dwFlags, - IN CONST SYSTEMTIME *lpDate, - IN LPCWSTR lpFormat, - OUT LPWSTR lpDateStr, - IN int cchDate, - LPCWSTR lpCalendar); - - -#ifdef UNICODE -#define GetDateFormat GetDateFormatW -#endif - - PALIMPORT int PALAPI diff --git a/src/pal/inc/palprivate.h b/src/pal/inc/palprivate.h index ce1a9a99a1..b9c9d08a2f 100644 --- a/src/pal/inc/palprivate.h +++ b/src/pal/inc/palprivate.h @@ -239,22 +239,6 @@ GetModuleFileNameA( OUT LPSTR lpFileName, IN DWORD nSize); -#if ENABLE_DOWNLEVEL_FOR_NLS - - -PALIMPORT -int -PALAPI -CompareStringA( - IN LCID Locale, - IN DWORD dwCmpFlags, - IN LPCSTR lpString1, - IN int cchCount1, - IN LPCSTR lpString2, - IN int cchCount2); - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - PALIMPORT LPSTR diff --git a/src/pal/inc/rt/oleauto.h b/src/pal/inc/rt/oleauto.h index a8499f96d5..958476f482 100644 --- a/src/pal/inc/rt/oleauto.h +++ b/src/pal/inc/rt/oleauto.h @@ -84,14 +84,6 @@ typedef struct { #define VARCMP_GT 2 #define VARCMP_NULL 3 -#ifdef ENABLE_DOWNLEVEL_FOR_NLS -STDAPI VarParseNumFromStr(OLECHAR * strIn, LCID lcid, ULONG dwFlags, - NUMPARSE * pnumprs, BYTE * rgbDig); - -STDAPI VarNumFromParseNum(NUMPARSE * pnumprs, BYTE * rgbDig, - ULONG dwVtBits, VARIANT * pvar); -#endif - STDAPI VariantChangeType(VARIANTARG * pvargDest, VARIANTARG * pvarSrc, USHORT wFlags, VARTYPE vt); @@ -108,21 +100,6 @@ STDAPI VarCyFix(CY cyIn, LPCY pcyResult); STDAPI VarR8FromCy(CY cyIn, DOUBLE * pdblOut); STDAPI VarR4FromCy(CY cyIn, FLOAT * pfltOut); -#ifdef ENABLE_DOWNLEVEL_FOR_NLS -STDAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR * pbstrOut); -STDAPI VarBstrFromUI1(BYTE bVal, LCID lcid, ULONG dwFlags, BSTR * pbstrOut); -STDAPI VarBstrFromI2(SHORT iVal, LCID lcid, ULONG dwFlags, BSTR * pbstrOut); -STDAPI VarBstrFromI4(LONG lIn, LCID lcid, ULONG dwFlags, BSTR * pbstrOut); -STDAPI VarBstrFromI8(LONG64 i64In, LCID lcid, ULONG dwFlags, BSTR FAR* pbstrOut); -STDAPI VarBstrFromR4(FLOAT fltIn, LCID lcid, ULONG dwFlags, BSTR * pbstrOut); -STDAPI VarBstrFromR8(DOUBLE dblIn, LCID lcid, ULONG dwFlags, BSTR * pbstrOut); -STDAPI VarBstrFromI1(CHAR cIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut); -STDAPI VarBstrFromUI2(USHORT uiIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut); -STDAPI VarBstrFromUI4(ULONG ulIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut); -STDAPI VarBstrFromUI8(ULONG64 ui64In, LCID lcid, ULONG dwFlags, BSTR FAR* pbstrOut); -STDAPI VarBstrFromDec(DECIMAL *pdecIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut); -#endif - STDAPI VarDecFromR4(FLOAT fltIn, DECIMAL *pdecOut); STDAPI VarDecFromR8(DOUBLE dblIn, DECIMAL *pdecOut); STDAPI VarDecFromCy(CY cyIn, DECIMAL *pdecOut); @@ -147,10 +124,6 @@ STDAPI VarUI4FromDec(DECIMAL *pdecIn, ULONG *pUI4In); STDAPI VarR8FromDec(DECIMAL *pdecIn, DOUBLE *pdblOut); STDAPI VarR4FromDec(DECIMAL *pdecIn, FLOAT *pfltOut); -#ifdef ENABLE_DOWNLEVEL_FOR_NLS -STDAPI VarR8FromStr(OLECHAR *strin, LCID lcid, ULONG dwFlags, DOUBLE *pdblOut); -#endif - STDAPI VarI1FromR8(DOUBLE dblIn, CHAR *pcOut); STDAPI VarI2FromR8(DOUBLE dblIn, SHORT * psOut); STDAPI VarI4FromR8(DOUBLE dblIn, LONG * plOut); diff --git a/src/pal/src/include/pal/locale.h b/src/pal/src/include/pal/locale.h index f59ce2e174..52362e5166 100644 --- a/src/pal/src/include/pal/locale.h +++ b/src/pal/src/include/pal/locale.h @@ -43,10 +43,6 @@ extern "C" #endif // HAVE_COREFOUNDATION #if HAVE_COREFOUNDATION -#if !ENABLE_DOWNLEVEL_FOR_NLS -BOOL LocaleInitialize( void ); -void LocaleCleanup( void ); -#endif // !ENABLE_DOWNLEVEL_FOR_NLS typedef struct _CP_MAPPING diff --git a/src/pal/src/locale/unicode.cpp b/src/pal/src/locale/unicode.cpp index c9c1ae1c4d..05e916efcf 100644 --- a/src/pal/src/locale/unicode.cpp +++ b/src/pal/src/locale/unicode.cpp @@ -353,116 +353,6 @@ IsValidCodePage( return retval; } -#if ENABLE_DOWNLEVEL_FOR_NLS -/*++ -Function: -GetStringTypeEx - -See MSDN doc. ---*/ -BOOL -PALAPI -GetStringTypeExW( - IN LCID Locale, - IN DWORD dwInfoType, - IN LPCWSTR lpSrcStr, - IN int cchSrc, - OUT LPWORD lpCharType) -{ - - - int i = 0; -#if !HAVE_COREFOUNDATION - UnicodeDataRec unicodeDataRec; -#endif /* !HAVE_COREFOUNDATION */ - BOOL bRet = TRUE; - wchar_t wcstr ; - PERF_ENTRY(GetStringTypeExW); - ENTRY("GetStringTypeExW(Locale=%#x, dwInfoType=%#x, lpSrcStr=%p (%S), " - "cchSrc=%d, lpCharType=%p)\n", - Locale, dwInfoType, lpSrcStr?lpSrcStr:W16_NULLSTRING, lpSrcStr?lpSrcStr:W16_NULLSTRING, cchSrc, lpCharType); - - if((Locale != LOCALE_USER_DEFAULT)||(dwInfoType != CT_CTYPE1) - || (cchSrc != 1) || (lpSrcStr == (LPCWSTR)lpCharType)) - { - ASSERT("One of the input parameters is invalid\n"); - SetLastError(ERROR_INVALID_PARAMETER); - bRet = FALSE; - goto GetStringTypeExExit; - } - - - /* - * get length if needed... - */ - if(cchSrc == -1) - { - cchSrc = PAL_wcslen(lpSrcStr); - } - - /* - * Loop through each character of the source string and update - * lpCharType accordingly. - */ - for(i = 0; i < cchSrc; i++) - { - wcstr = lpSrcStr[i]; -#if HAVE_COREFOUNDATION - lpCharType[i] = 0; - if (PAL_iswlower(wcstr)) - { - lpCharType[i] |= C1_LOWER; - } - if (PAL_iswupper(wcstr)) - { - lpCharType[i] |= C1_UPPER; - } - if (PAL_iswalpha(wcstr)) - { - lpCharType[i] |= C1_ALPHA; - } - if (PAL_iswdigit(wcstr)) - { - lpCharType[i] |= C1_DIGIT; - } - if (PAL_iswspace(wcstr)) - { - lpCharType[i] |= C1_SPACE; - } - if (PAL_iswblank(wcstr)) - { - lpCharType[i] |= C1_BLANK; - } - if (PAL_iswcntrl(wcstr)) - { - lpCharType[i] |= C1_CNTRL; - } - if (PAL_iswpunct(wcstr)) - { - lpCharType[i] |= C1_PUNCT; - } -#else /* HAVE_COREFOUNDATION */ - /* - * Get the unicode data record for that character. - */ - if(GetUnicodeData(wcstr, &unicodeDataRec)) - { - lpCharType[i] = unicodeDataRec.C1_TYPE_FLAGS; - } - else - { - lpCharType[i] = 0; - } -#endif /* HAVE_COREFOUNDATION */ - } - - GetStringTypeExExit: - LOGEXIT("GetStringTypeEx returns BOOL %d\n", bRet); - PERF_EXIT(GetStringTypeExW); - return bRet; -} -#endif // ENABLE_DOWNLEVEL_FOR_NLS - /*++ Function: GetCPInfo diff --git a/src/pal/src/misc/fmtmessage.cpp b/src/pal/src/misc/fmtmessage.cpp index 70b854aa9c..fcf749b51f 100644 --- a/src/pal/src/misc/fmtmessage.cpp +++ b/src/pal/src/misc/fmtmessage.cpp @@ -336,11 +336,7 @@ FormatMessageW( } if ( !( dwFlags & FORMAT_MESSAGE_FROM_STRING ) && - ( dwLanguageId != 0 -#if ENABLE_DOWNLEVEL_FOR_NLS - && dwLanguageId != MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ) -#endif - ) ) + ( dwLanguageId != 0) ) { ERROR( "Invalid language indentifier.\n" ); SetLastError( ERROR_RESOURCE_LANG_NOT_FOUND ); diff --git a/src/pal/tests/palsuite/locale_info/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/CMakeLists.txt index 52482daa41..c9756e97a3 100644 --- a/src/pal/tests/palsuite/locale_info/CMakeLists.txt +++ b/src/pal/tests/palsuite/locale_info/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 2.8.12.2) # add_subdirectory(CompareStringA) # add_subdirectory(CompareStringW) # add_subdirectory(GetLocaleInfoW) -# add_subdirectory(GetStringTypeExW) # add_subdirectory(GetSystemDefaultLangID) # add_subdirectory(GetThreadLocale) # add_subdirectory(GetTimeZoneInformation) diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/CMakeLists.txt deleted file mode 100644 index ef14ea5352..0000000000 --- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/CMakeLists.txt deleted file mode 100644 index 9d6e4e2be8..0000000000 --- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test1.cpp -) - -add_executable(paltest_getstringtypeexw_test1 - ${SOURCES} -) - -add_dependencies(paltest_getstringtypeexw_test1 coreclrpal) - -target_link_libraries(paltest_getstringtypeexw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/test1.cpp b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/test1.cpp deleted file mode 100644 index e15c3d66cd..0000000000 --- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/test1.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: Tests GetStringTypeExW with values that will ensure all possible -** flags get set once. -** -** -**==========================================================================*/ - -#include <palsuite.h> - - -int __cdecl main(int argc, char *argv[]) -{ - WCHAR wideStr[] = {'9',' '}; - WORD values1[] = { C1_DIGIT, C1_SPACE }; - int len = 2; - WORD Info[256]; - BOOL ret; - int i; - - if (PAL_Initialize(argc, argv)) - { - return FAIL; - } - - for (i=0; i<len; i++) - { - ret = GetStringTypeExW(LOCALE_USER_DEFAULT, CT_CTYPE1, &wideStr[i], 1, &Info[i]); - if (!ret) - { - Fail("GetStringTypeExW failed!\n"); - } - - if ((Info[i] & values1[i])!= values1[i]) - { - - Fail("GetStringTypeExW returned wrong type info for %c (%d)\n" - "Expected %#x, got %#x\n", wideStr[i], wideStr[i], - values1[i], Info[i]); - - } - } - - PAL_Terminate(); - - return PASS; -} - diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/testinfo.dat b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/testinfo.dat deleted file mode 100644 index b0fbea4c05..0000000000 --- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Locale Information -Function = GetStringTypeExW -Name = Test #1 for GetStringTypeExW -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests GetStringTypeExW with values that will ensure all possible -=flags get set once. diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/CMakeLists.txt deleted file mode 100644 index 7f90601ef9..0000000000 --- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test2.cpp -) - -add_executable(paltest_getstringtypeexw_test2 - ${SOURCES} -) - -add_dependencies(paltest_getstringtypeexw_test2 coreclrpal) - -target_link_libraries(paltest_getstringtypeexw_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/test2.cpp b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/test2.cpp deleted file mode 100644 index 6dca7e8ac5..0000000000 --- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/test2.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================================ -** -** Source: test2.c -** -** Purpose: Tests GetStringTypeExW with values from every possible unicode -** category. -** -** -**==========================================================================*/ - -#include <palsuite.h> - - -/* - * A random selection of unicode characters, each representing a distinct - * unicode category - */ -WCHAR TestStr[] = -{ - 0x05D0, /* 4, HEBREW LETTER ALEF */ - 0x0488, /* 7, COMBINING CYRILLIC HUNDRED THOUSANDS SIGN */ - 0x0030, /* 8, DIGIT ZERO */ - 0x0020, /* 22, SPACE */ -}; - -#define TEST_LEN (sizeof(TestStr) / sizeof(WCHAR)) - -WORD TestFlags[TEST_LEN] = -{ - C1_ALPHA, - 0, - C1_DIGIT, - C1_BLANK|C1_SPACE -}; - -int __cdecl main(int argc, char *argv[]) -{ - WORD Info; - BOOL ret; - int i; - - /* check only the bits listed in rotor_pal.doc */ - const WORD PAL_VALID_C1_BITS = C1_DIGIT | C1_SPACE; - - if (PAL_Initialize(argc, argv)) - { - return FAIL; - } - - for (i=0; i <TEST_LEN; i++) - { - ret = GetStringTypeExW(LOCALE_USER_DEFAULT, CT_CTYPE1, &TestStr[i], 1, &Info); - - if (!ret) - { - Fail("GetStringTypeExW failed!\n"); - } - - if ((Info & PAL_VALID_C1_BITS) != (TestFlags[i] & PAL_VALID_C1_BITS)) - { - - Fail("GetStringTypeExW (test #%i) returned wrong type info for %c (%d)\n" - "Expected %#x, got %#x\n", i, TestStr[i], TestStr[i], - TestFlags[i], Info); - - } - } - - PAL_Terminate(); - - return PASS; -} - - diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/testinfo.dat b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/testinfo.dat deleted file mode 100644 index 361d29b450..0000000000 --- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Locale Information -Function = GetStringTypeExW -Name = Test #2 for GetStringTypeExW -TYPE = DEFAULT -EXE1 = test2 -Description -=Tests GetStringTypeExW with values from every possible unicode category. diff --git a/src/utilcode/CMakeLists.txt b/src/utilcode/CMakeLists.txt index 79088c1536..9629e5140f 100644 --- a/src/utilcode/CMakeLists.txt +++ b/src/utilcode/CMakeLists.txt @@ -66,9 +66,7 @@ if(WIN32) appxutil.cpp dacutil.cpp dlwrap.cpp - downlevel.cpp loadrc.cpp - newapis.cpp securitywrapper.cpp securityutil.cpp stacktrace.cpp diff --git a/src/utilcode/ccomprc.cpp b/src/utilcode/ccomprc.cpp index bc649e7b6e..205c3ff331 100644 --- a/src/utilcode/ccomprc.cpp +++ b/src/utilcode/ccomprc.cpp @@ -5,7 +5,6 @@ #include "stdafx.h" // Standard header. #include <utilcode.h> // Utility helpers. #include <corerror.h> -#include "newapis.h" #include "ndpversion.h" #include "../dlls/mscorrc/resource.h" @@ -83,7 +82,7 @@ int GetMUILanguageID(LocaleIDValue* pResult) *pResult= langId; #else // FEATURE_USE_LCID _ASSERTE(sizeof(LocaleID)/sizeof(WCHAR) >=LOCALE_NAME_MAX_LENGTH); - return NewApis::GetSystemDefaultLocaleName(*pResult, LOCALE_NAME_MAX_LENGTH); + return ::GetSystemDefaultLocaleName(*pResult, LOCALE_NAME_MAX_LENGTH); #endif //FEATURE_USE_LCID return 1; } @@ -118,7 +117,7 @@ void GetMUILanguageName(__out SString* pResult) #ifdef FEATURE_USE_LCID lcid=langid; #else - lcid=NewApis::LocaleNameToLCID(langid,0); + lcid=::LocaleNameToLCID(langid,0); #endif return BuildMUIDirectory(lcid, pResult); diff --git a/src/utilcode/downlevel.cpp b/src/utilcode/downlevel.cpp deleted file mode 100644 index 6ff7b82815..0000000000 --- a/src/utilcode/downlevel.cpp +++ /dev/null @@ -1,2736 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -//////////////////////////////////////////////////////////////////////////// -// -// File: downlevel.cpp -// - - -// -// Purpose: functions that need to be emulated on downlevel platforms. -// -//////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" - -#if defined(ENABLE_DOWNLEVEL_FOR_NLS) - -#ifndef LOCALE_SNAME -#define LOCALE_SNAME 0x0000005c -#endif -#include "downlevel.h" -#include "newapis.h" -#include "utilcode.h" -#include "sstring.h" -#include "ex.h" - -#define LCID_AZ_CYRL_AZ 0x0082c - -// -// Macro to check if more than one bit is set. -// Returns 1 if more than one bit set, 0 otherwise. -// -#define MORE_THAN_ONE(f, bits) (((f & bits) - 1) & (f & bits)) - -struct LCIDEntry -{ - LCID lcid; - LPCWSTR wszName; -}; - -// Known (ie: <= Vista) Name/LCID lookup table, sorted by LCID -const static LCIDEntry s_lcids[]= -{ - // Neutrals - { 0x00001, W("ar") }, // Neutral Locale - { 0x00002, W("bg") }, // Neutral Locale - { 0x00003, W("ca") }, // Neutral Locale - { 0x00004, W("zh-Hans") }, // Neutral Locale - { 0x00005, W("cs") }, // Neutral Locale - { 0x00006, W("da") }, // Neutral Locale - { 0x00007, W("de") }, // Neutral Locale - { 0x00008, W("el") }, // Neutral Locale - { 0x00009, W("en") }, // Neutral Locale - { 0x0000a, W("es") }, // Neutral Locale - { 0x0000b, W("fi") }, // Neutral Locale - { 0x0000c, W("fr") }, // Neutral Locale - { 0x0000d, W("he") }, // Neutral Locale - { 0x0000e, W("hu") }, // Neutral Locale - { 0x0000f, W("is") }, // Neutral Locale - { 0x00010, W("it") }, // Neutral Locale - { 0x00011, W("ja") }, // Neutral Locale - { 0x00012, W("ko") }, // Neutral Locale - { 0x00013, W("nl") }, // Neutral Locale - { 0x00014, W("no") }, // Neutral Locale - { 0x00015, W("pl") }, // Neutral Locale - { 0x00016, W("pt") }, // Neutral Locale - { 0x00017, W("rm") }, // Neutral Locale - { 0x00018, W("ro") }, // Neutral Locale - { 0x00019, W("ru") }, // Neutral Locale - { 0x0001a, W("hr") }, // Neutral Locale - { 0x0001b, W("sk") }, // Neutral Locale - { 0x0001c, W("sq") }, // Neutral Locale - { 0x0001d, W("sv") }, // Neutral Locale - { 0x0001e, W("th") }, // Neutral Locale - { 0x0001f, W("tr") }, // Neutral Locale - { 0x00020, W("ur") }, // Neutral Locale - { 0x00021, W("id") }, // Neutral Locale - { 0x00022, W("uk") }, // Neutral Locale - { 0x00023, W("be") }, // Neutral Locale - { 0x00024, W("sl") }, // Neutral Locale - { 0x00025, W("et") }, // Neutral Locale - { 0x00026, W("lv") }, // Neutral Locale - { 0x00027, W("lt") }, // Neutral Locale - { 0x00028, W("tg") }, // Neutral Locale - { 0x00029, W("fa") }, // Neutral Locale - { 0x0002a, W("vi") }, // Neutral Locale - { 0x0002b, W("hy") }, // Neutral Locale - { 0x0002c, W("az") }, // Neutral Locale - { 0x0002d, W("eu") }, // Neutral Locale - { 0x0002e, W("hsb") }, // Neutral Locale - { 0x0002f, W("mk") }, // Neutral Locale - { 0x00032, W("tn") }, // Neutral Locale - { 0x00034, W("xh") }, // Neutral Locale - { 0x00035, W("zu") }, // Neutral Locale - { 0x00036, W("af") }, // Neutral Locale - { 0x00037, W("ka") }, // Neutral Locale - { 0x00038, W("fo") }, // Neutral Locale - { 0x00039, W("hi") }, // Neutral Locale - { 0x0003a, W("mt") }, // Neutral Locale - { 0x0003b, W("se") }, // Neutral Locale - { 0x0003c, W("ga") }, // Neutral Locale - { 0x0003e, W("ms") }, // Neutral Locale - { 0x0003f, W("kk") }, // Neutral Locale - { 0x00040, W("ky") }, // Neutral Locale - { 0x00041, W("sw") }, // Neutral Locale - { 0x00042, W("tk") }, // Neutral Locale - { 0x00043, W("uz") }, // Neutral Locale - { 0x00044, W("tt") }, // Neutral Locale - { 0x00045, W("bn") }, // Neutral Locale - { 0x00046, W("pa") }, // Neutral Locale - { 0x00047, W("gu") }, // Neutral Locale - { 0x00048, W("or") }, // Neutral Locale - { 0x00049, W("ta") }, // Neutral Locale - { 0x0004a, W("te") }, // Neutral Locale - { 0x0004b, W("kn") }, // Neutral Locale - { 0x0004c, W("ml") }, // Neutral Locale - { 0x0004d, W("as") }, // Neutral Locale - { 0x0004e, W("mr") }, // Neutral Locale - { 0x0004f, W("sa") }, // Neutral Locale - { 0x00050, W("mn") }, // Neutral Locale - { 0x00051, W("bo") }, // Neutral Locale - { 0x00052, W("cy") }, // Neutral Locale - { 0x00053, W("km") }, // Neutral Locale - { 0x00054, W("lo") }, // Neutral Locale - { 0x00056, W("gl") }, // Neutral Locale - { 0x00057, W("kok") }, // Neutral Locale - { 0x0005a, W("syr") }, // Neutral Locale - { 0x0005b, W("si") }, // Neutral Locale - { 0x0005d, W("iu") }, // Neutral Locale - { 0x0005e, W("am") }, // Neutral Locale - { 0x0005f, W("tzm") }, // Neutral Locale - { 0x00061, W("ne") }, // Neutral Locale - { 0x00062, W("fy") }, // Neutral Locale - { 0x00063, W("ps") }, // Neutral Locale - { 0x00064, W("fil") }, // Neutral Locale - { 0x00065, W("dv") }, // Neutral Locale - { 0x00068, W("ha") }, // Neutral Locale - { 0x0006a, W("yo") }, // Neutral Locale - { 0x0006b, W("quz") }, // Neutral Locale - { 0x0006c, W("nso") }, // Neutral Locale - { 0x0006d, W("ba") }, // Neutral Locale - { 0x0006e, W("lb") }, // Neutral Locale - { 0x0006f, W("kl") }, // Neutral Locale - { 0x00070, W("ig") }, // Neutral Locale - { 0x00078, W("ii") }, // Neutral Locale - { 0x0007a, W("arn") }, // Neutral Locale - { 0x0007c, W("moh") }, // Neutral Locale - { 0x0007e, W("br") }, // Neutral Locale - { 0x00080, W("ug") }, // Neutral Locale - { 0x00081, W("mi") }, // Neutral Locale - { 0x00082, W("oc") }, // Neutral Locale - { 0x00083, W("co") }, // Neutral Locale - { 0x00084, W("gsw") }, // Neutral Locale - { 0x00085, W("sah") }, // Neutral Locale - { 0x00086, W("qut") }, // Neutral Locale - { 0x00087, W("rw") }, // Neutral Locale - { 0x00088, W("wo") }, // Neutral Locale - { 0x0008c, W("prs") }, // Neutral Locale - - // Specific Cultures - { 0x00401, W("ar-SA") }, - { 0x00402, W("bg-BG") }, - { 0x00403, W("ca-ES") }, - { 0x00404, W("zh-TW") }, - { 0x00405, W("cs-CZ") }, - { 0x00406, W("da-DK") }, - { 0x00407, W("de-DE") }, - { 0x00408, W("el-GR") }, - { 0x00409, W("en-US") }, - // es-ES_tradnl only gets used if specifically asked for because - // GetCultures() won't return it. (It's not a real locale, its an alt sort) - { 0x0040a, W("es-ES_tradnl") }, - { 0x0040b, W("fi-FI") }, - { 0x0040c, W("fr-FR") }, - { 0x0040d, W("he-IL") }, - { 0x0040e, W("hu-HU") }, - { 0x0040f, W("is-IS") }, - { 0x00410, W("it-IT") }, - { 0x00411, W("ja-JP") }, - { 0x00412, W("ko-KR") }, - { 0x00413, W("nl-NL") }, - { 0x00414, W("nb-NO") }, - { 0x00415, W("pl-PL") }, - { 0x00416, W("pt-BR") }, - { 0x00417, W("rm-CH") }, - { 0x00418, W("ro-RO") }, - { 0x00419, W("ru-RU") }, - { 0x0041a, W("hr-HR") }, - { 0x0041b, W("sk-SK") }, - { 0x0041c, W("sq-AL") }, - { 0x0041d, W("sv-SE") }, - { 0x0041e, W("th-TH") }, - { 0x0041f, W("tr-TR") }, - { 0x00420, W("ur-PK") }, - { 0x00421, W("id-ID") }, - { 0x00422, W("uk-UA") }, - { 0x00423, W("be-BY") }, - { 0x00424, W("sl-SI") }, - { 0x00425, W("et-EE") }, - { 0x00426, W("lv-LV") }, - { 0x00427, W("lt-LT") }, - { 0x00428, W("tg-Cyrl-TJ") }, - { 0x00429, W("fa-IR") }, - { 0x0042a, W("vi-VN") }, - { 0x0042b, W("hy-AM") }, - { 0x0042c, W("az-Latn-AZ") }, - { 0x0042d, W("eu-ES") }, - { 0x0042e, W("hsb-DE") }, - { 0x0042f, W("mk-MK") }, - { 0x00432, W("tn-ZA") }, - { 0x00434, W("xh-ZA") }, - { 0x00435, W("zu-ZA") }, - { 0x00436, W("af-ZA") }, - { 0x00437, W("ka-GE") }, - { 0x00438, W("fo-FO") }, - { 0x00439, W("hi-IN") }, - { 0x0043a, W("mt-MT") }, - { 0x0043b, W("se-NO") }, - { 0x0043e, W("ms-MY") }, - { 0x0043f, W("kk-KZ") }, - { 0x00440, W("ky-KG") }, - { 0x00441, W("sw-KE") }, - { 0x00442, W("tk-TM") }, - { 0x00443, W("uz-Latn-UZ") }, - { 0x00444, W("tt-RU") }, - { 0x00445, W("bn-IN") }, - { 0x00446, W("pa-IN") }, - { 0x00447, W("gu-IN") }, - { 0x00448, W("or-IN") }, - { 0x00449, W("ta-IN") }, - { 0x0044a, W("te-IN") }, - { 0x0044b, W("kn-IN") }, - { 0x0044c, W("ml-IN") }, - { 0x0044d, W("as-IN") }, - { 0x0044e, W("mr-IN") }, - { 0x0044f, W("sa-IN") }, - { 0x00450, W("mn-MN") }, - { 0x00451, W("bo-CN") }, - { 0x00452, W("cy-GB") }, - { 0x00453, W("km-KH") }, - { 0x00454, W("lo-LA") }, - { 0x00456, W("gl-ES") }, - { 0x00457, W("kok-IN") }, - { 0x0045a, W("syr-SY") }, - { 0x0045b, W("si-LK") }, - { 0x0045d, W("iu-Cans-CA") }, - { 0x0045e, W("am-ET") }, - { 0x00461, W("ne-NP") }, - { 0x00462, W("fy-NL") }, - { 0x00463, W("ps-AF") }, - { 0x00464, W("fil-PH") }, - { 0x00465, W("dv-MV") }, - { 0x00468, W("ha-Latn-NG") }, - { 0x0046a, W("yo-NG") }, - { 0x0046b, W("quz-BO") }, - { 0x0046c, W("nso-ZA") }, - { 0x0046d, W("ba-RU") }, - { 0x0046e, W("lb-LU") }, - { 0x0046f, W("kl-GL") }, - { 0x00470, W("ig-NG") }, - { 0x00478, W("ii-CN") }, - { 0x0047a, W("arn-CL") }, - { 0x0047c, W("moh-CA") }, - { 0x0047e, W("br-FR") }, - { 0x00480, W("ug-CN") }, - { 0x00481, W("mi-NZ") }, - { 0x00482, W("oc-FR") }, - { 0x00483, W("co-FR") }, - { 0x00484, W("gsw-FR") }, - { 0x00485, W("sah-RU") }, - { 0x00486, W("qut-GT") }, - { 0x00487, W("rw-RW") }, - { 0x00488, W("wo-SN") }, - { 0x0048c, W("prs-AF") }, - { 0x00501, W("qps-ploc") }, - { 0x005fe, W("qps-ploca") }, - { 0x00801, W("ar-IQ") }, - { 0x00804, W("zh-CN") }, - { 0x00807, W("de-CH") }, - { 0x00809, W("en-GB") }, - { 0x0080a, W("es-MX") }, - { 0x0080c, W("fr-BE") }, - { 0x00810, W("it-CH") }, - { 0x00813, W("nl-BE") }, - { 0x00814, W("nn-NO") }, - { 0x00816, W("pt-PT") }, - { 0x0081a, W("sr-Latn-CS") }, - { 0x0081d, W("sv-FI") }, - { 0x0082c, W("az-Cyrl-AZ") }, - { 0x0082e, W("dsb-DE") }, - { 0x0083b, W("se-SE") }, - { 0x0083c, W("ga-IE") }, - { 0x0083e, W("ms-BN") }, - { 0x00843, W("uz-Cyrl-UZ") }, - { 0x00845, W("bn-BD") }, - { 0x00850, W("mn-Mong-CN") }, - { 0x0085d, W("iu-Latn-CA") }, - { 0x0085f, W("tzm-Latn-DZ") }, - { 0x0086b, W("quz-EC") }, - { 0x009ff, W("qps-plocm") }, - { 0x00c01, W("ar-EG") }, - { 0x00c04, W("zh-HK") }, - { 0x00c07, W("de-AT") }, - { 0x00c09, W("en-AU") }, - { 0x00c0a, W("es-ES") }, - { 0x00c0c, W("fr-CA") }, - { 0x00c1a, W("sr-Cyrl-CS") }, - { 0x00c3b, W("se-FI") }, - { 0x00c6b, W("quz-PE") }, - { 0x01001, W("ar-LY") }, - { 0x01004, W("zh-SG") }, - { 0x01007, W("de-LU") }, - { 0x01009, W("en-CA") }, - { 0x0100a, W("es-GT") }, - { 0x0100c, W("fr-CH") }, - { 0x0101a, W("hr-BA") }, - { 0x0103b, W("smj-NO") }, - { 0x01401, W("ar-DZ") }, - { 0x01404, W("zh-MO") }, - { 0x01407, W("de-LI") }, - { 0x01409, W("en-NZ") }, - { 0x0140a, W("es-CR") }, - { 0x0140c, W("fr-LU") }, - { 0x0141a, W("bs-Latn-BA") }, - { 0x0143b, W("smj-SE") }, - { 0x01801, W("ar-MA") }, - { 0x01809, W("en-IE") }, - { 0x0180a, W("es-PA") }, - { 0x0180c, W("fr-MC") }, - { 0x0181a, W("sr-Latn-BA") }, - { 0x0183b, W("sma-NO") }, - { 0x01c01, W("ar-TN") }, - { 0x01c09, W("en-ZA") }, - { 0x01c0a, W("es-DO") }, - { 0x01c1a, W("sr-Cyrl-BA") }, - { 0x01c3b, W("sma-SE") }, - { 0x02001, W("ar-OM") }, - { 0x02009, W("en-JM") }, - { 0x0200a, W("es-VE") }, - { 0x0201a, W("bs-Cyrl-BA") }, - { 0x0203b, W("sms-FI") }, - { 0x02401, W("ar-YE") }, - { 0x02409, W("en-029") }, - { 0x0240a, W("es-CO") }, - { 0x0243b, W("smn-FI") }, - { 0x02801, W("ar-SY") }, - { 0x02809, W("en-BZ") }, - { 0x0280a, W("es-PE") }, - { 0x02c01, W("ar-JO") }, - { 0x02c09, W("en-TT") }, - { 0x02c0a, W("es-AR") }, - { 0x03001, W("ar-LB") }, - { 0x03009, W("en-ZW") }, - { 0x0300a, W("es-EC") }, - { 0x03401, W("ar-KW") }, - { 0x03409, W("en-PH") }, - { 0x0340a, W("es-CL") }, - { 0x03801, W("ar-AE") }, - { 0x0380a, W("es-UY") }, - { 0x03c01, W("ar-BH") }, - { 0x03c0a, W("es-PY") }, - { 0x04001, W("ar-QA") }, - { 0x04009, W("en-IN") }, - { 0x0400a, W("es-BO") }, - { 0x04409, W("en-MY") }, - { 0x0440a, W("es-SV") }, - { 0x04809, W("en-SG") }, - { 0x0480a, W("es-HN") }, - { 0x04c0a, W("es-NI") }, - { 0x0500a, W("es-PR") }, - { 0x0540a, W("es-US") }, - - // Multiple neutrals - { 0x0781a, W("bs") }, // Neutral Locale - { 0x07c04, W("zh-Hant") }, // Neutral Locale - { 0x07c1a, W("sr") }, // Neutral Locale - - // Alt Sorts - { 0x1007f, W("x-IV_mathan") }, - { 0x10407, W("de-DE_phoneb") }, - { 0x1040e, W("hu-HU_technl") }, - { 0x10437, W("ka-GE_modern") }, - { 0x20804, W("zh-CN_stroke") }, - { 0x21004, W("zh-SG_stroke") }, - { 0x21404, W("zh-MO_stroke") }, - { 0x30404, W("zh-TW_pronun") }, - { 0x40411, W("ja-JP_radstr") } - - // TODO: Turkic? (Necessary ?) -}; - -// Known (ie: <= Vista) Name/LCID lookup table, sorted by Name -const static LCIDEntry s_names[]= -{ - { 0x00036, W("af") }, // Neutral Locale - { 0x00436, W("af-ZA") }, - { 0x0005e, W("am") }, // Neutral Locale - { 0x0045e, W("am-ET") }, - { 0x00001, W("ar") }, // Neutral Locale - { 0x03801, W("ar-AE") }, - { 0x03c01, W("ar-BH") }, - { 0x01401, W("ar-DZ") }, - { 0x00c01, W("ar-EG") }, - { 0x00801, W("ar-IQ") }, - { 0x02c01, W("ar-JO") }, - { 0x03401, W("ar-KW") }, - { 0x03001, W("ar-LB") }, - { 0x01001, W("ar-LY") }, - { 0x01801, W("ar-MA") }, - { 0x02001, W("ar-OM") }, - { 0x04001, W("ar-QA") }, - { 0x00401, W("ar-SA") }, - { 0x02801, W("ar-SY") }, - { 0x01c01, W("ar-TN") }, - { 0x02401, W("ar-YE") }, - { 0x0007a, W("arn") }, // Neutral Locale - { 0x0047a, W("arn-CL") }, - { 0x0004d, W("as") }, // Neutral Locale - { 0x0044d, W("as-IN") }, - { 0x0002c, W("az") }, // Neutral Locale - { 0x0082c, W("az-Cyrl-AZ") }, - { 0x0042c, W("az-Latn-AZ") }, - { 0x0006d, W("ba") }, // Neutral Locale - { 0x0046d, W("ba-RU") }, - { 0x00023, W("be") }, // Neutral Locale - { 0x00423, W("be-BY") }, - { 0x00002, W("bg") }, // Neutral Locale - { 0x00402, W("bg-BG") }, - { 0x00045, W("bn") }, // Neutral Locale - { 0x00845, W("bn-BD") }, - { 0x00445, W("bn-IN") }, - { 0x00051, W("bo") }, // Neutral Locale - { 0x00451, W("bo-CN") }, - { 0x0007e, W("br") }, // Neutral Locale - { 0x0047e, W("br-FR") }, - { 0x0781a, W("bs") }, // Neutral Locale - { 0x0201a, W("bs-Cyrl-BA") }, - { 0x0141a, W("bs-Latn-BA") }, - { 0x00003, W("ca") }, // Neutral Locale - { 0x00403, W("ca-ES") }, - { 0x00083, W("co") }, // Neutral Locale - { 0x00483, W("co-FR") }, - { 0x00005, W("cs") }, // Neutral Locale - { 0x00405, W("cs-CZ") }, - { 0x00052, W("cy") }, // Neutral Locale - { 0x00452, W("cy-GB") }, - { 0x00006, W("da") }, // Neutral Locale - { 0x00406, W("da-DK") }, - { 0x00007, W("de") }, // Neutral Locale - { 0x00c07, W("de-AT") }, - { 0x00807, W("de-CH") }, - { 0x00407, W("de-DE") }, - { 0x10407, W("de-DE_phoneb") }, // Alternate Sort - { 0x01407, W("de-LI") }, - { 0x01007, W("de-LU") }, - { 0x0082e, W("dsb-DE") }, - { 0x00065, W("dv") }, // Neutral Locale - { 0x00465, W("dv-MV") }, - { 0x00008, W("el") }, // Neutral Locale - { 0x00408, W("el-GR") }, - { 0x00009, W("en") }, // Neutral Locale - { 0x02409, W("en-029") }, - { 0x00c09, W("en-AU") }, - { 0x02809, W("en-BZ") }, - { 0x01009, W("en-CA") }, - { 0x00809, W("en-GB") }, - { 0x01809, W("en-IE") }, - { 0x04009, W("en-IN") }, - { 0x02009, W("en-JM") }, - { 0x04409, W("en-MY") }, - { 0x01409, W("en-NZ") }, - { 0x03409, W("en-PH") }, - { 0x04809, W("en-SG") }, - { 0x02c09, W("en-TT") }, - { 0x00409, W("en-US") }, - { 0x01c09, W("en-ZA") }, - { 0x03009, W("en-ZW") }, - { 0x0000a, W("es") }, // Neutral Locale - { 0x02c0a, W("es-AR") }, - { 0x0400a, W("es-BO") }, - { 0x0340a, W("es-CL") }, - { 0x0240a, W("es-CO") }, - { 0x0140a, W("es-CR") }, - { 0x01c0a, W("es-DO") }, - { 0x0300a, W("es-EC") }, - { 0x00c0a, W("es-ES") }, - // es-ES_tradnl only gets used if specifically asked for because - // GetCultures() won't return it. (It's not a real locale, its an alt sort) - { 0x0040a, W("es-ES_tradnl") }, - { 0x0100a, W("es-GT") }, - { 0x0480a, W("es-HN") }, - { 0x0080a, W("es-MX") }, - { 0x04c0a, W("es-NI") }, - { 0x0180a, W("es-PA") }, - { 0x0280a, W("es-PE") }, - { 0x0500a, W("es-PR") }, - { 0x03c0a, W("es-PY") }, - { 0x0440a, W("es-SV") }, - { 0x0540a, W("es-US") }, - { 0x0380a, W("es-UY") }, - { 0x0200a, W("es-VE") }, - { 0x00025, W("et") }, // Neutral Locale - { 0x00425, W("et-EE") }, - { 0x0002d, W("eu") }, // Neutral Locale - { 0x0042d, W("eu-ES") }, - { 0x00029, W("fa") }, // Neutral Locale - { 0x00429, W("fa-IR") }, - { 0x0000b, W("fi") }, // Neutral Locale - { 0x0040b, W("fi-FI") }, - { 0x00064, W("fil") }, // Neutral Locale - { 0x00464, W("fil-PH") }, - { 0x00038, W("fo") }, // Neutral Locale - { 0x00438, W("fo-FO") }, - { 0x0000c, W("fr") }, // Neutral Locale - { 0x0080c, W("fr-BE") }, - { 0x00c0c, W("fr-CA") }, - { 0x0100c, W("fr-CH") }, - { 0x0040c, W("fr-FR") }, - { 0x0140c, W("fr-LU") }, - { 0x0180c, W("fr-MC") }, - { 0x00062, W("fy") }, // Neutral Locale - { 0x00462, W("fy-NL") }, - { 0x0003c, W("ga") }, // Neutral Locale - { 0x0083c, W("ga-IE") }, - { 0x00056, W("gl") }, // Neutral Locale - { 0x00456, W("gl-ES") }, - { 0x00084, W("gsw") }, // Neutral Locale - { 0x00484, W("gsw-FR") }, - { 0x00047, W("gu") }, // Neutral Locale - { 0x00447, W("gu-IN") }, - { 0x00068, W("ha") }, // Neutral Locale - { 0x00468, W("ha-Latn-NG") }, - { 0x0000d, W("he") }, // Neutral Locale - { 0x0040d, W("he-IL") }, - { 0x00039, W("hi") }, // Neutral Locale - { 0x00439, W("hi-IN") }, - { 0x0001a, W("hr") }, // Neutral Locale - { 0x0101a, W("hr-BA") }, - { 0x0041a, W("hr-HR") }, - { 0x0002e, W("hsb") }, // Neutral Locale - { 0x0042e, W("hsb-DE") }, - { 0x0000e, W("hu") }, // Neutral Locale - { 0x0040e, W("hu-HU") }, - { 0x1040e, W("hu-HU_technl") }, // Alternate Sort - { 0x0002b, W("hy") }, // Neutral Locale - { 0x0042b, W("hy-AM") }, - { 0x00021, W("id") }, // Neutral Locale - { 0x00421, W("id-ID") }, - { 0x00070, W("ig") }, // Neutral Locale - { 0x00470, W("ig-NG") }, - { 0x00078, W("ii") }, // Neutral Locale - { 0x00478, W("ii-CN") }, - { 0x0000f, W("is") }, // Neutral Locale - { 0x0040f, W("is-IS") }, - { 0x00010, W("it") }, // Neutral Locale - { 0x00810, W("it-CH") }, - { 0x00410, W("it-IT") }, - { 0x0005d, W("iu") }, // Neutral Locale - { 0x0045d, W("iu-Cans-CA") }, - { 0x0085d, W("iu-Latn-CA") }, - { 0x00011, W("ja") }, // Neutral Locale - { 0x00411, W("ja-JP") }, - { 0x40411, W("ja-JP_radstr") }, // Alternate Sort - { 0x00037, W("ka") }, // Neutral Locale - { 0x00437, W("ka-GE") }, - { 0x10437, W("ka-GE_modern") }, // Alternate Sort - { 0x0003f, W("kk") }, // Neutral Locale - { 0x0043f, W("kk-KZ") }, - { 0x0006f, W("kl") }, // Neutral Locale - { 0x0046f, W("kl-GL") }, - { 0x00053, W("km") }, // Neutral Locale - { 0x00453, W("km-KH") }, - { 0x0004b, W("kn") }, // Neutral Locale - { 0x0044b, W("kn-IN") }, - { 0x00012, W("ko") }, // Neutral Locale - { 0x00412, W("ko-KR") }, - { 0x00057, W("kok") }, // Neutral Locale - { 0x00457, W("kok-IN") }, - { 0x00040, W("ky") }, // Neutral Locale - { 0x00440, W("ky-KG") }, - { 0x0006e, W("lb") }, // Neutral Locale - { 0x0046e, W("lb-LU") }, - { 0x00054, W("lo") }, // Neutral Locale - { 0x00454, W("lo-LA") }, - { 0x00027, W("lt") }, // Neutral Locale - { 0x00427, W("lt-LT") }, - { 0x00026, W("lv") }, // Neutral Locale - { 0x00426, W("lv-LV") }, - { 0x00081, W("mi") }, // Neutral Locale - { 0x00481, W("mi-NZ") }, - { 0x0002f, W("mk") }, // Neutral Locale - { 0x0042f, W("mk-MK") }, - { 0x0004c, W("ml") }, // Neutral Locale - { 0x0044c, W("ml-IN") }, - { 0x00050, W("mn") }, // Neutral Locale - { 0x00450, W("mn-MN") }, - { 0x00850, W("mn-Mong-CN") }, - { 0x0007c, W("moh") }, // Neutral Locale - { 0x0047c, W("moh-CA") }, - { 0x0004e, W("mr") }, // Neutral Locale - { 0x0044e, W("mr-IN") }, - { 0x0003e, W("ms") }, // Neutral Locale - { 0x0083e, W("ms-BN") }, - { 0x0043e, W("ms-MY") }, - { 0x0003a, W("mt") }, // Neutral Locale - { 0x0043a, W("mt-MT") }, - { 0x00414, W("nb-NO") }, - { 0x00061, W("ne") }, // Neutral Locale - { 0x00461, W("ne-NP") }, - { 0x00013, W("nl") }, // Neutral Locale - { 0x00813, W("nl-BE") }, - { 0x00413, W("nl-NL") }, - { 0x00814, W("nn-NO") }, - { 0x00014, W("no") }, // Neutral Locale - { 0x0006c, W("nso") }, // Neutral Locale - { 0x0046c, W("nso-ZA") }, - { 0x00082, W("oc") }, // Neutral Locale - { 0x00482, W("oc-FR") }, - { 0x00048, W("or") }, // Neutral Locale - { 0x00448, W("or-IN") }, - { 0x00046, W("pa") }, // Neutral Locale - { 0x00446, W("pa-IN") }, - { 0x00015, W("pl") }, // Neutral Locale - { 0x00415, W("pl-PL") }, - { 0x0008c, W("prs") }, // Neutral Locale - { 0x0048c, W("prs-AF") }, - { 0x00063, W("ps") }, // Neutral Locale - { 0x00463, W("ps-AF") }, - { 0x00016, W("pt") }, // Neutral Locale - { 0x00416, W("pt-BR") }, - { 0x00816, W("pt-PT") }, - { 0x00501, W("qps-ploc") }, - { 0x005fe, W("qps-ploca") }, - { 0x009ff, W("qps-plocm") }, - { 0x00086, W("qut") }, // Neutral Locale - { 0x00486, W("qut-GT") }, - { 0x0006b, W("quz") }, // Neutral Locale - { 0x0046b, W("quz-BO") }, - { 0x0086b, W("quz-EC") }, - { 0x00c6b, W("quz-PE") }, - { 0x00017, W("rm") }, // Neutral Locale - { 0x00417, W("rm-CH") }, - { 0x00018, W("ro") }, // Neutral Locale - { 0x00418, W("ro-RO") }, - { 0x00019, W("ru") }, // Neutral Locale - { 0x00419, W("ru-RU") }, - { 0x00087, W("rw") }, // Neutral Locale - { 0x00487, W("rw-RW") }, - { 0x0004f, W("sa") }, // Neutral Locale - { 0x0044f, W("sa-IN") }, - { 0x00085, W("sah") }, // Neutral Locale - { 0x00485, W("sah-RU") }, - { 0x0003b, W("se") }, // Neutral Locale - { 0x00c3b, W("se-FI") }, - { 0x0043b, W("se-NO") }, - { 0x0083b, W("se-SE") }, - { 0x0005b, W("si") }, // Neutral Locale - { 0x0045b, W("si-LK") }, - { 0x0001b, W("sk") }, // Neutral Locale - { 0x0041b, W("sk-SK") }, - { 0x00024, W("sl") }, // Neutral Locale - { 0x00424, W("sl-SI") }, - { 0x0183b, W("sma-NO") }, - { 0x01c3b, W("sma-SE") }, - { 0x0103b, W("smj-NO") }, - { 0x0143b, W("smj-SE") }, - { 0x0243b, W("smn-FI") }, - { 0x0203b, W("sms-FI") }, - { 0x0001c, W("sq") }, // Neutral Locale - { 0x0041c, W("sq-AL") }, - { 0x07c1a, W("sr") }, // Neutral Locale - { 0x01c1a, W("sr-Cyrl-BA") }, - { 0x00c1a, W("sr-Cyrl-CS") }, - { 0x0181a, W("sr-Latn-BA") }, - { 0x0081a, W("sr-Latn-CS") }, - { 0x0001d, W("sv") }, // Neutral Locale - { 0x0081d, W("sv-FI") }, - { 0x0041d, W("sv-SE") }, - { 0x00041, W("sw") }, // Neutral Locale - { 0x00441, W("sw-KE") }, - { 0x0005a, W("syr") }, // Neutral Locale - { 0x0045a, W("syr-SY") }, - { 0x00049, W("ta") }, // Neutral Locale - { 0x00449, W("ta-IN") }, - { 0x0004a, W("te") }, // Neutral Locale - { 0x0044a, W("te-IN") }, - { 0x00028, W("tg") }, // Neutral Locale - { 0x00428, W("tg-Cyrl-TJ") }, - { 0x0001e, W("th") }, // Neutral Locale - { 0x0041e, W("th-TH") }, - { 0x00042, W("tk") }, // Neutral Locale - { 0x00442, W("tk-TM") }, - { 0x00032, W("tn") }, // Neutral Locale - { 0x00432, W("tn-ZA") }, - { 0x0001f, W("tr") }, // Neutral Locale - { 0x0041f, W("tr-TR") }, - { 0x00044, W("tt") }, // Neutral Locale - { 0x00444, W("tt-RU") }, - { 0x0005f, W("tzm") }, // Neutral Locale - { 0x0085f, W("tzm-Latn-DZ") }, - { 0x00080, W("ug") }, // Neutral Locale - { 0x00480, W("ug-CN") }, - { 0x00022, W("uk") }, // Neutral Locale - { 0x00422, W("uk-UA") }, - { 0x00020, W("ur") }, // Neutral Locale - { 0x00420, W("ur-PK") }, - { 0x00043, W("uz") }, // Neutral Locale - { 0x00843, W("uz-Cyrl-UZ") }, - { 0x00443, W("uz-Latn-UZ") }, - { 0x0002a, W("vi") }, // Neutral Locale - { 0x0042a, W("vi-VN") }, - { 0x00088, W("wo") }, // Neutral Locale - { 0x00488, W("wo-SN") }, - { 0x1007f, W("x-IV_mathan") }, // Alternate Sort - { 0x00034, W("xh") }, // Neutral Locale - { 0x00434, W("xh-ZA") }, - { 0x0006a, W("yo") }, // Neutral Locale - { 0x0046a, W("yo-NG") }, - { 0x00804, W("zh-CN") }, - { 0x20804, W("zh-CN_stroke") }, // Alternate Sort - { 0x00004, W("zh-Hans") }, // Neutral Locale - { 0x07c04, W("zh-Hant") }, // Neutral Locale - { 0x00c04, W("zh-HK") }, - { 0x01404, W("zh-MO") }, - { 0x21404, W("zh-MO_stroke") }, // Alternate Sort - { 0x01004, W("zh-SG") }, - { 0x21004, W("zh-SG_stroke") }, // Alternate Sort - { 0x00404, W("zh-TW") }, - { 0x30404, W("zh-TW_pronun") }, // Alternate Sort - { 0x00035, W("zu") }, // Neutral Locale - { 0x00435, W("zu-ZA") } -}; - -// This is the data from l_intl.nls as released for XP for the uppercase table. -// This is used for casing with OrdinalCompareStringIgnoreCase -// since XP is the only scenario that needs data and the only data that it needs -// is uppercasing, we duplicate the table here. -const static WORD s_pUppercaseIndexTableXP[] = { -0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0170, 0x0180, 0x0100, 0x0190, 0x0100, 0x0100, 0x01a0, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x01b0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01d0, 0x01e0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01f0, 0x0200, 0x0210, 0x0220, -0x0230, 0x0240, 0x0250, 0x0260, 0x0270, 0x0280, 0x0290, 0x02a0, 0x02b0, 0x02c0, -0x02d0, 0x02e0, 0x02f0, 0x0300, 0x0310, 0x0320, 0x01c0, 0x01c0, 0x01c0, 0x0330, -0x0340, 0x0350, 0x0360, 0x0370, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x0380, -0x0390, 0x03a0, 0x03b0, 0x03c0, 0x03d0, 0x03e0, 0x01c0, 0x01c0, 0x01c0, 0x03f0, -0x0400, 0x0410, 0x0420, 0x0430, 0x0440, 0x0450, 0x0460, 0x0470, 0x0480, 0x0490, -0x04a0, 0x04b0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x04c0, 0x04d0, -0x04e0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x04f0, 0x0500, -0x0510, 0x0520, 0x0530, 0x0540, 0x0550, 0x0560, 0x0570, 0x0580, 0x0590, 0x05a0, -0x05b0, 0x05c0, 0x05d0, 0x05e0, 0x05f0, 0x0600, 0x0610, 0x0620, 0x0630, 0x0640, -0x0650, 0x0660, 0x01c0, 0x01c0, 0x01c0, 0x0670, 0x01c0, 0x0680, 0x0690, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x06a0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x06b0, -0x06c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x06d0, 0x06e0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0x0000, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0x0079, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, -0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, -0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, -0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, -0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, -0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfffe, 0x0000, 0x0000, 0xfffe, -0x0000, 0x0000, 0xfffe, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, -0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0xffb1, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, -0x0000, 0xfffe, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff2e, -0xff32, 0x0000, 0xff33, 0xff33, 0x0000, 0xff36, 0x0000, 0xff35, 0x0000, 0x0000, -0x0000, 0x0000, 0xff33, 0x0000, 0x0000, 0xff31, 0x0000, 0x0000, 0x0000, 0x0000, -0xff2f, 0xff2d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff2d, 0x0000, 0x0000, -0xff2b, 0x0000, 0x0000, 0xff2a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff26, 0x0000, 0x0000, -0x0000, 0x0000, 0xff26, 0x0000, 0xff27, 0xff27, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0xff25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0xffda, 0xffdb, 0xffdb, 0xffdb, 0x0000, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe1, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffc0, 0xffc1, 0xffc1, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0x0000, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, -0xffb0, 0xffb0, 0xffb0, 0x0000, 0xffb0, 0xffb0, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, -0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffd0, 0xffd0, 0xffd0, -0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, -0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, -0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, -0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, -0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, -0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0008, 0x0000, 0x0008, 0x0000, 0x0008, 0x0000, 0x0008, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, -0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x004a, 0x004a, 0x0056, 0x0056, 0x0056, 0x0056, 0x0064, 0x0064, -0x0080, 0x0080, 0x0070, 0x0070, 0x007e, 0x007e, 0x0000, 0x0000, 0x0008, 0x0008, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff0, 0xfff0, 0xfff0, 0xfff0, -0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, -0xfff0, 0xfff0, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, -0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, -0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - -// This is the data from casing.nls as released for Win2K3/XP for the lowercase table. -// This is used for casing when linguistic casing is needed -// since Win2K3/XP is the only scenario that needs data, we duplicate the table here. -// It does NOT contain Turkic I exception behavior -const static WORD s_pLowercaseIndexTableLinguisticXP[] = { -0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0170, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0180, 0x0190, 0x0100, 0x01a0, 0x0100, 0x0100, 0x01b0, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x01c0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01e0, 0x01f0, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x0200, 0x0210, 0x01d0, 0x01d0, 0x0220, 0x0230, -0x0240, 0x0250, 0x0260, 0x0270, 0x0280, 0x0290, 0x02a0, 0x02b0, 0x02c0, 0x02d0, -0x02e0, 0x02f0, 0x0300, 0x0310, 0x0320, 0x0330, 0x01d0, 0x01d0, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x0340, 0x0350, -0x0360, 0x01d0, 0x01d0, 0x0370, 0x0380, 0x01d0, 0x0390, 0x03a0, 0x03b0, 0x01d0, -0x01d0, 0x01d0, 0x03c0, 0x03d0, 0x03e0, 0x03f0, 0x0400, 0x0410, 0x0420, 0x0430, -0x0440, 0x0450, 0x01d0, 0x01d0, 0x01d0, 0x0460, 0x0470, 0x0480, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x0490, 0x04a0, -0x04b0, 0x01d0, 0x01d0, 0x01d0, 0x04c0, 0x04d0, 0x04e0, 0x04f0, 0x0500, 0x0510, -0x0520, 0x0530, 0x0540, 0x0550, 0x0560, 0x0570, 0x0580, 0x0590, 0x05a0, 0x05b0, -0x05c0, 0x05d0, 0x05e0, 0x05f0, 0x0600, 0x0610, 0x0620, 0x01d0, 0x01d0, 0x01d0, -0x01d0, 0x0630, 0x0640, 0x0650, 0x0660, 0x0670, 0x01d0, 0x01d0, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x0680, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x01d0, 0x0690, 0x06a0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, -0x06b0, 0x06c0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x01d0, -0x01d0, 0x01d0, 0x01d0, 0x01d0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0xff39, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, -0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0xff87, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, -0x0000, 0x0000, 0x0000, 0x00d2, 0x0001, 0x0000, 0x0001, 0x0000, 0x00ce, 0x0001, -0x0000, 0x00cd, 0x00cd, 0x0001, 0x0000, 0x0000, 0x004f, 0x00ca, 0x00cb, 0x0001, -0x0000, 0x00cd, 0x00cf, 0x0000, 0x00d3, 0x00d1, 0x0001, 0x0000, 0x0000, 0x0000, -0x00d3, 0x00d5, 0x0000, 0x00d6, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0000, 0x0001, 0x0000, 0x00da, 0x0000, 0x0000, 0x0001, 0x0000, 0x00da, 0x0001, -0x0000, 0x00d9, 0x00d9, 0x0001, 0x0000, 0x0001, 0x0000, 0x00db, 0x0001, 0x0000, -0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0002, 0x0001, 0x0000, 0x0002, 0x0001, 0x0000, 0x0002, 0x0001, 0x0000, 0x0001, -0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, -0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0002, 0x0001, 0x0000, 0x0001, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0026, 0x0000, -0x0025, 0x0025, 0x0025, 0x0000, 0x0040, 0x0000, 0x003f, 0x003f, 0x0000, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0xfff3, 0xfffa, 0xfff7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0000, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, -0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0000, 0x0050, 0x0050, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, -0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, -0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, -0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, -0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, -0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0030, 0x0030, -0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, -0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, -0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, -0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, -0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xfff8, 0xfff8, -0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, -0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0xfff8, 0x0000, 0xfff8, 0x0000, 0xfff8, 0x0000, 0xfff8, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xfff8, 0xfff8, -0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0xfff8, 0xfff8, 0xffb6, 0xffb6, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffaa, 0xffaa, -0xffaa, 0xffaa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, 0xfff8, 0xff9c, 0xff9c, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0xfff8, 0xfff8, 0xff90, 0xff90, 0xfff9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff80, 0xff80, 0xff82, 0xff82, -0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, -0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001a, 0x001a, 0x001a, 0x001a, -0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, -0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, -0x001a, 0x001a, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, -0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000 -}; - -// This is the data from casing.nls as released for Win2K3/XP for the uppercase table. -// This is used for casing when linguistic casing is needed -// since Win2K3/XP is the only scenario that needs data, we duplicate the table here. -// It does NOT contain Turkic I exception behavior -const static WORD s_pUppercaseIndexTableLinguisticXP[] = { -0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0170, 0x0180, 0x0100, 0x0190, 0x0100, 0x0100, 0x01a0, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, -0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x01b0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01d0, 0x01e0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01f0, 0x0200, 0x0210, 0x0220, -0x0230, 0x0240, 0x0250, 0x0260, 0x0270, 0x0280, 0x0290, 0x02a0, 0x02b0, 0x02c0, -0x02d0, 0x02e0, 0x02f0, 0x0300, 0x0310, 0x0320, 0x01c0, 0x01c0, 0x01c0, 0x0330, -0x0340, 0x0350, 0x0360, 0x0370, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x0380, -0x0390, 0x03a0, 0x03b0, 0x03c0, 0x03d0, 0x03e0, 0x01c0, 0x01c0, 0x01c0, 0x03f0, -0x0400, 0x0410, 0x0420, 0x0430, 0x0440, 0x0450, 0x0460, 0x0470, 0x0480, 0x0490, -0x04a0, 0x04b0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x04c0, 0x04d0, -0x04e0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x04f0, 0x0500, -0x0510, 0x0520, 0x0530, 0x0540, 0x0550, 0x0560, 0x0570, 0x0580, 0x0590, 0x05a0, -0x05b0, 0x05c0, 0x05d0, 0x05e0, 0x05f0, 0x0600, 0x0610, 0x0620, 0x0630, 0x0640, -0x0650, 0x0660, 0x01c0, 0x01c0, 0x01c0, 0x0670, 0x01c0, 0x0680, 0x0690, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x06a0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x06b0, -0x06c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x06d0, 0x06e0, 0x01c0, 0x01c0, -0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0x0000, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0x0079, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xff18, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, -0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, -0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, -0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, -0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, -0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xfffe, 0x0000, 0xffff, 0xfffe, -0x0000, 0xffff, 0xfffe, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, -0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0xffb1, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, -0xffff, 0xfffe, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff2e, -0xff32, 0x0000, 0xff33, 0xff33, 0x0000, 0xff36, 0x0000, 0xff35, 0x0000, 0x0000, -0x0000, 0x0000, 0xff33, 0x0000, 0x0000, 0xff31, 0x0000, 0x0000, 0x0000, 0x0000, -0xff2f, 0xff2d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff2d, 0x0000, 0x0000, -0xff2b, 0x0000, 0x0000, 0xff2a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff26, 0x0000, 0x0000, -0x0000, 0x0000, 0xff26, 0x0000, 0xff27, 0xff27, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0xff25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001a, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0xffda, 0xffdb, 0xffdb, 0xffdb, 0xfffb, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe1, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffc0, 0xffc1, 0xffc1, 0x0000, -0xffc2, 0xffc7, 0x0000, 0x0000, 0x0000, 0xffd1, 0xffca, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0xffaa, 0xffb0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0x0000, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, 0xffb0, -0xffb0, 0xffb0, 0xffb0, 0x0000, 0xffb0, 0xffb0, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, -0xffff, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffd0, 0xffd0, 0xffd0, -0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, -0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, -0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, -0xffd0, 0xffd0, 0xffd0, 0xffd0, 0xffd0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, -0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, -0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, -0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0008, 0x0000, 0x0008, 0x0000, 0x0008, 0x0000, 0x0008, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, -0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x004a, 0x004a, 0x0056, 0x0056, 0x0056, 0x0056, 0x0064, 0x0064, -0x0080, 0x0080, 0x0070, 0x0070, 0x007e, 0x007e, 0x0000, 0x0000, 0x0008, 0x0008, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff0, 0xfff0, 0xfff0, 0xfff0, -0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, 0xfff0, -0xfff0, 0xfff0, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, -0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, -0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0xffe6, 0x0000, 0x0000, -0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, -0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - -static CRITSEC_COOKIE g_pDownlevelNlsCrst = NULL; - -static void DelayCreateCriticalSection() -{ - // Lazily allocate a Crst to serialize update access to the info structure. - // Carefully synchronize to ensure we don't leak a Crst in race conditions. - if (g_pDownlevelNlsCrst == NULL) - { - CRITSEC_COOKIE pCrst = ClrCreateCriticalSection(CrstNls, - (CrstFlags)(CRST_UNSAFE_COOPGC)); - - if (InterlockedCompareExchangeT(&g_pDownlevelNlsCrst, pCrst, NULL) != NULL) - { - ClrDeleteCriticalSection(pCrst); - } - } -} - -static void NormalizeCultureName(SString& sName) -{ - for (SString::Iterator i = sName.Begin(); i[0] != W('\0'); ++i) - { - sName.Replace(i,towlower(i[0])); - } -} - -static inline BOOL IsTurkicILcid(LCID lcid) -{ - return (PRIMARYLANGID(lcid) == LANG_TURKISH - || (PRIMARYLANGID(lcid) == LANG_AZERI - && lcid != LCID_AZ_CYRL_AZ)); -} - -namespace DownLevel -{ - - int GetSystemDefaultLocaleName(__out_ecount(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName) - { - LCID lcid=GetSystemDefaultLCID(); - if (lcid == 0) - return 0; - return NewApis::LCIDToLocaleName(lcid,lpLocaleName,cchLocaleName,0); - }; - - // Xp returns lcid 0x0404 (zh-TW) for GetUserDefaultUILanguage and GetSystemDefaultUILanguage - // on a CHH sku (expected 0x0c04) as well as a CHT sku (as expected) - inline LCID WorkAroundXpTaiwanHongKongBug(LCID lcid) - { - const LCID LANGID_ZH_TW = 0x0404; - const LCID LANGID_ZH_HK = 0x0c04; - - if(lcid == LANGID_ZH_TW && !NewApis::IsZhTwSku()) - { - lcid = LANGID_ZH_HK; - } - return lcid; - } - - DWORD GetUserPreferredUILanguages (__in DWORD dwFlags, __out PULONG pulNumLanguages, __out_ecount_opt(*pcchLanguagesBuffer) PWSTR pwszLanguagesBuffer, __in PULONG pcchLanguagesBuffer) - { - _ASSERTE(dwFlags==MUI_LANGUAGE_NAME); - - LCID lcid=GetUserDefaultUILanguage(); - if (lcid == 0) - return 0; - - lcid = WorkAroundXpTaiwanHongKongBug(lcid); - - WCHAR wszBuffer[LOCALE_NAME_MAX_LENGTH]; - if (NewApis::LCIDToLocaleName(lcid, wszBuffer, NumItems(wszBuffer), 0) == 0) - return 0; - - SIZE_T sLen=wcslen(wszBuffer)+2; - ULONG uLen = (ULONG)sLen; - if (uLen != sLen) - { - SetLastError(ERROR_ARITHMETIC_OVERFLOW); - return 0; - } - - *pulNumLanguages=1; - if (pwszLanguagesBuffer == NULL) - { - *pcchLanguagesBuffer=uLen; - return 1; - } - - if (sLen > *pcchLanguagesBuffer) - { - *pcchLanguagesBuffer=uLen; - SetLastError(ERROR_BUFFER_OVERFLOW); - return 0; - } - - *pcchLanguagesBuffer=uLen; - wcscpy_s(pwszLanguagesBuffer, sLen, wszBuffer); - pwszLanguagesBuffer[sLen-1]=W('\0'); - SetLastError(0); - return 1; - } - - - int GetUserDefaultLocaleName(__out_ecount(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName) - { - LCID lcid=GetUserDefaultLCID(); - if (lcid == 0) - return 0; - return NewApis::LCIDToLocaleName(lcid,lpLocaleName,cchLocaleName,0); - } - - int GetDateFormatEx(__in LPCWSTR lpLocaleName, __in DWORD dwFlags, __in_opt CONST SYSTEMTIME* lpDate, __in_opt LPCWSTR lpFormat, - __out_ecount(cchDate) LPWSTR lpDateStr, __in int cchDate, __in_opt LPCWSTR lpCalendar) - { - _ASSERTE(lpCalendar==NULL); - LCID lcid=NewApis::LocaleNameToLCID(lpLocaleName,0); - if (lcid == 0) - return 0; - return GetDateFormatW(lcid, dwFlags, lpDate, lpFormat, lpDateStr, cchDate); - } - - - int GetLocaleInfoEx (__in LPCWSTR lpLocaleName, __in LCTYPE LCType, __out_ecount_opt(cchData) LPWSTR lpLCData, __in int cchData) - { - _ASSERTE((lpLCData == NULL && cchData == 0) || (lpLCData != NULL && cchData > 0)); - - // Note that this'll return neutral LCIDs - LCID lcid=NewApis::LocaleNameToLCID(lpLocaleName,0); - if (lcid == 0) - return 0; - - int iRetCode = 0; - // Special casing LOCALE_SPARENT to do Uplevel fallback. - if ( (LCType & ~LOCALE_NOUSEROVERRIDE) == LOCALE_SPARENT ) - { - // OS doesn't know some LCTypes - iRetCode = UplevelFallback::GetLocaleInfoEx(lpLocaleName, lcid, LCType, lpLCData, cchData); - } - else - { - iRetCode=GetLocaleInfoW(lcid,LCType,lpLCData,cchData); - if (iRetCode == 0 && GetLastError() == ERROR_INVALID_FLAGS) - { - // OS doesn't know some LCTypes - iRetCode = UplevelFallback::GetLocaleInfoEx(lpLocaleName, lcid, LCType, lpLCData, cchData); - } - } - - return iRetCode; - }; - - // - // TurkishCompareStringIgnoreCase - // In downlevel platforms CompareString doesn't support Turkish I comparison. TurkishCompareStringIgnoreCase is to work around for this. - // In Turkish and Azeri cultures: - // ToUpper(i) = u0130 (Upper case I with dot above it) - // ToLower(I) = u0131 (Lower case i with no dot above). - // Toupper(i) != I - // ToLower(I) != i - // TurkishCompareStringIgnoreCase will scan the input strings and convert every i to u0130 and every I to u0131 and then call - // the system CompareString. - // if lpString1 not include i, I, u0130, and u0131 then we'll just call the system CompareString otherwise we'll scan the lpString2 - // to detect if we need to do the conversions mentioned above. - // - - #define TURKISH_CAPITAL_I_DOT_ABOVE ((WCHAR) 0x0130) - #define TURKISH_LOWERCASE_DOTLESS_I ((WCHAR) 0x0131) - #define LATIN_LOWERCASE_I_DOT_ABOVE ('i') - #define LATIN_CAPITAL_DOTLESS_I ('I') - - int TurkishCompareStringIgnoreCase(LCID lcid, DWORD dwCmpFlags, LPCWSTR lpString1, int cchCount1, LPCWSTR lpString2, int cchCount2) - { - int str1Index = 0; - int str2Index = 0; - BOOL fScanStr2 = FALSE; - - for (str1Index=0; str1Index<cchCount1; str1Index++) - { - if (lpString1[str1Index] == LATIN_LOWERCASE_I_DOT_ABOVE - || lpString1[str1Index] == LATIN_CAPITAL_DOTLESS_I) - { - break; - } - else if (lpString1[str1Index] == TURKISH_CAPITAL_I_DOT_ABOVE - || lpString1[str1Index] == TURKISH_LOWERCASE_DOTLESS_I) - { - fScanStr2 = TRUE; - } - } - - if (str1Index >= cchCount1) - { - if (!fScanStr2) - { - return ::CompareStringW(lcid, dwCmpFlags, lpString1, cchCount1, lpString2, cchCount2); - } - - for (str2Index=0; str2Index<cchCount2; str2Index++) - { - if (lpString2[str2Index] == LATIN_LOWERCASE_I_DOT_ABOVE - || lpString2[str2Index] == LATIN_CAPITAL_DOTLESS_I) - { - break; - } - } - - if (str2Index >= cchCount2) - { - return ::CompareStringW(lcid, dwCmpFlags, lpString1, cchCount1, lpString2, cchCount2); - } - } - - NewArrayHolder<WCHAR> pBuffer = new WCHAR[cchCount1 + cchCount2]; - - if (str1Index>0) - { - memcpy_s(pBuffer, cchCount1 * sizeof(WCHAR), lpString1, str1Index * sizeof(WCHAR)); - } - - for (; str1Index<cchCount1; str1Index++) - { - pBuffer[str1Index] = (lpString1[str1Index] == LATIN_LOWERCASE_I_DOT_ABOVE) - ? TURKISH_CAPITAL_I_DOT_ABOVE - : ((lpString1[str1Index] == LATIN_CAPITAL_DOTLESS_I) - ? TURKISH_LOWERCASE_DOTLESS_I - : lpString1[str1Index]); - } - - if (str2Index>0) - { - memcpy_s(&pBuffer[cchCount1], cchCount2 * sizeof(WCHAR), lpString2, str2Index * sizeof(WCHAR)); - } - - for (; str2Index<cchCount2; str2Index++) - { - pBuffer[cchCount1 + str2Index] = (lpString2[str2Index] == LATIN_LOWERCASE_I_DOT_ABOVE) - ? TURKISH_CAPITAL_I_DOT_ABOVE - : ((lpString2[str2Index] == LATIN_CAPITAL_DOTLESS_I) - ? TURKISH_LOWERCASE_DOTLESS_I - : lpString2[str2Index]); - } - - return ::CompareStringW(lcid, dwCmpFlags, pBuffer, cchCount1, &pBuffer[cchCount1], cchCount2); - } - - int CompareStringEx(__in LPCWSTR lpLocaleName, __in DWORD dwCmpFlags, __in_ecount(cchCount1) LPCWSTR lpString1, __in int cchCount1, __in_ecount(cchCount2) LPCWSTR lpString2, - __in int cchCount2, __in_opt LPNLSVERSIONINFO lpVersionInformation, __in_opt LPVOID lpReserved, __in_opt LPARAM lParam ) - { - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - SO_TOLERANT; - PRECONDITION(CheckPointer(lpLocaleName)); - PRECONDITION(CheckPointer(lpString1)); - PRECONDITION(CheckPointer(lpString2)); - } CONTRACTL_END; - - // Invariant is like en-US (default table) on downlevel (pre-vista) OS's - if (lpLocaleName[0] == W('\0')) - { - // For now, use "en" instead. - lpLocaleName = W("en-US"); - } - - // Get an LCID to call the downlevel function - LCID lcid=NewApis::LocaleNameToLCID(lpLocaleName,0); - if (lcid == 0) - return 0; - - // Need to remap flags to get rid of Vista flags and replace with downlevel flags - // (not used at this moment) - if ((dwCmpFlags & LINGUISTIC_IGNOREDIACRITIC)!=0) - { - dwCmpFlags -= LINGUISTIC_IGNOREDIACRITIC; - dwCmpFlags |= NORM_IGNORENONSPACE; - } - if ((dwCmpFlags & LINGUISTIC_IGNORECASE)!=0) - { - dwCmpFlags -= LINGUISTIC_IGNORECASE; - dwCmpFlags |= NORM_IGNORECASE; - } - dwCmpFlags &= (~NORM_LINGUISTIC_CASING); - - if (((dwCmpFlags & NORM_IGNORECASE)!=0) && IsTurkicILcid(lcid)) - { - return TurkishCompareStringIgnoreCase(lcid, dwCmpFlags, lpString1, cchCount1, lpString2, cchCount2); - } - - return ::CompareStringW(lcid,dwCmpFlags,lpString1,cchCount1,lpString2,cchCount2); - } - - __inline WCHAR MapCase(const WORD * table, WCHAR wch) - { - WORD value = table[wch >> 8]; - value = table[value + ((wch >> 4) & 0xf)]; - value = table[value + (wch & 0xf)]; - return (wch + (int)((short)value)); - } - - // since this should only be run on XP, we just use the same table as XP - __inline WCHAR ToUpperXP(WCHAR wch) - { - return MapCase(s_pUppercaseIndexTableXP, wch); - } - - INT32 CompareOrdinalIgnoreCaseHelper(__in_ecount(count) DWORD* strAChars, __in_ecount(count) DWORD* strBChars, int count) - { - if( count == 0) - return 0; - - int temp = 0; - - _ASSERTE( count >0); - - // Only go through fast code path if two strings have the same alignment - if (((size_t)strAChars & 3) == ((size_t)strBChars & 3)) { - int unalignedBytesA = (size_t)strAChars & 3; - - _ASSERTE(unalignedBytesA == 0 || unalignedBytesA == 2); - // First try to make the strings aligned at DWORD boundary. - if( unalignedBytesA != 0 ) { - LPWSTR ptr1 = (LPWSTR)strAChars; - LPWSTR ptr2 = (LPWSTR)strBChars; - - if (*ptr1 != *ptr2) { - temp = ((int)ToUpperXP(*ptr1) - (int)ToUpperXP(*ptr2)); - if( temp != 0) { - return temp; - } - } - - --count; - strAChars = (DWORD *)(ptr1 + 1); - strBChars = (DWORD *)(ptr2 + 1); - } - - // Loop comparing a DWORD at a time. - while (count >= 2) { - _ASSERTE(IS_ALIGNED((size_t)strAChars, 4) && IS_ALIGNED((size_t)strBChars, 4)); - if ((*strAChars - *strBChars) != 0) { - LPCWSTR ptr1 = (WCHAR*)strAChars; - LPCWSTR ptr2 = (WCHAR*)strBChars; - - if (*ptr1 != *ptr2) { - temp = ((int)ToUpperXP(*ptr1) - (int)ToUpperXP(*ptr2)); - } - if (temp != 0) { - return (temp); - } - - temp = (int)ToUpperXP(*(ptr1+1)) - (int)ToUpperXP(*(ptr2+1)); - if (temp != 0) { - return (temp); - } - } - ++strBChars; - ++strAChars; - count -= 2; - } - } - - // We can exit the loop when we see two different DWORDs and one of them contains surrogate - // or they are equal after case conversion. - // We can also exit the loop when there is no or only one character left. - if( count == 0) { - return 0; - } - - // we need to handle one special case here. Say we have two strings like: - // A HS1 LS1 HS2 LS2 or A HS1 LS1 - // A HS1 LS2 HS2 LS2 or A HS1 NS - // we need to go back a char to decide the order - LPCWSTR pwStrB = (LPWSTR)strBChars; - LPCWSTR pwStrA = (LPWSTR)strAChars; - - temp = 0; - while ((count--) > 0) - { - WCHAR charA = *pwStrA++; - WCHAR charB = *pwStrB++; - - if( charA != charB) { - charA = ToUpperXP(charA); - charB = ToUpperXP(charB); - - temp = (int)charA - (int)charB; - - if (temp != 0) { - return (temp); - } - } - } - - return 0; - } - - - int CompareStringOrdinal(__in_ecount(cchCount1) LPCWSTR string1, __in int cchCount1, __in_ecount(cchCount2) LPCWSTR string2, __in int cchCount2, __in BOOL bIgnoreCase) - { - // This should only happen for IgnoreCase == true. The rest are hard coded - if (!bIgnoreCase) - { - return 0; - } - - DWORD *strAChars, *strBChars; - strAChars = (DWORD*)string1; - strBChars = (DWORD*)string2; - - // If the strings are the same length, compare exactly the right # of chars. - // If they are different, compare the shortest # + 1 (the '\0'). - int count = cchCount1; - if( count > cchCount2) - count = cchCount2; - - INT32 ret = CompareOrdinalIgnoreCaseHelper(strAChars, strBChars, count); - if( ret == 0) { - ret = cchCount1 - cchCount2; - } - - if (ret > 0) - { - return CSTR_GREATER_THAN; - } - if (ret < 0) - { - return CSTR_LESS_THAN; - } - - return CSTR_EQUAL; - } - - inline bool HasOnlyUppercaseOrLowercaseFlag(__in DWORD flags) - { - if(((flags & (LCMAP_UPPERCASE | LCMAP_LOWERCASE))== 0) - || MORE_THAN_ONE(flags, LCMAP_UPPERCASE) - || MORE_THAN_ONE(flags, LCMAP_LOWERCASE)) - { - return false; - } - return true; - } - - int TurkicICasing( __in DWORD flags, - __in_ecount(cchSrc) LPCWSTR source, - __in int cchSrc, - __out_ecount(cchDest) LPWSTR destination, - __in int cchDest) - { - _ASSERTE(source != NULL); - _ASSERTE(cchSrc > 0); - _ASSERTE(destination != NULL); - _ASSERTE(cchSrc == cchDest); - _ASSERTE(HasOnlyUppercaseOrLowercaseFlag(flags)); - - const WORD * table; - WCHAR dottedI, mappedDottedI; - WCHAR dotlessI, mappedDotlessI; - - if ((flags & LCMAP_UPPERCASE) != 0) - { - table = s_pUppercaseIndexTableLinguisticXP; - dottedI = LATIN_LOWERCASE_I_DOT_ABOVE; - mappedDottedI = TURKISH_CAPITAL_I_DOT_ABOVE; - dotlessI = TURKISH_LOWERCASE_DOTLESS_I; - mappedDotlessI = LATIN_CAPITAL_DOTLESS_I; - } - else - { - table = s_pLowercaseIndexTableLinguisticXP; - dottedI = TURKISH_CAPITAL_I_DOT_ABOVE; - mappedDottedI = LATIN_LOWERCASE_I_DOT_ABOVE; - dotlessI = LATIN_CAPITAL_DOTLESS_I; - mappedDotlessI = TURKISH_LOWERCASE_DOTLESS_I; - } - - for (int i = 0; i < cchSrc && i < cchDest; ++i) - { - if (source[i] == dottedI) - { - destination[i] = mappedDottedI; - } - else if (source[i] == dotlessI) - { - destination[i] = mappedDotlessI; - } - else { - destination[i] = MapCase(table, source[i]); - } - } - - return cchSrc; - } - - int DefaultLinguisticCasing( __in DWORD flags, - __in_ecount(cchSrc) LPCWSTR source, - __in int cchSrc, - __out_ecount(cchDest) LPWSTR destination, - __in int cchDest) - { - _ASSERTE(source != NULL); - _ASSERTE(cchSrc > 0); - _ASSERTE(destination != NULL); - _ASSERTE(cchSrc == cchDest); - _ASSERTE(HasOnlyUppercaseOrLowercaseFlag(flags)); - - const WORD * table; - - if ((flags & LCMAP_UPPERCASE) != 0) - { - table = s_pUppercaseIndexTableLinguisticXP; - } - else - { - table = s_pLowercaseIndexTableLinguisticXP; - } - - for (int i = 0; i < cchSrc && i < cchDest; ++i) - { - destination[i] = MapCase(table, source[i]); - } - - return cchSrc; - } - - __success(return != 0) - int LinguisticCaseString(__in LCID lcid,__in DWORD flags, - __in_ecount(cchSrc) const WCHAR * source, - __in int cchSrc, - __out_ecount_opt(cchDest) WCHAR * destination, - __in int cchDest) - { - _ASSERTE(lcid != 0); - - if ( (cchSrc == 0) || (cchDest < 0) || (source == NULL) || - ((cchDest != 0) && (destination == NULL)) ) - { - SetLastError(ERROR_INVALID_PARAMETER); - return (0); - } - - if(!HasOnlyUppercaseOrLowercaseFlag(flags)) - { - SetLastError(ERROR_INVALID_FLAGS); - return (0); - } - - if(cchSrc < 0) - { - cchSrc = (int)wcslen(source); - } - - if(destination == NULL) - { - return cchSrc; - } - - if(IsTurkicILcid(lcid)) - { - return TurkicICasing(flags, - source, cchSrc, - destination, cchDest); - } - else - { - return DefaultLinguisticCasing(flags, - source, cchSrc, - destination, cchDest); - } - - } - -#ifdef _MSC_VER -// Get rid of size OACR requirement. -#pragma warning(push) -#pragma warning(disable:25057) -#endif - int LCMapStringEx(__in LPCWSTR lpLocaleName, - __in DWORD dwMapFlags, - __in_ecount(cchSrc) LPCWSTR lpSrcStr, - __in int cchSrc, - __out_xcount_opt(cchDest) LPWSTR lpDestStr, - __in int cchDest, - __in_opt LPNLSVERSIONINFO lpVersionInformation, - __in_opt LPVOID lpReserved, - __in_opt LPARAM lParam) -#ifdef _MSC_VER -#pragma warning(pop) -#endif - { - LCID lcid=NewApis::LocaleNameToLCID(lpLocaleName,0); - if (lcid == 0) - return 0; - - // Need to remap flags to get rid of Vista flags and replace with downlevel flags - // (not used at this moment) - if ((dwMapFlags & LINGUISTIC_IGNOREDIACRITIC)!=0) - { - dwMapFlags -= LINGUISTIC_IGNOREDIACRITIC; - dwMapFlags |= NORM_IGNORENONSPACE; - } - if ((dwMapFlags & LINGUISTIC_IGNORECASE)!=0) - { - dwMapFlags -= LINGUISTIC_IGNORECASE; - dwMapFlags |= NORM_IGNORECASE; - } - dwMapFlags &= (~NORM_LINGUISTIC_CASING); - -// START WORK_AROUND_WIN2K3_LCMAPSTRING_BUG - if((dwMapFlags & LCMAP_LINGUISTIC_CASING) != 0 - && (dwMapFlags & (LCMAP_UPPERCASE | LCMAP_LOWERCASE)) != 0) - { - dwMapFlags &= (~LCMAP_LINGUISTIC_CASING); - - return LinguisticCaseString(lcid, dwMapFlags, lpSrcStr, cchSrc, lpDestStr, cchDest); - } -// END WORK_AROUND_WIN2K3_LCMAPSTRING_BUG - return ::LCMapStringW(lcid,dwMapFlags, lpSrcStr, cchSrc, lpDestStr, cchDest); - } - - int FindNLSStringEx(__in LPCWSTR lpLocaleName, - __in DWORD dwFindNLSStringFlags, - __in_ecount(cchSource) LPCWSTR lpStringSource, - __in int cchSource, - __in_ecount(cchValue) LPCWSTR lpStringValue, - __in int cchValue, - __out_opt LPINT pcchFound, - __in_opt LPNLSVERSIONINFO lpVersionInformation, - __in_opt LPVOID lpReserved, - __in_opt LPARAM lParam) - { - int retValue = -1; - - if (lpLocaleName == NULL || lpStringSource == NULL || lpStringValue == NULL) - { - return retValue; - } - - if (dwFindNLSStringFlags & (FIND_ENDSWITH | FIND_FROMEND)) - { - retValue = NewApis::LastIndexOfString(lpLocaleName, lpStringSource, cchSource, lpStringValue, cchValue, (int) dwFindNLSStringFlags & FIND_NLS_STRING_FLAGS_NEGATION, dwFindNLSStringFlags & FIND_ENDSWITH, pcchFound); - } - else - { - retValue = NewApis::IndexOfString(lpLocaleName, lpStringSource, cchSource, lpStringValue, cchValue, (int) dwFindNLSStringFlags & FIND_NLS_STRING_FLAGS_NEGATION, dwFindNLSStringFlags & FIND_STARTSWITH, pcchFound); - } - return retValue; - } - - - // Mac and Windows <= Windows XP - // Note: "Function" is unused, always handles sorting for now - // Note: "dwFlags" is unused, we don't have flags for now - // Note: "lpVersionInfo" is unused, we always presume the current version - BOOL IsNLSDefinedString(NLS_FUNCTION Function, DWORD dwFlags, LPNLSVERSIONINFOEX lpVersionInfo, LPCWSTR pString, int nStringLen ) - { - // Ported downlevel code from comnlsinfo.cpp - - CQuickBytes buffer; - buffer.AllocThrows(16); - int ich = 0; - - while(ich < nStringLen) - { - WCHAR wch = pString[ich]; - - int dwBufSize=NewApis::LCMapStringEx(W("en-US"),LCMAP_SORTKEY|SORT_STRINGSORT,pString+ich,1,(LPWSTR)buffer.Ptr(), - (int)(buffer.Size()/sizeof(WCHAR)),NULL,NULL,0); - - if (dwBufSize == 0) - { - buffer.AllocThrows(buffer.Size()*2); - continue; // try again - } - - if (LPBYTE(buffer.Ptr())[0] == 0x1) // no weight - { - // - // Check for the NULL case and formatting characters case. Not - // defined but valid. - // - switch(wch) - { - case 0x0000: // NULL - case 0x0640: // TATWEEL - case 0x180b: // MONGOLIAN FVS 1 - case 0x180c: // MONGOLIAN FVS 2 - case 0x180d: // MONGOLIAN FVS 3 - case 0x180e: // MONGOLIAN VOWEL SEPERATOR - case 0x200c: // ZWNJ - case 0x200d: // ZWJ - case 0x200e: // LRM - case 0x200f: // RLM - case 0x202a: // LRE - case 0x202b: // RLE - case 0x202c: // PDF - case 0x202d: // LRO - case 0x202e: // RLO - case 0x206a: // ISS - case 0x206b: // SSS - case 0x206c: // IAFS - case 0x206d: // AAFS - case 0x206e: // NATIONAL DS - case 0x206f: // NOMINAL DS - case 0xfeff: // ZWNBSP - case 0xfff9: // IAA - case 0xfffa: // IAS - case 0xfffb: // IAT - case 0xfffc: // ORC - case 0xfffd: // RC - ich++; - continue; - - default: - return (FALSE); - } - } - - // - // Eliminate Private Use characters. They are defined but cannot be considered - // valid because AD-style apps should not use them in identifiers. - // - if ((wch >= PRIVATE_USE_BEGIN) && (wch <= PRIVATE_USE_END)) - { - return (FALSE); - } - - // - // Eliminate invalid surogates pairs or single surrogates. Basically, all invalid - // high surrogates have aleady been filtered (above) since they are unsortable. - // All that is left is to check for standalone low surrogates and valid high - // surrogates without corresponding low surrogates. - // - - if ((wch >= LOW_SURROGATE_START) && (wch <= LOW_SURROGATE_END)) - { - // Leading low surrogate - return (FALSE); - } - else if ((wch >= HIGH_SURROGATE_START) && (wch <= HIGH_SURROGATE_END)) - { - // Leading high surrogate - if ( ((ich + 1) < nStringLen) && // Surrogates not the last character - (pString[ich+1] >= LOW_SURROGATE_START) && (pString[ich+1] <= LOW_SURROGATE_END)) // Low surrogate - { - // Valid surrogates pair, High followed by a low surrogate. Skip the pair! - ich++; - } - else - { - // High surrogate without low surrogate, so exit. - return (FALSE); - } - } - - ich++; - - } - return (TRUE); - } - - - int GetCalendarInfoEx(__in LPCWSTR lpLocaleName, - __in CALID Calendar, - __in_opt LPCWSTR pReserved, - __in CALTYPE CalType, - __out_ecount_opt(cchData) LPWSTR lpCalData, - __in int cchData, - __out_opt LPDWORD lpValue) - { - - _ASSERTE((lpCalData == NULL && cchData == 0) || (lpCalData != NULL && cchData > 0)); - if ((CalType & CAL_RETURN_NUMBER)) - { - // If CAL_RETURN_NUMBER, lpValue must be non-null and lpCalData must be null - _ASSERTE((lpValue != NULL) && (lpCalData == NULL)); - } - - LCID lcid=NewApis::LocaleNameToLCID(lpLocaleName,0); - - // zh-HK has English month/day names in older OS's, so we need to fix that (pre-Vista OS's) - if (lcid == 0x0c04 && Calendar == CAL_GREGORIAN && - ((CalType >= CAL_SDAYNAME1 && CalType <= CAL_SABBREVMONTHNAME13) || - (CalType >= CAL_SSHORTESTDAYNAME1 && CalType <= CAL_SSHORTESTDAYNAME7))) - { - // zh-TW has the English names for those month/day name values - lcid = 0x0404; - } - - if (lcid == 0) - return 0; - return ::GetCalendarInfoW(lcid, Calendar, CalType, lpCalData, cchData, lpValue ); - } - - - namespace LegacyCallbacks - { - LPARAM lDateFormatParam = NULL; - DATEFMT_ENUMPROCEXEX realDateCallback = NULL; - - BOOL CALLBACK EnumDateFormatsProcWrapper(__in_z LPTSTR lpDateFormatString, __in CALID Calendar) - { - if (realDateCallback != NULL && lDateFormatParam != NULL) - return realDateCallback(lpDateFormatString, Calendar, lDateFormatParam); - - // Didn't have the globals, fail - return false; - }; - - BOOL EnumDateFormatsExEx(DATEFMT_ENUMPROCEXEX lpDateFmtEnumProcExEx, LPCWSTR lpLocaleName, DWORD dwFlags, LPARAM lParam) - { - LCID lcid=NewApis::LocaleNameToLCID(lpLocaleName,0); - if (lcid == 0) - return 0; - - DelayCreateCriticalSection(); - - BOOL ret = false; - { - CRITSEC_Holder sCrstHolder(g_pDownlevelNlsCrst); - - // Store our real callback and lParam - lDateFormatParam = lParam; - realDateCallback = lpDateFmtEnumProcExEx; - ret = EnumDateFormatsExW(EnumDateFormatsProcWrapper, lcid, dwFlags); - } - return ret; - }; - - LPARAM lTimeFormatParam = NULL; - TIMEFMT_ENUMPROCEX realTimeCallback = NULL; - - BOOL CALLBACK EnumTimeFormatsProcWrapper(__in_z LPTSTR lpTimeFormatString) - { - if (realTimeCallback != NULL && lTimeFormatParam != NULL) - return realTimeCallback(lpTimeFormatString, lTimeFormatParam); - - // Didn't have the globals, fail - return false; - }; - - BOOL EnumTimeFormatsEx(TIMEFMT_ENUMPROCEX lpTimeFmtEnumProcEx, LPCWSTR lpLocaleName, DWORD dwFlags, LPARAM lParam) - { - LCID lcid=NewApis::LocaleNameToLCID(lpLocaleName,0); - if (lcid == 0) - return 0; - - DelayCreateCriticalSection(); - - BOOL ret = false; - { - CRITSEC_Holder sCrstHolder(g_pDownlevelNlsCrst); - - // Store our real callback and lParam - lTimeFormatParam = lParam; - realTimeCallback = lpTimeFmtEnumProcEx; - ret = EnumTimeFormatsW(EnumTimeFormatsProcWrapper, lcid, dwFlags); - } - return ret; - }; - - LPARAM lCalendarInfoParam = NULL; - CALINFO_ENUMPROCEXEX realCalendarInfoCallback = NULL; - - BOOL CALLBACK EnumCalendarInfoProcWrapper(__in_z LPTSTR lpCalendarInfoString, __in CALID Calendar) - { - if (realCalendarInfoCallback != NULL && lCalendarInfoParam != NULL) - return realCalendarInfoCallback(lpCalendarInfoString, Calendar, NULL, lCalendarInfoParam); - - // Didn't have the globals, fail - return false; - }; - - BOOL EnumCalendarInfoExEx(CALINFO_ENUMPROCEXEX pCalInfoEnumProcExEx, LPCWSTR lpLocaleName, CALID Calendar, LPCWSTR lpReserved, CALTYPE CalType, LPARAM lParam) - { - LCID lcid=NewApis::LocaleNameToLCID(lpLocaleName,0); - if (lcid == 0) - return 0; - - DelayCreateCriticalSection(); - - BOOL ret = false; - { - CRITSEC_Holder sCrstHolder(g_pDownlevelNlsCrst); - - // Store our real callback and lParam - lCalendarInfoParam = lParam; - realCalendarInfoCallback = pCalInfoEnumProcExEx; - ret = EnumCalendarInfoExW(EnumCalendarInfoProcWrapper, lcid, Calendar, CalType); - } - return ret; - }; - } - - // This is where we fudge data the OS doesn't know (even on Vista) - namespace UplevelFallback - { - // Some properties are unknown to downlevel OS's (pre windows 7), so synthesize them - // Pass in LCID if calling from the downlevel APIs. - // Note that Vista gets here for neutrals as well as specifics - // The only neutral Vista properties we support are SNAME, SPARENT & INEUTRAL (which assumes its a locale) - // if lpLCData is NULL, caller wants required size to be returned. So we check before assigning and return - // buffer size. - int GetLocaleInfoEx(__in LPCWSTR lpLocaleName, __in LCID lcid, __in LCTYPE LCType, __out_ecount_opt(cchData) LPWSTR lpLCData, __in int cchData) - { - _ASSERTE((lpLCData == NULL && cchData == 0) || (lpLCData != NULL && cchData > 0)); - - LPCWSTR useString = NULL; - WCHAR buffer[80]; - - // We don't differentiate user overrides for these types - LCType &= ~LOCALE_NOUSEROVERRIDE; - - // TODO: NLS Arrowhead -Find better ways of handling these properties: - // Right now we'll just fill them in with constant data - switch (LCType) - { - case LOCALE_SPERCENT: // Percent symbol - useString = W("%"); - break; - case LOCALE_IPOSITIVEPERCENT | LOCALE_RETURN_NUMBER: // Positive percent format - if (lpLCData) - { - *((DWORD*)lpLCData) = 0; - } - return 2; - case LOCALE_INEGATIVEPERCENT | LOCALE_RETURN_NUMBER: // Negative percent format - if (lpLCData) - { - *((DWORD*)lpLCData) = 0; - } - return 2; - case LOCALE_SPERMILLE: // Per mille symbol - useString = W("\x2030"); - break; - case LOCALE_SSHORTTIME: // Short time format (default) - // CultureData synthesizes short time from long time - - case LOCALE_SENGLISHDISPLAYNAME: // English display name (ie: Fijiian (Fiji)) - case LOCALE_SNATIVEDISPLAYNAME: // Native dispaly name (ie: Deutsch (Deutschland)) - // native & english names are built more easily in managed code - - //case LOCALE_SMONTHDAY: // month/day format - //we get month/day patterns from the calendar data. This would be override, but that's not assigned - // TODO: NLS Arrowhead - in windows 7 if we add overrides - break; - case LOCALE_IREADINGLAYOUT | LOCALE_RETURN_NUMBER: // Is Right To Left? - // Use the RTL bit in the font signature - LOCALESIGNATURE LocSig; - if (NewApis::GetLocaleInfoEx( lpLocaleName, LOCALE_FONTSIGNATURE, (LPWSTR)&LocSig, sizeof(LocSig) / sizeof(WCHAR) ) == - sizeof(LocSig) / sizeof(WCHAR)) - { - // Got the locale signature information, get the isrtl bit 123 to see if its RTL. - if (lpLCData) - { - *((DWORD*)lpLCData) = ((LocSig.lsUsb[3] & 0x0800) != 0) ? 1 : 0; - } - return 2; - } - // Failed, just return 0 - return 0; - - case LOCALE_SNAME: - // If we don't have an LCID, find one, this is < Vista or neutrals - if (lcid == 0) lcid = NewApis::LocaleNameToLCID(lpLocaleName,0); - - // Make sure windows recognizes this LCID, or that its zh-Hant, sr, or bs - if (GetLocaleInfoW(lcid, LOCALE_IDIGITS | LOCALE_RETURN_NUMBER, NULL, 0) == 0 && - lcid != 0x7c04 && lcid != 0x7c1a && lcid != 0x781a) - { - // Not a real locale, fail, don't fail for neutrals zh-Hant, sr, or bs. - return 0; - } - - // Convert name to LCID (so we get pretty name) - if (lcid != 0) - return NewApis::LCIDToLocaleName(lcid, lpLCData, cchData, 0); - else - return 0; - - case LOCALE_INEUTRAL | LOCALE_RETURN_NUMBER: - // If its XP/Win2K3 or lower, then the lcid can tell us - - if (lcid != 0) - { - if (lpLCData) - *((DWORD*)lpLCData) = ((lcid < 0x0400 || lcid > 0x7000) && (lcid < 0x10000)) ? 1 : 0; - return 2; - } - - // Vista or Win2K8 fail for neutrals - // Note this assumes that neutral or not it is a valid locale. - if (NewApis::GetLocaleInfoEx(lpLocaleName, LOCALE_IDIGITS | LOCALE_RETURN_NUMBER, NULL, 0) == 0) - { - // Failed, its a neutral - // Note, we assumed it is a valid locale. (Caller lookind in our name/lcid tables undoubtedly) - if (lpLCData) - *((DWORD*)lpLCData) = 1; - } - else - { - // Succeeded, its not neutral - if (lpLCData) - *((DWORD*)lpLCData) = 0; - } - - // Return "success" - return 2; - - case LOCALE_SPARENT: - // Should only get here for neutrals or downlevel - // Downlevel only needs work if its not neutral - if (lcid != 0) - { - // Downlevel - // If its a neutral LCID then its "" Invariant - if ((lcid < 0x0400 || lcid > 0x7000) && (lcid < 0x10000)) - { - useString = W(""); - } - else - { - // Parent is same as LCID & 0x3ff, except for a few cases - switch (lcid) - { - case 0x0404: // zh-TW - case 0x0c04: // zh-HK - case 0x1404: // zh-MO - lcid = 0x7c04; // zh-Hant - break; - case 0x081a: // sr-Latn-CS - case 0x0c1a: // sr-Cryl-CS - lcid = 0x7c1a; // sr - break; - case 0x201a: // bs-Cyrl-BA - case 0x141a: // bs-Latn-BA - lcid = 0x781a; // bs - break; - default: - lcid &= 0x03ff; - break; - } - - // Get the name from LCIDToName - if (NewApis::LCIDToLocaleName(lcid, buffer, NumItems(buffer), 0)) - { - useString = buffer; - } - } - } - else - { - // Neutral on Vista / W2K8. Always "" Invariant - // or neutral LCID - useString = W(""); - } - break; - - case LOCALE_SNAN: - useString = W("NaN"); - break; - case LOCALE_SPOSINFINITY: - useString = W("Infinity"); - break; - case LOCALE_SNEGINFINITY: - useString = W("-Infinity"); - break; - } - - // Return number already returned, so we should have a string, else its unknown - if (useString == NULL) return 0; - - // Copy our string to the output & return - int size = (int)(wcslen(useString) + 1); - // if cchData is 0, then caller wants us to return size - if (size > cchData && cchData != 0) return 0; - if (lpLCData) - { - memcpy(lpLCData, useString, size * sizeof(WCHAR)); - } - - return size; - } - - LPCWSTR const arabicSuperShortDayNames[] = - { - W("\x0646"), // Day name for Monday - W("\x062b"), - W("\x0631"), - W("\x062e"), - W("\x062c"), - W("\x0633"), - W("\x062d") // Day name for Sunday - }; - - LPCWSTR const chineseSuperShortDayNames[] = - { - W("\x4e00"), // Day name for Monday - W("\x4e8c"), - W("\x4e09"), - W("\x56db"), - W("\x4e94"), - W("\x516d"), - W("\x65e5") // Day name for Sunday - }; - - LPCWSTR const hebrewSuperShortDayNames[] = - { - W("\x05d1"), // Day name for Monday - W("\x05d2"), - W("\x05d3"), - W("\x05d4"), - W("\x05d5"), - W("\x05e9"), - W("\x05d0") // Day name for Sunday - }; - - LPCWSTR const mongolianSuperShortDayNames[] = - { - W("\x0414\x0430"), // Day name for Monday - W("\x041c\x044f"), - W("\x041b\x0445"), - W("\x041f\x04af"), - W("\x0411\x0430"), - W("\x0411\x044f"), - W("\x041d\x044f") // Day name for Sunday - }; - - int GetCalendarInfoEx(__in_opt LPCWSTR lpLocaleName, - __in CALID Calendar, - __in_opt LPCWSTR pReserved, - __in CALTYPE CalType, - __out_ecount_opt(cchData) LPWSTR lpCalData, - __in int cchData, - __out_opt LPDWORD lpValue) - { - - _ASSERTE((lpCalData == NULL && cchData == 0) || (lpCalData != NULL && cchData > 0)); - if ((CalType & CAL_RETURN_NUMBER)) - { - // If CAL_RETURN_NUMBER, lpValue must be non-null and lpCalData must be null - _ASSERTE((lpValue != NULL) && (lpCalData == NULL)); - } - - // We don't differentiate user overrides for these types - CalType &= ~CAL_NOUSEROVERRIDE; - - LCID lcid=NewApis::LocaleNameToLCID(lpLocaleName,0); - int ret = 0; - LPCWSTR pUseString = W(""); - LPCWSTR const *pDays = NULL; - - // - // The requested info is a string. - // - - // NOTE: Genitive names will skip this and just return empty strings - // not much we can do for those. - switch (CalType) - { - case CAL_SMONTHDAY: - // Special cases for older locales with names that can't be truncated - pUseString = W("MMMM dd"); - - // Special case for CJK locales - if ((lcid & 0x3ff) == 0x11 || // Japanese - (lcid & 0x3ff) == 0x04) // Chinese - { - // Japanese & Chinese - pUseString = W("M'\x6708'd'\x65e5'"); - } - else if ((lcid & 0x3ff) == 0x012) // Korean - { - // Korean - pUseString = W("M'\xc6d4' d'\xc77c'"); - } - break; - - case CAL_SSHORTESTDAYNAME1: - case CAL_SSHORTESTDAYNAME2: - case CAL_SSHORTESTDAYNAME3: - case CAL_SSHORTESTDAYNAME4: - case CAL_SSHORTESTDAYNAME5: - case CAL_SSHORTESTDAYNAME6: - case CAL_SSHORTESTDAYNAME7: - // Special cases for older locales with names that can't be truncated - - // Arabic - if (((lcid & 0x3ff) == 0x01) && (Calendar == CAL_GREGORIAN || Calendar == CAL_HIJRI || Calendar == CAL_UMALQURA)) - pDays = arabicSuperShortDayNames; - - // Chinese - if (((lcid & 0x3ff) == 0x04) && (Calendar == CAL_GREGORIAN || Calendar == CAL_TAIWAN)) - pDays = chineseSuperShortDayNames; - - // Hebrew - if (((lcid & 0x3ff) == 0x0d) && (Calendar == CAL_GREGORIAN || Calendar == CAL_HEBREW)) - pDays = hebrewSuperShortDayNames; - - // Mongolian - if ((lcid & 0x3ff) == 0x50) pDays = mongolianSuperShortDayNames; - - if (pDays) - { - // If we have a special case string then use that - pUseString = pDays[CalType - CAL_SSHORTESTDAYNAME1]; - } - else - { - // If lpCalData is null they just want the size - // NOTE: We actually always know the size so we never ask. - if (lpCalData == NULL) - { - ret = 5; - } - else - { - ret = NewApis::GetCalendarInfoEx(lpLocaleName, Calendar, pReserved, CAL_SABBREVDAYNAME1 + (CalType - CAL_SSHORTESTDAYNAME1), lpCalData, cchData, lpValue); - if (ret > 0) - { - if (ret > 3) - { - // Just get the first two character, and NULL-terminate it. - PREFIX_ASSUME(3 < cchData); // we can assume this; otherwise call would have failed - lpCalData[3] = W('\0'); - ret = 3; - } - } - } - - // Done - return ret; - } - break; - default: - // - // Not a CALTYPE that this function provides. Just returns 0. - // - return 0; - break; - } - - // If we have a special case string, copy to the output & return - ret = (int)(wcslen(pUseString) + 1); - if (lpCalData && cchData >= ret) - { - // If they wanted string (not just count), then return it - memcpy(lpCalData, pUseString, ret * sizeof(WCHAR)); - } - - return ret; - } - - // Handle the to titlecaseflag - int LCMapStringEx(__in LPCWSTR lpLocaleName, - __in DWORD dwMapFlags, - __in_ecount(cchSrc) LPCWSTR lpSrcStr, - __in int cchSrc, - __out_ecount_opt(cchDest) LPWSTR lpDestStr, - __in int cchDest, - __in_opt LPNLSVERSIONINFO lpVersionInformation, - __in_opt LPVOID lpReserved, - __in_opt LPARAM lParam) - { - // We only know about the title case flag... - if (dwMapFlags != LCMAP_TITLECASE) - { - return 0; - } - - // Should be unused, we'll just workaround it to upper case in case there's a real problem - // Just call NewAPIs with the upper case flag - return NewApis::LCMapStringEx(lpLocaleName, LCMAP_UPPERCASE, lpSrcStr, cchSrc, - lpDestStr, cchDest, - lpVersionInformation, lpReserved, lParam); - } - - } - - static int __cdecl compareLcidToLCIDEntry ( const void *key, const void *value) - { - LCID lcid=*((LCID*)key); - LCIDEntry* entry=(LCIDEntry*)value; - return lcid-entry->lcid; - } - - int LCIDToLocaleName(__in LCID Locale, __out_ecount_opt(cchName) LPWSTR lpName, __in int cchName, __in DWORD dwFlags) - { - _ASSERTE((lpName == NULL && cchName == 0) || (lpName != NULL && cchName > 0)); - if (Locale==LOCALE_INVARIANT) - { - if (lpName != NULL) - { - *lpName=0; - } - return 1; - } - - LCIDEntry* entry=(LCIDEntry*)bsearch(&Locale,s_lcids,NumItems(s_lcids),sizeof(*s_lcids),compareLcidToLCIDEntry); - - if (entry == NULL) - { - //_ASSERTE(entry); - return 0; - } - - int length = 0; - if (cchName > 0) - { - PREFIX_ASSUME(lpName != NULL); // checked above, but prefix can't figure it out - wcscpy_s(lpName,cchName,entry->wszName); - length = (int)wcslen(entry->wszName) + 1; - } - return length; - } - - LCID LocaleNameToLCID(__in LPCWSTR lpName, __in DWORD dwFlags) - { - if (lpName == NULL || *lpName==0) - { - return LOCALE_INVARIANT; - } - - // Try the last one first, just in case - static int cachedEntry = 0; - PREFIX_ASSUME(cachedEntry < NumItems(s_names)); - - int test = VolatileLoad(&cachedEntry); - if (_wcsicmp(lpName, s_names[test].wszName) == 0) - { - _ASSERTE(s_names[test].lcid != 0); - return s_names[test].lcid; - } - - // Just do a binary lookup for the name - int iBottom =0; - int iTop = NumItems(s_names) - 1; - - while (iBottom <= iTop) - { - int iMiddle = (iBottom + iTop) / 2; - int result = _wcsicmp(lpName, s_names[iMiddle].wszName); - if (result == 0) - { - _ASSERTE(s_names[iMiddle].lcid != 0); - cachedEntry = iMiddle; - return s_names[iMiddle].lcid; - } - if (result < 0) - { - // pLocaleName was < s_names[iMiddle] - iTop = iMiddle - 1; - } - else - { - // pLocaleName was > s_names[iMiddle] - iBottom = iMiddle + 1; - } - } - - // Failed, return 0 - return 0; - } - - // Fallback for pre windows 7 machines - int ResolveLocaleName(__in LPCWSTR lpNameToResolve, __in_ecount_opt(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName) - { - PWSTR pSpecific = NULL; - int retVal = 0; - - // Doesn't matter for mac, for windows map the name to LCID, then ask for LOCALE_ILANGUAGE to map the - // LCID to a specific (legacy GetLocaleInfo behavior), then map the LCID to a name - LCID lcid = LocaleNameToLCID(lpNameToResolve, 0); - DWORD specific; - - // Some neutrals have specific values that downlevel OS's can't provide easily: - retVal = 2; - switch (lcid) - { - case 0x0004: specific = 0x0804; break; // zh-Hans::zh-CN::0804 - case 0x000a: specific = 0x0c0a; break; // es::es-ES::0c0a - case 0x003c: specific = 0x083c; break; // ga::ga-IE::083c - case 0x005d: specific = 0x085d; break; // iu::iu-Latn-CA:085d - case 0x005f: specific = 0x085f; break; // tzm::tzm-Latn-DZ:085f - case 0x703b: specific = 0x243b; break; // smn::smn-FI::243b - case 0x743b: specific = 0x203b; break; // sms::sms-FI::203b - case 0x7804: specific = 0x0804; break; // zh::zh-CN::0804 - case 0x7814: specific = 0x0814; break; // nn::nn-NO::0814 - case 0x781a: specific = 0x141a; break; // bs::bs-Latn-BA:141a - case 0x783b: specific = 0x1c3b; break; // sma::sma-SE::1c3b - case 0x7c04: specific = 0x0c04; break; // zh-Hant::zh-HK::0c04 - case 0x7c1a: specific = 0x081a; break; // sr::sr-Latn-CS:081a (this changes in win7) - case 0x7c2e: specific = 0x082e; break; // dsb::dsb-DE::082e - case 0x7c3b: specific = 0x143b; break; // smj::smj-SE::143b - default: - // Note this won't call our Downlevel API with the undesired LOCALE_ILANGUAGE - retVal = GetLocaleInfoW(lcid, LOCALE_ILANGUAGE | LOCALE_RETURN_NUMBER, (LPWSTR)&specific, sizeof(specific)/sizeof(WCHAR)); - break; - } - - if (retVal > 0) - { - retVal = LCIDToLocaleName(specific, lpLocaleName, cchLocaleName, 0); - if (retVal > 0) - return retVal; - } - - // If we didn't have a specific, then use the locale name passed in - if (!pSpecific) - { - pSpecific = (PWSTR)lpNameToResolve; - } - - // Copy our string to the output & return - int size = (int)(wcslen(pSpecific) + 1); - if (size > cchLocaleName) return 0; - memcpy(lpLocaleName, pSpecific, size * sizeof(WCHAR)); - return size; - } - - - BOOL GetThreadPreferredUILanguages(__in DWORD dwFlags, - __out PULONG pulNumLanguages, - __out_ecount_opt(*pcchLanguagesBuffer) PWSTR pwszLanguagesBuffer, - __inout PULONG pcchLanguagesBuffer) - { - const WCHAR str[]=W("\0"); - ULONG nBufSize=*pcchLanguagesBuffer; - *pcchLanguagesBuffer=NumItems(str); - - if (nBufSize == 0 && pwszLanguagesBuffer == NULL) - { - return TRUE; - } - - if(nBufSize<NumItems(str)) - { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; - } - *pulNumLanguages=0; - memcpy(pwszLanguagesBuffer,str,sizeof(str)); - return TRUE; - - } - -} -#endif // ENABLE_DOWNLEVEL_FOR_NLS - - diff --git a/src/utilcode/newapis.cpp b/src/utilcode/newapis.cpp deleted file mode 100644 index 9815b6d9d1..0000000000 --- a/src/utilcode/newapis.cpp +++ /dev/null @@ -1,1401 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. -//////////////////////////////////////////////////////////////////////////// -// -// File: newapis.cpp -// - - -// Purpose: functions that need to be emulated on downlevel platforms. -// -//////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -#include "newapis.h" -#ifdef ENABLE_DOWNLEVEL_FOR_NLS -#include "downlevel.h" -#endif - -#include "utilcode.h" - -namespace NewApis -{ - - -#if defined(ENABLE_DOWNLEVEL_FOR_NLS) - - FARPROC GetProcAddressForLocaleApi(__in LPCSTR lpProcName, __in_opt FARPROC pFnDownlevelFallback) - { - _ASSERTE(lpProcName != NULL); - - FARPROC result = NULL; - - - // next try the kernel - if(result==NULL) - { - HMODULE hMod=WszGetModuleHandle(WINDOWS_KERNEL32_DLLNAME_W); - if(hMod!=NULL) - { - result=GetProcAddress(hMod,lpProcName); - } - } - - // failing all that, use the fallback provided - if(result==NULL) - { - result = pFnDownlevelFallback; - } - - return result; - } - -#endif // ENABLE_DOWNLEVEL_FOR_NLS - - __success(return > 0) int - GetSystemDefaultLocaleName(__out_ecount(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName) - { -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - return ::GetSystemDefaultLocaleName(lpLocaleName, cchLocaleName); -#else - typedef int (WINAPI *PFNGetSystemDefaultLocaleName)(LPWSTR, int); - static PFNGetSystemDefaultLocaleName pFNGetSystemDefaultLocaleName=NULL; - if (pFNGetSystemDefaultLocaleName == NULL) - { - HMODULE hMod=WszGetModuleHandle(WINDOWS_KERNEL32_DLLNAME_W); - // TODO: NLS Arrowhead - We should always fallback to the Downlevel APIs if the kernel APIs aren't found, - // regardless of error reason - if(hMod==NULL) - return 0; - pFNGetSystemDefaultLocaleName=(PFNGetSystemDefaultLocaleName)GetProcAddress(hMod,"GetSystemDefaultLocaleName"); - if(pFNGetSystemDefaultLocaleName==NULL) - { - if(GetLastError() == ERROR_PROC_NOT_FOUND) - pFNGetSystemDefaultLocaleName=DownLevel::GetSystemDefaultLocaleName; - else - return 0; - } - } - -#ifdef _PREFAST_ -#pragma warning(push) -#pragma warning(disable: 26036) // Prefast - Possible postcondition violation due to failure to null terminate string -#endif // _PREFAST_ - return pFNGetSystemDefaultLocaleName(lpLocaleName,cchLocaleName); -#ifdef _PREFAST_ -#pragma warning(pop) -#endif - -#endif - }; - - __success(return == TRUE) BOOL - GetUserPreferredUILanguages (__in DWORD dwFlags, __out PULONG pulNumLanguages, __out_ecount_opt(*pcchLanguagesBuffer) PWSTR pwszLanguagesBuffer, __in PULONG pcchLanguagesBuffer) - { -#ifdef ENABLE_DOWNLEVEL_FOR_NLS - typedef DWORD (WINAPI *PFNGetUserPreferredUILanguages)(ULONG, PULONG, LPWSTR, PULONG); - static PFNGetUserPreferredUILanguages pFNGetUserPreferredUILanguages=NULL; - if (pFNGetUserPreferredUILanguages == NULL) - { - HMODULE hMod=WszGetModuleHandle(WINDOWS_KERNEL32_DLLNAME_W); - if(hMod==NULL) - return FALSE; - pFNGetUserPreferredUILanguages=(PFNGetUserPreferredUILanguages)GetProcAddress(hMod,"GetUserPreferredUILanguages"); - if(pFNGetUserPreferredUILanguages==NULL) - { - if(GetLastError() == ERROR_PROC_NOT_FOUND) - pFNGetUserPreferredUILanguages=DownLevel::GetUserPreferredUILanguages; - else - return FALSE; - } - } - -#ifdef _PREFAST_ -#pragma warning(push) -#pragma warning(disable: 26036) // Prefast - Possible postcondition violation due to failure to null terminate string -#endif // _PREFAST_ - BOOL res = pFNGetUserPreferredUILanguages(dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer); - if(res == TRUE) - return res; - - //fallback to thread preferred langs - return GetThreadPreferredUILanguages(dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer); -#ifdef _PREFAST_ -#pragma warning(pop) -#endif - -#else - return ::GetUserPreferredUILanguages(dwFlags, pulNumLanguages, pwszLanguagesBuffer, pcchLanguagesBuffer); -#endif - }; - - - - __success(return != 0) int - GetUserDefaultLocaleName(__out_ecount(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName) - { -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - return ::GetUserDefaultLocaleName(lpLocaleName, cchLocaleName); -#else - typedef int (WINAPI *PFNGetUserDefaultLocaleName)(LPWSTR, int); - static PFNGetUserDefaultLocaleName pFNGetUserDefaultLocaleName=NULL; - if (pFNGetUserDefaultLocaleName == NULL) - { - HMODULE hMod=WszGetModuleHandle(WINDOWS_KERNEL32_DLLNAME_W); - if(hMod==NULL) - return 0; - pFNGetUserDefaultLocaleName=(PFNGetUserDefaultLocaleName)GetProcAddress(hMod,"GetUserDefaultLocaleName"); - if(pFNGetUserDefaultLocaleName==NULL) - { - if(GetLastError() == ERROR_PROC_NOT_FOUND) - pFNGetUserDefaultLocaleName=DownLevel::GetUserDefaultLocaleName; - else - return 0; - } - } - -#ifdef _PREFAST_ -#pragma warning(push) -#pragma warning(disable: 26036) // Prefast - Possible postcondition violation due to failure to null terminate string -#endif // _PREFAST_ - return pFNGetUserDefaultLocaleName(lpLocaleName,cchLocaleName); -#ifdef _PREFAST_ -#pragma warning(pop) -#endif - -#endif - } - - // Call GetLocaleInfoEx and see if the OS knows about it. - // Note that GetLocaleInfoEx has variations: - // * Pre-Vista it fails and has to go downlevel - // * Vista succeeds, but not for neutrals - // * Win7 succeeds for all locales. - // * Mac does ??? - // - // The caller is expected to call with a specific locale (non-neutral) on Windows < windows 7, - // except for LOCALE_INEUTRAL and LOCALE_SPARENT, which downlevel.cpp handles - // - __success(return != 0) int - GetLocaleInfoEx (__in LPCWSTR lpLocaleName, __in LCTYPE LCType, __out_ecount_opt(cchData) LPWSTR lpLCData, __in int cchData) - { - _ASSERTE((lpLCData == NULL && cchData == 0) || (lpLCData != NULL && cchData > 0)); - _ASSERTE(LCType == LOCALE_SNAME || NotLeakingFrameworkOnlyCultures(lpLocaleName)); - int retVal; - -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - retVal = ::GetLocaleInfoEx(lpLocaleName, LCType, lpLCData, cchData); -#else - typedef int (WINAPI *PFNGetLocaleInfoEx)(LPCWSTR, LCTYPE, LPWSTR, int); - static PFNGetLocaleInfoEx pFNGetLocaleInfoEx=NULL; - if (pFNGetLocaleInfoEx== NULL) - { - pFNGetLocaleInfoEx=(PFNGetLocaleInfoEx)GetProcAddressForLocaleApi( - "GetLocaleInfoEx", - (FARPROC)DownLevel::GetLocaleInfoEx); - } - retVal = pFNGetLocaleInfoEx(lpLocaleName,LCType,lpLCData,cchData); - - // Do fallback if we didn't find anything yet - if (retVal == 0) - retVal = DownLevel::UplevelFallback::GetLocaleInfoEx(lpLocaleName,0,LCType,lpLCData,cchData); -#endif - -#ifdef _PREFAST_ -#pragma warning(push) -#pragma warning(disable: 26036) // Prefast - Possible postcondition violation due to failure to null terminate string -#endif // _PREFAST_ - return retVal; -#ifdef _PREFAST_ -#pragma warning(pop) -#endif - - } - - __success(return != 0) int - GetDateFormatEx(__in LPCWSTR lpLocaleName, __in DWORD dwFlags, __in_opt CONST SYSTEMTIME* lpDate, __in_opt LPCWSTR lpFormat, - __out_ecount(cchDate) LPWSTR lpDateStr, __in int cchDate, __in_opt LPCWSTR lpCalendar) - { - _ASSERTE(NotLeakingFrameworkOnlyCultures(lpLocaleName)); -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - return ::GetDateFormatEx(lpLocaleName, dwFlags, lpDate, lpFormat, lpDateStr, cchDate, lpCalendar); -#else - typedef int (WINAPI *PFNGetDateFormatEx)(LPCWSTR, DWORD, CONST SYSTEMTIME*, LPCWSTR, LPWSTR,int, LPCWSTR); - static PFNGetDateFormatEx pFNGetDateFormatEx=NULL; - if (pFNGetDateFormatEx== NULL) - { - HMODULE hMod=WszGetModuleHandle(WINDOWS_KERNEL32_DLLNAME_W); - if(hMod==NULL) - return 0; - pFNGetDateFormatEx=(PFNGetDateFormatEx)GetProcAddress(hMod,"GetDateFormatEx"); - if(pFNGetDateFormatEx==NULL) - { - if(GetLastError() == ERROR_PROC_NOT_FOUND) - pFNGetDateFormatEx=DownLevel::GetDateFormatEx; - else - return 0; - } - } - -#ifdef _PREFAST_ -#pragma warning(push) -#pragma warning(disable: 26036) // Prefast - Possible postcondition violation due to failure to null terminate string -#endif // _PREFAST_ - return pFNGetDateFormatEx(lpLocaleName,dwFlags,lpDate,lpFormat,lpDateStr,cchDate,lpCalendar); -#ifdef _PREFAST_ -#pragma warning(pop) -#endif - -#endif - } - -#if defined(ENABLE_DOWNLEVEL_FOR_NLS) - static BOOL AvoidVistaTurkishBug = FALSE; - - __success(return != NULL) - inline - FARPROC GetSystemProcAddressForSortingApi( - __in LPCSTR lpProcName, - __in_opt FARPROC pFnDownlevelFallback) - { - _ASSERTE(lpProcName != NULL); - - FARPROC result = NULL; - - // try the kernel - HMODULE hMod=WszGetModuleHandle(WINDOWS_KERNEL32_DLLNAME_W); - if(hMod!=NULL) - { - result=GetProcAddress(hMod,lpProcName); - } - - if (IsVistaPlatform()) AvoidVistaTurkishBug = TRUE; - - // failing all that, use the fallback provided - if(result==NULL) - { - result = pFnDownlevelFallback; - } - - return result; - } - - __success(return != NULL) - FARPROC GetProcAddressForSortingApi( - __in LPCSTR lpProcName, - __in FARPROC lpSortDllProcedure, - __in_opt FARPROC pFnDownlevelFallback, - __in_opt CONST NLSVERSIONINFO * lpVersionInformation) - { - _ASSERTE(lpProcName != NULL); - _ASSERTE(lpSortDllProcedure != NULL); - - FARPROC result = NULL; - - // Below windows 8 we have to try the sorting dll - if (!RunningOnWin8() && SortVersioning::IsAvailableVersion(lpVersionInformation)) - { - result=lpSortDllProcedure; - } - - if(result == NULL) - { - result = GetSystemProcAddressForSortingApi(lpProcName, pFnDownlevelFallback); - } - return result; - } -#endif // ENABLE_DOWNLEVEL_FOR_NLS - - -#if defined(ENABLE_DOWNLEVEL_FOR_NLS) - // - // Vista handle tr-TR and az-Latn-AZ incorrectly with the sorting APIs that takes locale names - // work around the problem by using the sorting name instead. - // - - LPWSTR GetLingusticLocaleName(__in LPWSTR pLocaleName, __in DWORD dwFlags) - { - _ASSERTE(IsVistaPlatform()); - - // If the localeName is NULL, then we are using an OS SortHandle and don't need to fix up - // anything. - if (pLocaleName == NULL) - { - return pLocaleName; - } - - if ((dwFlags & CASING_BITS)) - { - if (_wcsicmp(pLocaleName, TURKISH_LOCALE_NAME) == 0) - return TURKISH_SORTING_LOCALE_NAME; - - if (_wcsicmp(pLocaleName, AZERBAIJAN_LOCALE_NAME) == 0) - return AZERBAIJAN_SORTING_LOCALE_NAME; - } - return pLocaleName; - } -#endif - - // - // NOTE: We assume that we're only being called from the BCL with an explicit locale name, so we don't - // support the system/user default tokens used in the OS. - // - // Additionally this is only called for casing and sort keys, other functionality isn't supported. - // - int CompareStringEx(__in LPCWSTR lpLocaleName, __in DWORD dwCmpFlags, __in_ecount(cchCount1) LPCWSTR lpString1, __in int cchCount1, __in_ecount(cchCount2) LPCWSTR lpString2, - __in int cchCount2, __in_opt LPNLSVERSIONINFO lpVersionInformation, __in_opt LPVOID lpReserved, __in_opt LPARAM lParam ) - { - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - SO_TOLERANT; - PRECONDITION((lParam == 0 && CheckPointer(lpLocaleName)) || (lParam != 0 && lpLocaleName == NULL)); - PRECONDITION(CheckPointer(lpString1)); - PRECONDITION(CheckPointer(lpString2)); - } CONTRACTL_END; - - _ASSERTE(lpLocaleName == NULL || NotLeakingFrameworkOnlyCultures(lpLocaleName)); -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - return::CompareStringEx(lpLocaleName, dwCmpFlags, lpString1, cchCount1, lpString2, - cchCount2, lpVersionInformation, lpReserved, lParam ); -#else - typedef int (WINAPI *PFNCompareStringEx)(LPCWSTR, DWORD, LPCWSTR, int, LPCWSTR, int, LPNLSVERSIONINFO, LPVOID, LPARAM ); - static PFNCompareStringEx pFNCompareStringEx=NULL; - - // See if we loaded our pointer already - if (pFNCompareStringEx == NULL) - { - pFNCompareStringEx = (PFNCompareStringEx) GetProcAddressForSortingApi( - "CompareStringEx", - (FARPROC)SortVersioning::SortCompareString, - (FARPROC)DownLevel::CompareStringEx, - lpVersionInformation); - } - - // TODO: Remove this workaround after Vista SP2 &/or turkic CompareStringEx() gets fixed on Vista. - // If its Vista and we want a turkik sort, then call CompareStringW not CompareStringEx - LPCWSTR pLingLocaleName = AvoidVistaTurkishBug ? GetLingusticLocaleName((LPWSTR)lpLocaleName, dwCmpFlags) : lpLocaleName; - // TODO: End of workaround for turkish CompareStringEx() on Vista/Win2K8 - - return pFNCompareStringEx(pLingLocaleName, dwCmpFlags, lpString1, cchCount1, lpString2, - cchCount2, lpVersionInformation, lpReserved, lParam ); -#endif - } - - // Note that unlike the real version we always expect our callers to pass counted strings - // I don't think we can assert because I think it'd call this code again - int CompareStringOrdinal(__in_ecount(cchCount1) LPCWSTR lpString1, __in int cchCount1, __in_ecount(cchCount2) LPCWSTR lpString2, __in int cchCount2, __in BOOL bIgnoreCase) - { -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - return ::CompareStringOrdinal(lpString1, cchCount1, lpString2, cchCount2, bIgnoreCase); -#else - typedef int (WINAPI *PFNCompareStringOrdinal )(LPCWSTR, int, LPCWSTR, int, BOOL ); - static PFNCompareStringOrdinal pFNCompareStringOrdinal=NULL; - if (pFNCompareStringOrdinal == NULL) - { - HMODULE hMod=WszGetModuleHandle(WINDOWS_KERNEL32_DLLNAME_W); - if(hMod != NULL) - { - // Grab the OS proc if its there - pFNCompareStringOrdinal=(PFNCompareStringOrdinal)GetProcAddress(hMod, "CompareStringOrdinal"); - } - if (pFNCompareStringOrdinal == NULL) - { - // Regardless of the reason why, if we can't find the API just use the downlevel version - pFNCompareStringOrdinal=DownLevel::CompareStringOrdinal; - } - } - return pFNCompareStringOrdinal(lpString1, cchCount1, lpString2, cchCount2, bIgnoreCase); -#endif - } - -// The invariant locale should always match the system for -// upper and lower casing -inline BOOL IsInvariantCasing(__in LPCWSTR lpLocaleName, __in DWORD dwMapFlags) -{ - _ASSERTE(lpLocaleName); - - if(lpLocaleName[0] == NULL) - { - if(dwMapFlags & (LCMAP_UPPERCASE | LCMAP_LOWERCASE)) - { - return TRUE; - } - } - return FALSE; -} - - // - // NOTE: We assume that we're only being called from the BCL with an explicit locale name, so we don't - // support the system/user default tokens used in the OS. - // - // Additionally this is only called for casing and sort keys, other functionality isn't supported. - // - __success(return != 0) - int LCMapStringEx (__in LPCWSTR lpLocaleName, __in DWORD dwMapFlags, __in_ecount(cchSrc) LPCWSTR lpSrcStr, __in int cchSrc, - __out_xcount_opt(cchDest) LPWSTR lpDestStr, __in int cchDest, __in_opt LPNLSVERSIONINFO lpVersionInformation, __in_opt LPVOID lpReserved, __in_opt LPARAM lParam ) - { - int retVal = 0; - // Note: We should only be calling this for casing or sort keys - _ASSERTE((dwMapFlags & (LCMAP_UPPERCASE | LCMAP_LOWERCASE | LCMAP_TITLECASE | LCMAP_SORTKEY | (RunningOnWin8() ? (LCMAP_SORTHANDLE | LCMAP_HASH) : 0))) != 0); - - // Need to have a name or sort node - _ASSERTE(lpLocaleName == NULL && lParam != 0 || lParam == 0 && lpLocaleName != NULL); - - _ASSERTE(lpLocaleName == NULL || NotLeakingFrameworkOnlyCultures(lpLocaleName)); - - // Can't use the system token, which starts with an illegal ! - _ASSERTE(lpLocaleName == NULL || lpLocaleName[0] != W('!')); - -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - retVal = ::LCMapStringEx (lpLocaleName, dwMapFlags, lpSrcStr, cchSrc, - lpDestStr, cchDest, lpVersionInformation, lpReserved, lParam ); -#else - typedef int (WINAPI *PFNLCMapStringEx )(LPCWSTR, DWORD, LPCWSTR, int, LPWSTR, int, LPNLSVERSIONINFO, LPVOID, LPARAM); - - PFNLCMapStringEx pLcMapStringEx; - LPCWSTR pLingLocaleName; - if(lpLocaleName == NULL || IsInvariantCasing(lpLocaleName, dwMapFlags)){ - static PFNLCMapStringEx pFNSystemLCMapStringEx=NULL; - if (pFNSystemLCMapStringEx == NULL) - { - pFNSystemLCMapStringEx = (PFNLCMapStringEx) GetSystemProcAddressForSortingApi( - "LCMapStringEx", - (FARPROC)DownLevel::LCMapStringEx); - } - pLcMapStringEx = pFNSystemLCMapStringEx; - pLingLocaleName = lpLocaleName; - } - else - { - static PFNLCMapStringEx pFNLCMapStringEx=NULL; - // See if we still need to find which function to use - if (pFNLCMapStringEx == NULL) - { - pFNLCMapStringEx = (PFNLCMapStringEx) GetProcAddressForSortingApi( - "LCMapStringEx", - (FARPROC)SortVersioning::LCMapStringEx, - (FARPROC)DownLevel::LCMapStringEx, - lpVersionInformation); - } - pLcMapStringEx = pFNLCMapStringEx; - - // TODO: Remove this workaround after Vista SP2 &/or turkic CompareStringEx() gets fixed on Vista. - // If its Vista and we want a turkik sort, then call CompareStringW not CompareStringEx - pLingLocaleName = AvoidVistaTurkishBug ? GetLingusticLocaleName((LPWSTR)lpLocaleName, dwMapFlags) : lpLocaleName; - // TODO: End of workaround for turkish CompareStringEx() on Vista/Win2K8 - } - - retVal = pLcMapStringEx(pLingLocaleName, dwMapFlags, lpSrcStr, cchSrc, - lpDestStr, cchDest, lpVersionInformation, lpReserved, lParam); - if (retVal == 0) - retVal = DownLevel::UplevelFallback::LCMapStringEx(lpLocaleName, dwMapFlags, lpSrcStr, cchSrc, - lpDestStr, cchDest, lpVersionInformation, lpReserved, lParam); -#endif - -#ifdef _PREFAST_ -#pragma warning(push) -#pragma warning(disable: 26036) // Prefast - Possible postcondition violation due to failure to null terminate string -#endif // _PREFAST_ - return retVal; -#ifdef _PREFAST_ -#pragma warning(pop) -#endif - } - - __inline BOOL IsLowerAsciiString(__in_ecount(cchCount) LPCWSTR lpString, __in int cchCount) - { - int count = cchCount; - LPCWSTR pStr = lpString; - __range(0,10) int cch; - int value = 0; - - while (count > 0) - { - cch = min(count, 10); - switch (cch) - { - -#ifdef _PREFAST_ -#pragma warning(push) -#pragma warning(disable: 26010) // Prefast - Potential read overflow of null terminated buffer using expression 'pStr[9]' -#endif // _PREFAST_ - case 10: value |= (int) pStr[9]; __fallthrough; // fall through -#ifdef _PREFAST_ -#pragma warning(pop) -#endif - case 9: value |= (int) pStr[8]; __fallthrough; // fall through - case 8: value |= (int) pStr[7]; __fallthrough; // fall through - case 7: value |= (int) pStr[6]; __fallthrough; // fall through - case 6: value |= (int) pStr[5]; __fallthrough; // fall through - case 5: value |= (int) pStr[4]; __fallthrough; // fall through - case 4: value |= (int) pStr[3]; __fallthrough; // fall through - case 3: value |= (int) pStr[2]; __fallthrough; // fall through - case 2: value |= (int) pStr[1]; __fallthrough; // fall through - case 1: value |= (int) pStr[0]; __fallthrough; // fall through - } - - if (value >= 0x80) - { - return FALSE; - } - - count -= cch; - pStr += cch; - } - - return TRUE; - } - - INT32 FastIndexOfString(__in_ecount(sourceLength) const WCHAR *source, __in INT32 sourceLength, __in_ecount(patternLength) const WCHAR *pattern, __in INT32 patternLength) - { - if (source == NULL || pattern == NULL || patternLength < 0 || sourceLength < 1) - { - return -1; - } - - INT32 startIndex = 0; - INT32 endIndex = sourceLength - 1; - - int endPattern = endIndex - patternLength + 1; - - if (endPattern<0) { - return -1; - } - - if (patternLength == 0) { - return startIndex; - } - - WCHAR patternChar0 = pattern[0]; - for (int ctrSrc = startIndex; ctrSrc<=endPattern; ctrSrc++) { - if (source[ctrSrc] != patternChar0) - continue; - int ctrPat; - for (ctrPat = 1; ctrPat < patternLength; ctrPat++) { - if (source[ctrSrc + ctrPat] != pattern[ctrPat]) break; - } - if (ctrPat == patternLength) { - return (ctrSrc); - } - } - - return (-1); - } - - INT32 FastIndexOfStringInsensitive(__in_ecount(sourceLength) const WCHAR *source, __in INT32 sourceLength, __in_ecount(patternLength) const WCHAR *pattern, __in INT32 patternLength) - { - if (source == NULL || pattern == NULL || patternLength < 0 || sourceLength < 1) - { - return -1; - } - - INT32 startIndex = 0; - INT32 endIndex = sourceLength - 1; - - WCHAR srcChar; - WCHAR patChar; - - int endPattern = endIndex - patternLength + 1; - - if (endPattern<0) { - return -1; - } - - if (patternLength == 0) { - return startIndex; - } - - WCHAR pattern0 = pattern[0]; - if (pattern0>='A' && pattern0<='Z') { - pattern0|=0x20; - } - - for (int ctrSrc = startIndex; ctrSrc<=endPattern; ctrSrc++) { - srcChar = source[ctrSrc]; - if (srcChar>='A' && srcChar<='Z') { - srcChar|=0x20; - } - if (srcChar != pattern0) - continue; - - int ctrPat; - for (ctrPat = 1; (ctrPat < patternLength); ctrPat++) { - srcChar = source[ctrSrc + ctrPat]; - if (srcChar>='A' && srcChar<='Z') { - srcChar|=0x20; - } - patChar = pattern[ctrPat]; - if (patChar>='A' && patChar<='Z') { - patChar|=0x20; - } - if (srcChar!=patChar) { - break; - } - } - - if (ctrPat == patternLength) { - return (ctrSrc); - } - } - - return (-1); - } - - // Works backwards, starting at startIndex and ending at endIndex - INT32 FastLastIndexOfString(__in_ecount(sourceLength) const WCHAR *source, __in INT32 sourceLength, __in_ecount(patternLength) const WCHAR *pattern, __in INT32 patternLength) - { - if (source == NULL || pattern == NULL || patternLength < 0 || sourceLength < 1) - { - return -1; - } - - INT32 startIndex = sourceLength - 1; - INT32 endIndex = 0; - - //startIndex is the greatest index into the string. - int startPattern = startIndex - patternLength + 1; - - if (startPattern < 0) { - return (-1); - } - - if (patternLength == 0) { - return startIndex; - } - - WCHAR patternChar0 = pattern[0]; - for (int ctrSrc = startPattern; ctrSrc >= endIndex; ctrSrc--) { - if (source[ctrSrc] != patternChar0) - continue; - int ctrPat; - for (ctrPat = 1; ctrPat<patternLength; ctrPat++) { - if (source[ctrSrc+ctrPat] != pattern[ctrPat]) break; - } - if (ctrPat == patternLength) { - return (ctrSrc); - } - } - - return (-1); - } - - // Works backwards, starting at startIndex and ending at endIndex - INT32 FastLastIndexOfStringInsensitive(__in_ecount(sourceLength) const WCHAR *source, __in INT32 sourceLength, __in_ecount(patternLength) const WCHAR *pattern, __in INT32 patternLength) - { - if (source == NULL || pattern == NULL || patternLength < 0 || sourceLength < 1) - { - return -1; - } - - INT32 startIndex = sourceLength - 1; - INT32 endIndex = 0; - - //startIndex is the greatest index into the string. - int startPattern = startIndex - patternLength + 1; - - if (startPattern < 0) { - return (-1); - } - - if (patternLength == 0) { - return startIndex; - } - - WCHAR srcChar; - WCHAR patChar; - WCHAR pattern0 = pattern[0]; - if (pattern0>='A' && pattern0<='Z') { - pattern0|=0x20; - } - - - for (int ctrSrc = startPattern; ctrSrc >= endIndex; ctrSrc--) { - srcChar = source[ctrSrc]; - if (srcChar>='A' && srcChar<='Z') { - srcChar|=0x20; - } - if (srcChar != pattern0) - continue; - - int ctrPat; - for (ctrPat = 1; ctrPat<patternLength; ctrPat++) { - srcChar = source[ctrSrc+ctrPat]; - if (srcChar>='A' && srcChar<='Z') { - srcChar|=0x20; - } - patChar = pattern[ctrPat]; - if (patChar>='A' && patChar<='Z') { - patChar|=0x20; - } - if (srcChar!=patChar) { - break; - } - } - if (ctrPat == patternLength) { - return (ctrSrc); - } - } - - return (-1); - } - - //////////////////////////////////////////////////////////////////////////// - // - // IndexOfString - // - //////////////////////////////////////////////////////////////////////////// - int IndexOfString( __in LPCWSTR lpLocaleName, - __in_ecount(cchCount1) LPCWSTR pString1, // String to search in - __in int cchCount1, // length of pString1 - __in_ecount(cchCount2) LPCWSTR pString2, // String we're looking for - __in int cchCount2, // length of pString2 - __in DWORD dwFlags, // search flags - __in BOOL startWith, // true if we need to check for prefix case - __out_opt LPINT pcchFound) // length of the string we found in source - { - int iRetVal = -1; - int foundLengthInSource = 0; - - // - // Check the ranges. - // - if (cchCount1 == 0) - { - if (cchCount2 == 0) - iRetVal = 0; - // else iRetVal = -1 (not found) - goto lExit; - } - - // - // See if we have an empty string 2. - // - if (cchCount2 == 0) - { - iRetVal = 0; - goto lExit; - } - - // - // Search for the character in the string. - // - - if (dwFlags == COMPARE_OPTIONS_ORDINAL) - { - iRetVal = FastIndexOfString(pString1, cchCount1, pString2, cchCount2); - foundLengthInSource = cchCount2; - goto lExit; - } - //For dwFlags, 0 is the default, 1 is ignore case, we can handle both. - // TODO: NLS Arrowhead -This isn't really right, custom locales could start with en- and have different sort behavior - - if (((dwFlags & ~CASING_BITS) == 0) && IS_FAST_COMPARE_LOCALE(lpLocaleName)) - { - if (IsLowerAsciiString(pString1, cchCount1) && IsLowerAsciiString(pString2, cchCount2)) - { - if ((dwFlags & (LINGUISTIC_IGNORECASE | NORM_IGNORECASE)) == 0) - iRetVal = FastIndexOfString(pString1, cchCount1, pString2, cchCount2); - else - iRetVal = FastIndexOfStringInsensitive(pString1, cchCount1, pString2, cchCount2); - - // both are ascii strings, - // the length should be the same as the length of the string we are searching for. - foundLengthInSource = cchCount2; - - goto lExit; - } - } - - _ASSERTE(iRetVal==-1); - int result; - - // Some things to think about, depending on the options passed in: - // - // LINGUISTIC_IGNORECASE - Can't cause length changes since casing is always changing to the same length - // NORM_IGNORECASE - Can't cause length changes since casing is always changing to the same length - // NORM_LINGUISTIC_CASING - Can't cause length changes since casing is always changing to the same length - // NORM_IGNOREKANATYPE - A 1:1 mapping, so the lengths don't change - // NORM_IGNOREWIDTH - A 1:1 mapping (full & half width), so lengths don't change - // SORT_STRINGSORT - No impact on search size - special treatment for - and ' - // LINGUISTIC_IGNOREDIACRITIC - Terrible because both strings could be all diacritics, except for the last character. - // NORM_IGNORENONSPACE -Terrible because both strings could all be non-spacing characters, except for 1 somewhere. - // NORM_IGNORESYMBOLS - Terrible because both strings could be all symbols - // Compressions/Expansions - Either string may have compressions or expansions impacting the size needing searched - // for default table cultures (including invariant) there're only expansions, and those only expand 2X worst case. - - for (int iOffset=0; iRetVal == -1 && iOffset<cchCount1; iOffset++) - { - // Because of compressions/expansions/ignorable characters we can't just use the known length, but need to consider the entire remainder of the string. - // TODO: NLS: the nested loop is extremely slow. oledbtest.exe can't finish even overnight. (Doing invariant ignore case) - for (int iLength=1; iLength<=cchCount1 - iOffset; iLength++) - { - result = NewApis::CompareStringEx(lpLocaleName, dwFlags, pString2, cchCount2, &pString1[iOffset], iLength, NULL, NULL, 0); - if (result == CSTR_EQUAL) - { - iRetVal = iOffset; - foundLengthInSource = iLength; - break; - } - else if (result == 0) - { - // return value of 0 indicates failure and error value is supposed to be set. - // shouldn't ever really happen - _ASSERTE(!"catastrophic failure calling NewApis::CompareStringEx! This could be a CultureInfo, RegionInfo, or Calendar bug (bad localeName string) or maybe a GCHole."); - } - } - } - - lExit: - if (startWith && iRetVal != 0) - { - iRetVal = -1; - } - - if(iRetVal != -1 && pcchFound != NULL) - *pcchFound = foundLengthInSource; - - return iRetVal; - } - //////////////////////////////////////////////////////////////////////////// - // - // LastIndexOfString - // - //////////////////////////////////////////////////////////////////////////// - int LastIndexOfString( __in LPCWSTR lpLocaleName, - __in_ecount(cchCount1) LPCWSTR pString1, // String to search in - __in int cchCount1, // length of pString1 - __in_ecount(cchCount2) LPCWSTR pString2, // String we're looking for - __in int cchCount2, // length of pString2 - __in DWORD dwFlags, - __in BOOL endWith, // check suffix case - __out_opt LPINT pcchFound) // length of the string we found in source - { - INT32 iRetVal = -1; - BOOL comparedOrdinal = FALSE; - - int foundLengthInSource = 0; - - // Check for empty strings - if (cchCount1 == 0) - { - if (cchCount2 == 0) - iRetVal = 0; - // else iRetVal = -1 (not found) - goto lExit; - } - - // - // See if we have an empty string 2. - // - if (cchCount2 == 0) - { - iRetVal = 0; - goto lExit; - } - - // - // Search for the character in the string. - //<TODO> - // @ToDo: Should read the nls data tables directly to make this - // much faster and to handle composite characters. - //</TODO> - - if (dwFlags == COMPARE_OPTIONS_ORDINAL) - { - iRetVal = FastLastIndexOfString(pString1, cchCount1, pString2, cchCount2); - comparedOrdinal = TRUE; - foundLengthInSource = cchCount2; - goto lExit; - } - - //For dwFlags, 0 is the default, 1 is ignore case, we can handle both. - // TODO: NLS Arrowhead -This isn't really right, custom locales could start with en- and have different sort behavior - if (((dwFlags & ~CASING_BITS) == 0) && IS_FAST_COMPARE_LOCALE(lpLocaleName)) - { - if (IsLowerAsciiString(pString1, cchCount1) && IsLowerAsciiString(pString2, cchCount2)) - { - if ((dwFlags & (LINGUISTIC_IGNORECASE | NORM_IGNORECASE)) == 0) - iRetVal = FastLastIndexOfString(pString1, cchCount1, pString2, cchCount2); - else - iRetVal = FastLastIndexOfStringInsensitive(pString1, cchCount1, pString2, cchCount2); - comparedOrdinal = TRUE; - - foundLengthInSource = cchCount2; - goto lExit; - } - } - - _ASSERTE(iRetVal==-1); - // TODO: Cleanup like IndexOfString - for (int iOffset=0; iRetVal == -1 && iOffset>-cchCount1; iOffset--) - { - for (int iLength=1; iLength<=cchCount1 + iOffset; iLength++) - { - if (NewApis::CompareStringEx(lpLocaleName, dwFlags, pString2, cchCount2, &pString1[cchCount1 + iOffset - iLength], iLength, NULL, NULL, 0) == CSTR_EQUAL) - { - iRetVal= cchCount1 + iOffset - iLength; - foundLengthInSource = iLength; - break; - } - } - } - lExit: - - if (endWith && iRetVal>=0) - { - if (comparedOrdinal && (cchCount1 - iRetVal != cchCount2)) // optimize here to avoid calling CompareString - { - iRetVal = -1; - } - else if (NewApis::CompareStringEx(lpLocaleName, dwFlags, pString2, cchCount2, &pString1[iRetVal], cchCount1 - iRetVal, NULL, NULL, 0) != CSTR_EQUAL) - { - iRetVal = -1; - } - } - - if(iRetVal != -1 && pcchFound != NULL) - *pcchFound = foundLengthInSource; - - return iRetVal; - } - - // - // NOTE: We assume that we're only being called from the BCL with an explicit locale name, so we don't - // support the system/user default tokens used in the OS. - // - // Additionally this is only called for casing and sort keys, other functionality isn't supported. - // - int FindNLSStringEx(__in LPCWSTR lpLocaleName, - __in DWORD dwFindNLSStringFlags, - __in_ecount(cchSource) LPCWSTR lpStringSource, - __in int cchSource, - __in_ecount(cchValue) LPCWSTR lpStringValue, - __in int cchValue, - __out_opt LPINT pcchFound, - __in_opt LPNLSVERSIONINFO lpVersionInformation, - __in_opt LPVOID lpReserved, - __in_opt LPARAM lParam) - { - _ASSERTE(lpLocaleName == NULL || NotLeakingFrameworkOnlyCultures(lpLocaleName)); -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - return ::FindNLSStringEx(lpLocaleName, dwFindNLSStringFlags, lpStringSource, cchSource, lpStringValue, cchValue, pcchFound, - lpVersionInformation, lpReserved, lParam ); -#else - typedef int (WINAPI *PFNFindNLSStringEx )(LPCWSTR, DWORD, LPCWSTR, int, LPCWSTR, int, LPINT, LPNLSVERSIONINFOEX, LPVOID, LPARAM ); - static PFNFindNLSStringEx pFNFindNLSStringEx=NULL; - - // See if we still need to figure out which function to call - if (pFNFindNLSStringEx == NULL) - { - pFNFindNLSStringEx = (PFNFindNLSStringEx) GetProcAddressForSortingApi( - "FindNLSStringEx", - (FARPROC)SortVersioning::SortFindString, - (FARPROC)DownLevel::FindNLSStringEx, - lpVersionInformation); - } - - // TODO: Remove this workaround after Vista SP2 &/or turkic CompareStringEx() gets fixed on Vista. - // If its Vista and we want a turkik sort, then call CompareStringW not CompareStringEx - LPCWSTR pLingLocaleName = AvoidVistaTurkishBug ? GetLingusticLocaleName((LPWSTR)lpLocaleName, dwFindNLSStringFlags) : lpLocaleName; - // TODO: End of workaround for turkish CompareStringEx() on Vista/Win2K8 - - int cchFound; // we need to get the length even if the caller doesn't care about it (see below) - int result = pFNFindNLSStringEx(pLingLocaleName, dwFindNLSStringFlags, lpStringSource, cchSource, lpStringValue, cchValue, &cchFound, - lpVersionInformation, lpReserved, lParam ); - // When searching from end with an empty pattern (either empty string or all ignored characters) - // a match is found (result != -1) - // Currently we get a result == 0 but we are hoping this will change - // with Win7 to be the length of the source string (thus pointing past-the-end) - // and the length of the match (cchFound) will be 0 - // For compatibility, we need to return the index of the last character (or 0 if the source is empty) - if((dwFindNLSStringFlags & FIND_FROMEND) && - result != -1 && - cchFound == 0 && - cchSource != 0) - { - result = cchSource - 1; - } - - // if the caller cares about the length, give it to them - if(pcchFound != NULL) - { - *pcchFound = cchFound; - } - - return result; -#endif - } - - __success(return != 0) int - GetCalendarInfoEx(__in LPCWSTR lpLocaleName, __in CALID Calendar, __in_opt LPCWSTR pReserved, __in CALTYPE CalType, __out_ecount_opt(cchData) LPWSTR lpCalData, __in int cchData, __out_opt LPDWORD lpValue ) - { - - _ASSERTE(NotLeakingFrameworkOnlyCultures(lpLocaleName)); - if ( (lpCalData != NULL && cchData == 0) || (lpCalData == NULL && cchData > 0) ) - { - _ASSERTE(FALSE); - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - if ((CalType & CAL_RETURN_NUMBER)) - { - // If CAL_RETURN_NUMBER, lpValue must be non-null and lpCalData must be null - if (lpValue == NULL || lpCalData != NULL) - { - _ASSERTE(FALSE); - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - } - - int retVal = 0; - -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - retVal = ::GetCalendarInfoEx(lpLocaleName, Calendar, pReserved, CalType, lpCalData, cchData, lpValue ); -#else - typedef int (WINAPI *PFNGetCalendarInfoEx )(LPCWSTR, CALID, LPCWSTR, CALTYPE, LPWSTR, int, LPDWORD ); - static PFNGetCalendarInfoEx pFNGetCalendarInfoEx=NULL; - if (pFNGetCalendarInfoEx== NULL) - { - pFNGetCalendarInfoEx=(PFNGetCalendarInfoEx)GetProcAddressForLocaleApi( - "GetCalendarInfoEx", - (FARPROC)DownLevel::GetCalendarInfoEx); - } - retVal = pFNGetCalendarInfoEx(lpLocaleName, Calendar, pReserved, CalType, lpCalData, cchData, lpValue ); - - // Do fallback if we didn't find anything yet - if (retVal == 0) - retVal = DownLevel::UplevelFallback::GetCalendarInfoEx(lpLocaleName, Calendar, pReserved, CalType, lpCalData, cchData, lpValue ); -#endif - -#ifdef _PREFAST_ -#pragma warning(push) -#pragma warning(disable: 26036) // Prefast - Possible postcondition violation due to failure to null terminate string -#endif // _PREFAST_ - return retVal; -#ifdef _PREFAST_ -#pragma warning(pop) -#endif - } - - __success(return != 0) - int LCIDToLocaleName(__in LCID Locale, __out_ecount_opt(cchName) LPWSTR lpName, __in int cchName, __in DWORD dwFlags) - { - int retVal = 0; - -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - retVal = ::LCIDToLocaleName(Locale, lpName, cchName, dwFlags | LOCALE_ALLOW_NEUTRAL_NAMES); -#else - - retVal = DownLevel::LCIDToLocaleName(Locale, lpName,cchName,dwFlags | LOCALE_ALLOW_NEUTRAL_NAMES); - - typedef int (WINAPI *PFNLCIDToLocaleName)(LCID, LPWSTR,int ,DWORD); - static PFNLCIDToLocaleName pFNLCIDToLocaleName=NULL; - if (retVal == 0) - { - if (pFNLCIDToLocaleName==NULL) - { - pFNLCIDToLocaleName=(PFNLCIDToLocaleName)GetProcAddressForLocaleApi( - "LCIDToLocaleName", - (FARPROC)DownLevel::LCIDToLocaleName); - - } - - // Try with the allow neutral flag (will fail in Vista, but - // Downlevel::LCIDToLocaleName knows all vista locales) - retVal = pFNLCIDToLocaleName(Locale, lpName, cchName, dwFlags | LOCALE_ALLOW_NEUTRAL_NAMES); - if(retVal == 0) - { - // in case we are using OS, it could have a problem with the above flag; retry without it - retVal = pFNLCIDToLocaleName(Locale, lpName, cchName, dwFlags); - } - } -#endif // ENABLE_DOWNLEVEL_FOR_NLS - -#ifdef _PREFAST_ -#pragma warning(push) -#pragma warning(disable: 26036) // Prefast - Possible postcondition violation due to failure to null terminate string -#endif // _PREFAST_ - return retVal; -#ifdef _PREFAST_ -#pragma warning(pop) -#endif - } - - LCID LocaleNameToLCID(__in_opt LPCWSTR lpName , __in DWORD dwFlags) - { - LCID retVal = 0; - -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - return ::LocaleNameToLCID(lpName, dwFlags | LOCALE_ALLOW_NEUTRAL_NAMES); -#else - retVal = DownLevel::LocaleNameToLCID(lpName, dwFlags | LOCALE_ALLOW_NEUTRAL_NAMES); - - typedef int (WINAPI *PFNLocaleNameToLCID)(LPCWSTR,DWORD); - static PFNLocaleNameToLCID pFNLocaleNameToLCID=NULL; - - if (retVal == 0) - { - if (pFNLocaleNameToLCID==NULL) - { - pFNLocaleNameToLCID=(PFNLocaleNameToLCID)GetProcAddressForLocaleApi( - "LocaleNameToLCID", - (FARPROC)DownLevel::LocaleNameToLCID); - - } - - // Try with the allow neutral flag (will fail in Vista, but - // Downlevel::LocaleNametoLCID knows all vista locales) - retVal = pFNLocaleNameToLCID(lpName, dwFlags | LOCALE_ALLOW_NEUTRAL_NAMES); - if(retVal == 0) - { - // in case we are using OS, it could have a problem with the above flag; retry without it - retVal = pFNLocaleNameToLCID(lpName, dwFlags); - } - } -#endif // ENABLE_DOWNLEVEL_FOR_NLS - - return retVal; - } - - __success(return != 0) BOOL - EnumDateFormatsExEx (DATEFMT_ENUMPROCEXEX lpDateFmtEnumProcExEx, LPCWSTR lpLocaleName, DWORD dwFlags, LPARAM lParam) - { - _ASSERTE(NotLeakingFrameworkOnlyCultures(lpLocaleName)); - int retVal = 0; -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - retVal = ::EnumDateFormatsExEx (lpDateFmtEnumProcExEx, lpLocaleName, dwFlags, lParam); -#else - typedef int (WINAPI *PFNEnumDateFormatsExEx)(DATEFMT_ENUMPROCEXEX, LPCWSTR, DWORD, LPARAM); - - static PFNEnumDateFormatsExEx pFNEnumDateFormatsExEx=NULL; - if (pFNEnumDateFormatsExEx==NULL) - { - pFNEnumDateFormatsExEx=(PFNEnumDateFormatsExEx)GetProcAddressForLocaleApi( - "EnumDateFormatsExEx", - (FARPROC)DownLevel::LegacyCallbacks::EnumDateFormatsExEx); - } - - retVal = pFNEnumDateFormatsExEx(lpDateFmtEnumProcExEx, lpLocaleName, dwFlags, lParam); - if (retVal == 0) - { - retVal = DownLevel::LegacyCallbacks::EnumDateFormatsExEx(lpDateFmtEnumProcExEx, lpLocaleName, dwFlags, lParam); - } -#endif - return retVal; - } - - __success(return != 0) - BOOL EnumTimeFormatsEx(TIMEFMT_ENUMPROCEX lpTimeFmtEnumProcEx, LPCWSTR lpLocaleName, DWORD dwFlags, LPARAM lParam) - { - _ASSERTE(NotLeakingFrameworkOnlyCultures(lpLocaleName)); - int retVal = 0; -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - retVal = ::EnumTimeFormatsEx(lpTimeFmtEnumProcEx, lpLocaleName, dwFlags, lParam); -#else - typedef int (WINAPI *PFNEnumTimeFormatsEx)(TIMEFMT_ENUMPROCEX, LPCWSTR, DWORD, LPARAM); - - static PFNEnumTimeFormatsEx pFNEnumTimeFormatsEx=NULL; - if (pFNEnumTimeFormatsEx==NULL) - { - pFNEnumTimeFormatsEx=(PFNEnumTimeFormatsEx)GetProcAddressForLocaleApi( - "EnumTimeFormatsEx", - (FARPROC)DownLevel::LegacyCallbacks::EnumTimeFormatsEx); - } - - retVal = pFNEnumTimeFormatsEx(lpTimeFmtEnumProcEx, lpLocaleName, dwFlags, lParam); - if (retVal == 0) - { - retVal = DownLevel::LegacyCallbacks::EnumTimeFormatsEx(lpTimeFmtEnumProcEx, lpLocaleName, dwFlags, lParam); - } -#endif - return retVal; - } - - __success(return != 0) - BOOL EnumCalendarInfoExEx(CALINFO_ENUMPROCEXEX pCalInfoEnumProcExEx, LPCWSTR lpLocaleName, CALID Calendar, CALTYPE CalType, LPARAM lParam) - { - _ASSERTE(NotLeakingFrameworkOnlyCultures(lpLocaleName)); - int retVal = 0; -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - retVal = ::EnumCalendarInfoExEx (pCalInfoEnumProcExEx, lpLocaleName, Calendar, NULL, CalType, lParam); -#else - typedef int (WINAPI *PFNEnumCalendarInfoExEx)(CALINFO_ENUMPROCEXEX, LPCWSTR, CALID, LPCWSTR, CALTYPE, LPARAM); - - static PFNEnumCalendarInfoExEx pFNEnumCalendarInfoExEx=NULL; - if (pFNEnumCalendarInfoExEx==NULL) - { - pFNEnumCalendarInfoExEx=(PFNEnumCalendarInfoExEx)GetProcAddressForLocaleApi( - "EnumCalendarInfoExEx", - (FARPROC)DownLevel::LegacyCallbacks::EnumCalendarInfoExEx); - } - - retVal = pFNEnumCalendarInfoExEx(pCalInfoEnumProcExEx, lpLocaleName, Calendar, NULL, CalType, lParam); - if (retVal == 0) - { - retVal = DownLevel::LegacyCallbacks::EnumCalendarInfoExEx(pCalInfoEnumProcExEx, lpLocaleName, Calendar, NULL, CalType, lParam); - } -#endif - - return retVal; - } - - // This function exists is in server 2003 and above - // Function should be COMPARE_STRING, dwFlags should be NULL, lpVersionInfo should be NULL for now - BOOL IsNLSDefinedString(__in NLS_FUNCTION Function, __in DWORD dwFlags, __in_opt LPNLSVERSIONINFOEX lpVersionInfo, __in LPCWSTR lpString, __in int cchStr ) - { -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - return ::IsNLSDefinedString(Function, dwFlags, lpVersionInfo, lpString, cchStr); -#else - typedef int (WINAPI *PFNIsNLSDefinedString)(NLS_FUNCTION, DWORD, LPNLSVERSIONINFO, LPCWSTR, int); - - static PFNIsNLSDefinedString pFNIsNLSDefinedString=NULL; - - // See if we still need to find our function - if (pFNIsNLSDefinedString== NULL) - { - pFNIsNLSDefinedString = (PFNIsNLSDefinedString) GetProcAddressForSortingApi( - "IsNLSDefinedString", - (FARPROC)SortVersioning::SortIsDefinedString, - (FARPROC)DownLevel::IsNLSDefinedString, - lpVersionInfo); - } - - // Call the appropriate function and return - return pFNIsNLSDefinedString(Function, dwFlags, (LPNLSVERSIONINFO)lpVersionInfo, lpString, cchStr); -#endif - } - - - - // This is a Windows 7 and above function - // This returns the "specific" locale from an input name, ie: "en" returns "en-US", - // although note that it should always succeed!(returning "" neutral if nothing else) - __success(return != 0) - int ResolveLocaleName(__in LPCWSTR lpNameToResolve, __in_ecount_opt(cchLocaleName) LPWSTR lpLocaleName, __in int cchLocaleName) - { - _ASSERTE(NotLeakingFrameworkOnlyCultures(lpLocaleName)); - int retVal = 0; -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - retVal = ::ResolveLocaleName(lpNameToResolve, lpLocaleName, cchLocaleName); -#else - typedef int (WINAPI *PFNResolveLocaleName)(LPCWSTR, LPWSTR, int); - - static PFNResolveLocaleName pFNResolveLocaleName=NULL; - if (pFNResolveLocaleName == NULL) - { - pFNResolveLocaleName =(PFNResolveLocaleName) GetProcAddressForLocaleApi( - "ResolveLocaleName", - (FARPROC)DownLevel::ResolveLocaleName); - } - retVal = pFNResolveLocaleName(lpNameToResolve, lpLocaleName, cchLocaleName); - if (retVal == 0) - { - retVal = DownLevel::ResolveLocaleName(lpNameToResolve, lpLocaleName, cchLocaleName); - } -#endif - - return retVal; - } - - __success(return == TRUE) BOOL - GetThreadPreferredUILanguages(__in DWORD dwFlags, - __out PULONG pulNumLanguages, - __out_ecount_opt(*pcchLanguagesBuffer) PWSTR pwszLanguagesBuffer, - __inout PULONG pcchLanguagesBuffer) - { - -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - return ::GetThreadPreferredUILanguages(dwFlags, pulNumLanguages,pwszLanguagesBuffer,pcchLanguagesBuffer); -#else - typedef int (WINAPI *PFNGetThreadPreferredUILanguages)(DWORD, PULONG,PWSTR,PULONG); - static PFNGetThreadPreferredUILanguages pFNGetThreadPreferredUILanguages=NULL; - if (pFNGetThreadPreferredUILanguages == NULL) - { - HMODULE hMod=WszGetModuleHandle(WINDOWS_KERNEL32_DLLNAME_W); - if(hMod==NULL) - return 0; - pFNGetThreadPreferredUILanguages=(PFNGetThreadPreferredUILanguages)GetProcAddress(hMod,"GetThreadPreferredUILanguages"); - if(pFNGetThreadPreferredUILanguages==NULL) - { - if(GetLastError() == ERROR_PROC_NOT_FOUND) - pFNGetThreadPreferredUILanguages=DownLevel::GetThreadPreferredUILanguages; - else - return 0; - } - } -#ifdef _PREFAST_ -#pragma warning(push) -#pragma warning(disable: 26036) // Prefast - Possible postcondition violation due to failure to null terminate string -#endif // _PREFAST_ - return pFNGetThreadPreferredUILanguages(dwFlags, pulNumLanguages,pwszLanguagesBuffer,pcchLanguagesBuffer); -#ifdef _PREFAST_ -#pragma warning(pop) -#endif - -#endif - } - - __success(return != 0) - BOOL WINAPI EnumSystemLocalesEx( - __in LOCALE_ENUMPROCEX lpLocaleEnumProc, - __in DWORD dwFlags, - __in LPARAM lParam, - __in_opt LPVOID lpReserved) - { -#if !defined(ENABLE_DOWNLEVEL_FOR_NLS) - return ::EnumSystemLocalesEx(lpLocaleEnumProc, dwFlags, lParam, lpReserved); -#else - typedef BOOL (WINAPI *PFNEnumSystemLocalesEx)( - LOCALE_ENUMPROCEX lpLocaleEnumProc, - DWORD dwFlags, - LPARAM lParam, - LPVOID lpReserved); - static PFNEnumSystemLocalesEx pFNEnumSystemLocalesEx=NULL; - if (pFNEnumSystemLocalesEx== NULL) - { - pFNEnumSystemLocalesEx=(PFNEnumSystemLocalesEx)GetProcAddressForLocaleApi( - "EnumSystemLocalesEx", - NULL); - if (pFNEnumSystemLocalesEx == NULL) - { - - return FALSE; - } - } - BOOL result = pFNEnumSystemLocalesEx(lpLocaleEnumProc, dwFlags, lParam, lpReserved); - - { - if(result == FALSE - && GetLastError() == ERROR_BADDB - && IsWindows7Platform()) - { - HKEY hKey; - if (::RegOpenKeyEx( - HKEY_LOCAL_MACHINE, - W("SYSTEM\\CurrentControlSet\\Control\\Nls\\ExtendedLocale"), - 0, - KEY_READ, - &hKey) == ERROR_SUCCESS) - { - ::RegCloseKey(hKey); - } - else - { - result = TRUE; - } - } - } - return result; -#endif - } -} - - - - - diff --git a/src/utilcode/sstring.cpp b/src/utilcode/sstring.cpp index 7c332e08c3..74df619260 100644 --- a/src/utilcode/sstring.cpp +++ b/src/utilcode/sstring.cpp @@ -11,7 +11,6 @@ #include "sstring.h" #include "ex.h" #include "holder.h" -#include "newapis.h" #if defined(_MSC_VER) @@ -91,7 +90,7 @@ static WCHAR MapChar(WCHAR wc, DWORD dwFlags, LocaleID lcid) #else // TODO: Uncertain if this is the best behavior. Caller should specify locale name if (lcid == NULL || lcid[0]==W('!')) lcid = W(""); - int iRet = NewApis::LCMapStringEx(lcid, dwFlags, &wc, 1, &wTmp, 1, NULL, NULL, 0); + int iRet = ::LCMapStringEx(lcid, dwFlags, &wc, 1, &wTmp, 1, NULL, NULL, 0); #endif if (!iRet) { // This can fail in non-exceptional cases becauseof unknown unicode characters. diff --git a/src/vm/ceemain.cpp b/src/vm/ceemain.cpp index 05384c3330..b09d970947 100644 --- a/src/vm/ceemain.cpp +++ b/src/vm/ceemain.cpp @@ -208,8 +208,6 @@ #include "profilinghelper.h" #endif // PROFILING_SUPPORTED -#include "newapis.h" - #ifdef FEATURE_COMINTEROP #include "synchronizationcontextnative.h" // For SynchronizationContextNative::Cleanup #endif @@ -2994,7 +2992,7 @@ static HRESULT GetThreadUICultureNames(__inout StringArrayList* pCultureNames) SIZE_T cchParentCultureName=LOCALE_NAME_MAX_LENGTH; #ifdef FEATURE_USE_LCID SIZE_T cchCultureName=LOCALE_NAME_MAX_LENGTH; - if (!NewApis::LCIDToLocaleName(id, sCulture.OpenUnicodeBuffer(static_cast<COUNT_T>(cchCultureName)), static_cast<int>(cchCultureName), 0)) + if (!::LCIDToLocaleName(id, sCulture.OpenUnicodeBuffer(static_cast<COUNT_T>(cchCultureName)), static_cast<int>(cchCultureName), 0)) { hr = HRESULT_FROM_GetLastError(); } @@ -3004,7 +3002,7 @@ static HRESULT GetThreadUICultureNames(__inout StringArrayList* pCultureNames) #endif #ifndef FEATURE_PAL - if (!NewApis::GetLocaleInfoEx((LPCWSTR)sCulture, LOCALE_SPARENT, sParentCulture.OpenUnicodeBuffer(static_cast<COUNT_T>(cchParentCultureName)),static_cast<int>(cchParentCultureName))) + if (!::GetLocaleInfoEx((LPCWSTR)sCulture, LOCALE_SPARENT, sParentCulture.OpenUnicodeBuffer(static_cast<COUNT_T>(cchParentCultureName)),static_cast<int>(cchParentCultureName))) { hr = HRESULT_FROM_GetLastError(); } @@ -3094,7 +3092,7 @@ static int GetThreadUICultureId(__out LocaleIDValue* pLocale) STRINGREF cultureName = pCurrentCulture->GetName(); _ASSERT(cultureName != NULL); - if ((Result = NewApis::LocaleNameToLCID(cultureName->GetBuffer(), 0)) == 0) + if ((Result = ::LocaleNameToLCID(cultureName->GetBuffer(), 0)) == 0) Result = (int)UICULTUREID_DONTCARE; } } @@ -3172,7 +3170,7 @@ static int GetThreadUICultureId(__out LocaleIDValue* pLocale) // This thread isn't set up to use a non-default culture. Let's grab the default // one and return that. - Result = NewApis::GetUserDefaultLocaleName(*pLocale, LOCALE_NAME_MAX_LENGTH); + Result = ::GetUserDefaultLocaleName(*pLocale, LOCALE_NAME_MAX_LENGTH); _ASSERTE(Result != 0); #else // !FEATURE_PAL diff --git a/src/vm/comsynchronizable.cpp b/src/vm/comsynchronizable.cpp index a2cc4f0932..772163aff2 100644 --- a/src/vm/comsynchronizable.cpp +++ b/src/vm/comsynchronizable.cpp @@ -32,8 +32,6 @@ #include "utilcode.h" #endif -#include "newapis.h" - // To include definition of CAPTURE_BUCKETS_AT_TRANSITION #include "exstate.h" diff --git a/src/vm/util.cpp b/src/vm/util.cpp index b9448dadbe..b4b725e525 100644 --- a/src/vm/util.cpp +++ b/src/vm/util.cpp @@ -14,7 +14,6 @@ #include "eventtrace.h" #include "posterror.h" #include "eemessagebox.h" -#include "newapis.h" #include <shlobj.h> @@ -2047,11 +2046,7 @@ size_t GetCacheSizePerLogicalCpu(BOOL bTrueSize) #ifndef FEATURE_PAL ThreadLocaleHolder::~ThreadLocaleHolder() { -#ifdef FEATURE_USE_LCID -#endif // FEATURE_USE_LCID - { - SetThreadLocale(m_locale); - } + SetThreadLocale(m_locale); } HMODULE CLRGetModuleHandle(LPCWSTR lpModuleFileName) @@ -3463,7 +3458,7 @@ INT32 InternalCasingHelper::InvariantToLowerHelper(__out_bcount_opt(cMaxBytes) L } //Do the casing operation - NewApis::LCMapStringEx(W(""), LCMAP_LOWERCASE, szInWide, wideCopyLen, szWideOut, wideCopyLen, NULL, NULL, 0); + ::LCMapStringEx(W(""), LCMAP_LOWERCASE, szInWide, wideCopyLen, szWideOut, wideCopyLen, NULL, NULL, 0); //Convert the Unicode back to UTF8 result = WszWideCharToMultiByte(CP_UTF8, 0, szWideOut, wideCopyLen, szOut, cMaxBytes, NULL, NULL); |