• Toshihito Kikuchi's avatar
    Use OSInfo::Kernel32Version() to select a thunk resolver · 01c8afd0
    Toshihito Kikuchi authored
    When the Windows compatibility mode is turned on, ::GetVersionEx()
    returns a simulated OS version instead of the real OS version.  As a
    result, InterceptionManager selects a wrong thunk resolver, incorrectly
    patches ntdll's functions, and thus the process crashes when one of
    those incorrectly-patched functions are executed.
    
    The proposed fix is to use OSInfo::Kernel32Version() which returns
    the real OS version even with the compat mode to select a thunk
    resolver.
    
    Bug: 1053805
    
    Test: Run 32-bit chrome.exe on 32-bit Windows 10 or 8.1 with the compat
    mode setting to Windows 7.  Please note that the crash does not happen
    if you run chrome.exe on 64-bit OS.
    
    R=wfh@chromium.org
    
    Change-Id: Id39a11288cc64ff5552de0a6a273231bdeb2eeff
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2080785Reviewed-by: default avatarWill Harris <wfh@chromium.org>
    Commit-Queue: Will Harris <wfh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#747357}
    01c8afd0
AUTHORS 42.1 KB