Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1745)

Unified Diff: chrome/app/client_util.cc

Issue 944283002: Consume EXCEPTION_INVALID_HANDLE on sandbox process shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: only win10 Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/crash/app/breakpad_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/client_util.cc
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc
index 97ff58e1305ea12c91bfa5b68e50b580a7aaa085..a5327a7609cec1d532d36521809b2e25e78ce9e1 100644
--- a/chrome/app/client_util.cc
+++ b/chrome/app/client_util.cc
@@ -94,6 +94,16 @@ base::FilePath GetExecutableDir() {
return base::FilePath(path).DirName();
}
+bool IsSandboxedProcess() {
+ typedef bool (*IsSandboxedProcessFunc)();
+ IsSandboxedProcessFunc is_sandboxed_process_func =
+ reinterpret_cast<IsSandboxedProcessFunc>(
+ GetProcAddress(GetModuleHandle(NULL), "IsSandboxedProcess"));
+ bool is_sandboxed_process =
+ is_sandboxed_process_func && is_sandboxed_process_func();
+ return is_sandboxed_process;
+}
+
} // namespace
base::string16 GetCurrentModuleVersion() {
@@ -235,7 +245,16 @@ int MainDllLoader::Launch(HINSTANCE instance) {
DLL_MAIN chrome_main =
reinterpret_cast<DLL_MAIN>(::GetProcAddress(dll_, "ChromeMain"));
int rc = chrome_main(instance, &sandbox_info);
- return OnBeforeExit(rc, file);
+ rc = OnBeforeExit(rc, file);
+ // Sandboxed processes close some system DLL handles after lockdown so ignore
+ // EXCEPTION_INVALID_HANDLE generated on Windows 10 during shutdown of these
+ // processes.
+ // TODO(wfh): Check whether MS have fixed this in Win10 RTM. crbug.com/456193
+ if (base::win::GetVersion() >= base::win::VERSION_WIN10 &&
+ IsSandboxedProcess()) {
+ breakpad::ConsumeInvalidHandleExceptions();
rvargas (doing something else) 2015/02/25 02:02:57 Drive by: I don't know what this code does (don't
+ }
+ return rc;
}
void MainDllLoader::RelaunchChromeBrowserWithNewCommandLineIfNeeded() {
« no previous file with comments | « no previous file | components/crash/app/breakpad_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698