• Jesse McKenna's avatar
    Reland "Use consistent DLL to detect Application Verifier" · cc1b611f
    Jesse McKenna authored
    This reverts commit 956f8294.
    
    Reason for revert: The previous version of this change caused an access
    violation when sandbox/win/src/target_interceptions.cc::
    TargetNtMapViewOfSection() tried to access constant
    kApplicationVerifierDllName, which was declared in base/win/win_util.h
    and defined in win_util.cc.
    
    This access violation happened because base.dll, from which the constant
    was imported, is not yet resolved by the time TargetNtMapViewOfSection()
    is called. This function, as well as the others in
    target_interceptions.cc, can't reference any non-static variables or
    functions in other modules besides those exposed via the g_nt structure.
    
    To address this, the constant kApplicationVerifierDllName was moved into
    the base_static build rule, whose source files are statically linked
    into code that depends on them (rather than dynamically linked via
    dllexport).
    
    Original change's description:
    > Revert "Use consistent DLL to detect Application Verifier"
    >
    > This reverts commit fd8fe93c.
    >
    > Reason for revert: this change is causing chrome.exe to crash on
    > startup. I received a report that chrome.exe looked for the string
    > constant in memory and encountered some kind of error which caused it
    > to crash. I will roll back for now to investigate.
    >
    > Original change's description:
    > > Use consistent DLL to detect Application Verifier
    > >
    > > To detect whether Application Verifier is running,
    > > sandbox/win/src/target_interceptions.cc checks if vrfcore.dll is loaded,
    > > while sandbox/win/src/handle_closer_agent.cc checks for verifier.dll.
    > >
    > > This change makes both use verifier.dll, to be consistent and remove any
    > > confusion around whether these two are checking for the same thing (they
    > > are).
    > >
    > >       Open Application Verifier
    > >       File > Add Application > chrome.exe (any chrome.exe binary works)
    > >       Under 'Tests', uncheck everything but Basics > Handles, then Save
    > >       Run chrome.exe with this change; it works normally
    > >         (on versions without lines 176-177, no pages will load)
    > >       Return to Application Verifier
    > >       Right-click chrome.exe > Delete Application, then Save
    > >         (so Chrome runs normally again)
    > >
    > > Test: Manual
    > > Change-Id: If97a1115373c394f0cbbf1d31d3ca7b60549bbee
    > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1776781
    > > Commit-Queue: Jesse McKenna <jessemckenna@google.com>
    > > Reviewed-by: Greg Thompson <grt@chromium.org>
    > > Reviewed-by: Will Harris <wfh@chromium.org>
    > > Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
    > > Cr-Commit-Position: refs/heads/master@{#700323}
    >
    > TBR=brucedawson@chromium.org,wfh@chromium.org,grt@chromium.org,jessemckenna@google.com
    >
    > Change-Id: I79f41f6e93813befaf4e49604f7dcc1f8c1ddb48
    > No-Presubmit: true
    > No-Tree-Checks: true
    > No-Try: true
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1828234
    > Reviewed-by: David Bienvenu <davidbienvenu@chromium.org>
    > Commit-Queue: Jesse McKenna <jessemckenna@google.com>
    > Cr-Commit-Position: refs/heads/master@{#700493}
    
    Change-Id: I0c43a20433dbbb54ebdf8d1a2ec71e09adb8afa9
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829544Reviewed-by: default avatarWill Harris <wfh@chromium.org>
    Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
    Commit-Queue: Daniel Cheng <dcheng@chromium.org>
    Auto-Submit: Jesse McKenna <jessemckenna@google.com>
    Cr-Commit-Position: refs/heads/master@{#703898}
    cc1b611f
BUILD.gn 131 KB