From e9a843c626b2edb4d6a3d201ef73406f2a5b7908 Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Tue, 8 Dec 2015 16:55:02 -0800 Subject: [PATCH] win: Set shutdown order to make the handler shutdown as late as possible At the default level, we might be terminated before the process we're watching, which would mean missing shutdown crashes. R=mark@chromium.org BUG=crashpad:84 Review URL: https://codereview.chromium.org/1505423002 . --- handler/handler_main.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handler/handler_main.cc b/handler/handler_main.cc index 16855fa8..4dfd19bd 100644 --- a/handler/handler_main.cc +++ b/handler/handler_main.cc @@ -337,6 +337,10 @@ int HandlerMain(int argc, char* argv[]) { reset_sigterm.reset(&old_sa); } #elif defined(OS_WIN) + // Shut down as late as possible relative to programs we're watching. + if (!SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY)) + PLOG(ERROR) << "SetProcessShutdownParameters"; + ExceptionHandlerServer exception_handler_server(!options.pipe_name.empty()); if (!options.pipe_name.empty()) {