summaryrefslogtreecommitdiff
path: root/src/utilcode
diff options
context:
space:
mode:
Diffstat (limited to 'src/utilcode')
-rw-r--r--src/utilcode/ccomprc.cpp41
-rw-r--r--src/utilcode/ex.cpp4
-rw-r--r--src/utilcode/posterror.cpp46
-rw-r--r--src/utilcode/sstring.cpp4
4 files changed, 1 insertions, 94 deletions
diff --git a/src/utilcode/ccomprc.cpp b/src/utilcode/ccomprc.cpp
index 26308e53aa..9e7ac65728 100644
--- a/src/utilcode/ccomprc.cpp
+++ b/src/utilcode/ccomprc.cpp
@@ -49,42 +49,9 @@ int GetMUILanguageID(LocaleIDValue* pResult)
#endif
}
CONTRACTL_END;
-#if FEATURE_USE_LCID
- int langId=0;
- static PFNGETUSERDEFAULTUILANGUAGE pfnGetUserDefaultUILanguage=NULL;
- if( NULL == pfnGetUserDefaultUILanguage )
- {
- PFNGETUSERDEFAULTUILANGUAGE proc = NULL;
-
- HMODULE hmod = GetModuleHandleA(WINDOWS_KERNEL32_DLLNAME_A);
-
- if( hmod )
- proc = (PFNGETUSERDEFAULTUILANGUAGE)
- GetProcAddress(hmod, "GetUserDefaultUILanguage");
-
- if(proc == NULL)
- proc = (PFNGETUSERDEFAULTUILANGUAGE) -1;
-
- PVOID value = InterlockedExchangeT(&pfnGetUserDefaultUILanguage,
- proc);
- }
-
- // We should never get NULL here, the function is -1 or a valid address.
- _ASSERTE(pfnGetUserDefaultUILanguage != NULL);
-
-
- if( pfnGetUserDefaultUILanguage == (PFNGETUSERDEFAULTUILANGUAGE) -1)
- langId = GetSystemDefaultLangID();
- else
- langId = pfnGetUserDefaultUILanguage();
-
- *pResult= langId;
-#else // FEATURE_USE_LCID
_ASSERTE(sizeof(LocaleID)/sizeof(WCHAR) >=LOCALE_NAME_MAX_LENGTH);
return ::GetSystemDefaultLocaleName(*pResult, LOCALE_NAME_MAX_LENGTH);
-#endif //FEATURE_USE_LCID
- return 1;
}
static void BuildMUIDirectory(int langid, __out SString* pResult)
@@ -113,13 +80,7 @@ void GetMUILanguageName(__out SString* pResult)
LocaleIDValue langid;
GetMUILanguageID(&langid);
- int lcid;
-#ifdef FEATURE_USE_LCID
- lcid=langid;
-#else
- lcid=::LocaleNameToLCID(langid,0);
-#endif
-
+ int lcid = ::LocaleNameToLCID(langid,0);
return BuildMUIDirectory(lcid, pResult);
}
diff --git a/src/utilcode/ex.cpp b/src/utilcode/ex.cpp
index 4eaaf3d2ab..feeeb9540e 100644
--- a/src/utilcode/ex.cpp
+++ b/src/utilcode/ex.cpp
@@ -1160,11 +1160,7 @@ void GetHRMsg(HRESULT hr, SString &result, BOOL bNoGeekStuff/* = FALSE*/)
DWORD dwFlags = FORMAT_MESSAGE_FROM_SYSTEM;
dwFlags |= FORMAT_MESSAGE_MAX_WIDTH_MASK;
-#if FEATURE_USE_LCID
- fHaveDescr = strDescr.FormatMessage(dwFlags, 0, hr, LANG_USER_DEFAULT);
-#else
fHaveDescr = strDescr.FormatMessage(dwFlags, 0, hr, 0);
-#endif
}
LPCSTR name = Exception::GetHRSymbolicName(hr);
diff --git a/src/utilcode/posterror.cpp b/src/utilcode/posterror.cpp
index a15128add9..c0f66c4f7f 100644
--- a/src/utilcode/posterror.cpp
+++ b/src/utilcode/posterror.cpp
@@ -99,46 +99,6 @@ HRESULT UtilLoadResourceString(CCompRC::ResourceCategory eCategory, UINT iResour
return retVal;
}
-#ifdef FEATURE_USE_LCID
-STDAPI UtilLoadStringRCEx(
- LCID lcid,
- UINT iResourceID,
- __out_ecount(iMax) LPWSTR szBuffer,
- int iMax,
- int bQuiet,
- int *pcwchUsed
-)
-{
- CONTRACTL
- {
- DISABLED(NOTHROW);
- GC_NOTRIGGER;
- }
- CONTRACTL_END;
-
- HRESULT retVal = E_OUTOFMEMORY;
-
- EX_TRY
- {
- SString::Startup();
- CCompRC *pResourceDLL = CCompRC::GetDefaultResourceDll();
-
- if (pResourceDLL != NULL)
- {
- retVal = pResourceDLL->LoadString(bQuiet? CCompRC::Optional : CCompRC::Required,lcid, iResourceID, szBuffer, iMax, pcwchUsed);
- }
- }
- EX_CATCH
- {
- // Catch any errors and return E_OUTOFMEMORY;
- retVal = E_OUTOFMEMORY;
- }
- EX_END_CATCH(SwallowAllExceptions);
-
- return retVal;
-}
-#endif //FEATURE_USE_LCID
-
//*****************************************************************************
// Format a Runtime Error message.
//*****************************************************************************
@@ -174,15 +134,9 @@ HRESULT __cdecl FormatRuntimeErrorVa(
// find the text for it.
else
{
-#ifdef FEATURE_USE_LCID
- if (WszFormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
- 0, hrRpt, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- rcMsg, cchMsg, 0/*<TODO>@todo: marker</TODO>*/))
-#else
if (WszFormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
0, hrRpt, 0,
rcMsg, cchMsg, 0/*<TODO>@todo: marker</TODO>*/))
-#endif
{
hr = S_OK;
diff --git a/src/utilcode/sstring.cpp b/src/utilcode/sstring.cpp
index c2467b8485..bd2cf6fe85 100644
--- a/src/utilcode/sstring.cpp
+++ b/src/utilcode/sstring.cpp
@@ -73,11 +73,7 @@ static WCHAR MapChar(WCHAR wc, DWORD dwFlags)
#ifndef FEATURE_PAL
-#ifdef FEATURE_USE_LCID
- int iRet = WszLCMapString(MAKELCID(LOCALE_INVARIANT, SORT_DEFAULT), dwFlags, &wc, 1, &wTmp, 1);
-#else
int iRet = ::LCMapStringEx(LOCALE_NAME_INVARIANT, dwFlags, &wc, 1, &wTmp, 1, NULL, NULL, 0);
-#endif
if (!iRet) {
// This can fail in non-exceptional cases becauseof unknown unicode characters.
wTmp = wc;