0

Remove dynamic load and call for GetUserDefaultLocaleName

This was only required because it is not available on Windows XP, which is no
longer supported.

R=forshaw@chromium.org

Bug: 821290
Change-Id: Ie5fba51391b25f7a1a01549f67a054c00aefa50f
Reviewed-on: https://chromium-review.googlesource.com/1012119
Reviewed-by: James Forshaw <forshaw@chromium.org>
Commit-Queue: James Forshaw <forshaw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551715}
This commit is contained in:
Bob Owen
2018-04-18 16:40:04 +00:00
committed by Commit Bot
parent 779dea58e7
commit 97d0c581ae
2 changed files with 2 additions and 22 deletions

@ -112,7 +112,6 @@ Bernhard M. Wiedemann <bwiedemann@suse.de>
Bhagirathi Satpathy <bhagirathi.s@samsung.com>
Bhanukrushana Rout <b.rout@samsung.com>
Biljith Jayan <billy.jayan@samsung.com>
Bob Owen <bowen@mozilla.com>
Bobby Powers <bobbypowers@gmail.com>
Branden Archer <bma4@zips.uakron.edu>
Brendan Kirby <brendan.kirby@imgtec.com>
@ -955,6 +954,7 @@ LG Electronics, Inc. <*@lge.com>
Loongson Technology Corporation Limited. <*@loongson.cn>
Macadamian <*@macadamian.com>
MIPS Technologies, Inc. <*@mips.com>
Mozilla Corporation <*@mozilla.com>
Neverware Inc. <*@neverware.com>
NIKE, Inc. <*@nike.com>
NVIDIA Corporation <*@nvidia.com>

@ -79,11 +79,6 @@ bool CloseOpenHandles(bool* is_csrss_connected) {
return true;
}
// GetUserDefaultLocaleName is not available on WIN XP. So we'll
// load it on-the-fly.
const wchar_t kKernel32DllName[] = L"kernel32.dll";
typedef decltype(GetUserDefaultLocaleName)* GetUserDefaultLocaleNameFunction;
// Warm up language subsystems before the sandbox is turned on.
// Tested on Win8.1 x64:
// This needs to happen after RevertToSelf() is called, because (at least) in
@ -96,23 +91,8 @@ bool WarmupWindowsLocales() {
// warmup all of these functions, but let's not assume that.
::GetUserDefaultLangID();
::GetUserDefaultLCID();
static GetUserDefaultLocaleNameFunction GetUserDefaultLocaleName_func =
nullptr;
if (!GetUserDefaultLocaleName_func) {
HMODULE kernel32_dll = ::GetModuleHandle(kKernel32DllName);
if (!kernel32_dll) {
return false;
}
GetUserDefaultLocaleName_func =
reinterpret_cast<GetUserDefaultLocaleNameFunction>(
GetProcAddress(kernel32_dll, "GetUserDefaultLocaleName"));
if (!GetUserDefaultLocaleName_func) {
return false;
}
}
wchar_t localeName[LOCALE_NAME_MAX_LENGTH] = {0};
return (0 != GetUserDefaultLocaleName_func(
localeName, LOCALE_NAME_MAX_LENGTH * sizeof(wchar_t)));
return (0 != ::GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH));
}
// Used as storage for g_target_services, because other allocation facilities