Skip to content

Commit

Permalink
BrowserSubProcess - Change SetProcessShutdownParameters priority to 0…
Browse files Browse the repository at this point in the history
…x200

- 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
  • Loading branch information
amaitland committed Dec 9, 2021
1 parent c39e0ea commit b064efd
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions CefSharp.BrowserSubprocess.Core/BrowserSubprocessExecutable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b064efd

Please sign in to comment.