• Alex Gough's avatar
    Only pass executable sections to OnDllLoaded for patching · df9e203b
    Alex Gough authored
    On recent Windows insider builds GetModuleHandleExW loads sections for
    inspection as non-executable images, rather than as files. This leads
    to our hooks detecting the SEC_IMAGE attribute and potentially patching
    functions (e.g. for user32.dll).
    
    This caused content_browsertests to fail as it pinned user32.dll in some
    processes. With this change, the tests run again.
    
    See crbug.com/1143397 for a full discussion.
    
    Bug: 1143397
    Change-Id: I3b75464d0442160a417e4cb7084306841aaf76f7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2511531Reviewed-by: default avatarWill Harris <wfh@chromium.org>
    Commit-Queue: Alex Gough <ajgo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#823354}
    df9e203b
sandbox_nt_util.cc 22.2 KB