Bug 1615401 - Part 3: Use OSInfo::Kernel32Version() to select a thunk resolver. r=bobowen

Cherry-picking Chromium's commit 01c8afd0dc14a1acef383c5f231258d0cfac95e5
to fix the crash caused by Chromium's sandbox code.

The original bug on Chromium side: https://crbug.com/1053805

Differential Revision: https://phabricator.services.mozilla.com/D65745

Depends on D65802
This commit is contained in:
Toshihito Kikuchi 2020-03-06 18:52:25 +02:00
Родитель 866761cd8a
Коммит d992a091fa
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -481,14 +481,15 @@ ResultCode InterceptionManager::PatchClientFunctions(
thunk.reset(new ServiceResolverThunk(child_->Process(), relaxed_));
#else
base::win::OSInfo* os_info = base::win::OSInfo::GetInstance();
base::win::Version real_os_version = os_info->Kernel32Version();
if (os_info->wow64_status() == base::win::OSInfo::WOW64_ENABLED) {
if (os_info->version() >= base::win::VERSION_WIN10)
if (real_os_version >= base::win::VERSION_WIN10)
thunk.reset(new Wow64W10ResolverThunk(child_->Process(), relaxed_));
else if (os_info->version() >= base::win::VERSION_WIN8)
else if (real_os_version >= base::win::VERSION_WIN8)
thunk.reset(new Wow64W8ResolverThunk(child_->Process(), relaxed_));
else
thunk.reset(new Wow64ResolverThunk(child_->Process(), relaxed_));
} else if (os_info->version() >= base::win::VERSION_WIN8) {
} else if (real_os_version >= base::win::VERSION_WIN8) {
thunk.reset(new Win8ResolverThunk(child_->Process(), relaxed_));
} else {
thunk.reset(new ServiceResolverThunk(child_->Process(), relaxed_));