From b064efd1091fb14c49fb6b85f91cf85cc30a906a Mon Sep 17 00:00:00 2001 From: Alex Maitland Date: Thu, 9 Dec 2021 10:06:43 +1000 Subject: [PATCH] BrowserSubProcess - Change SetProcessShutdownParameters priority to 0x200 - Change to 0x200 which is low end of 'Application reserved "in between" shutdown range.' - Remove logging as it wasn't working, must be too early to use the LOG(INFO) CEF macro Test with a GetProcessShutdownParameters in debugger shows working e.g. if (SetProcessShutdownParameters(0x200, SHUTDOWN_NORETRY)) { DWORD level = 0; DWORD flags = 0; GetProcessShutdownParameters(&level, &flags); } Issue #3155 --- .../BrowserSubprocessExecutable.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/CefSharp.BrowserSubprocess.Core/BrowserSubprocessExecutable.h b/CefSharp.BrowserSubprocess.Core/BrowserSubprocessExecutable.h index 3d37b0b795..7432bf4e74 100644 --- a/CefSharp.BrowserSubprocess.Core/BrowserSubprocessExecutable.h +++ b/CefSharp.BrowserSubprocess.Core/BrowserSubprocessExecutable.h @@ -125,19 +125,13 @@ namespace CefSharp //Lower the shutdown priority so the browser process is shutdown first (Issue #3155) //The system terminates the process without displaying a retry dialog box for the user. //Crashpad is lower than other sub processes so it can still monitor process exit crashes. - if (!SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY)) - { - LOG(ERROR) << "SetProcessShutdownParameters - Crashpad"; - } + SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY); } else { //Lower the shutdown priority so the browser process is shutdown first (Issue #3155) //The system terminates the process without displaying a retry dialog box for the user. - if (!SetProcessShutdownParameters(0x280 - 100, SHUTDOWN_NORETRY)) - { - LOG(ERROR) << "SetProcessShutdownParameters - Sub Process"; - } + SetProcessShutdownParameters(0x200, SHUTDOWN_NORETRY); parentProcessId = int::Parse(CommandLineArgsParser::GetArgumentValue(args, CefSharpArguments::HostProcessIdArgument)); if (CommandLineArgsParser::HasArgument(args, CefSharpArguments::ExitIfParentProcessClosed))