mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: correct utility process exit code on Windows
On Windows, process exit codes are 32-bit unsigned integers (DWORD). When passed from Chromium to Electron as a signed int and then implicitly converted to uint64_t, values with the high bit set (e.g., NTSTATUS codes) undergo sign extension, producing incorrect values. Cast the exit code to uint32_t before widening to uint64_t to prevent sign extension and preserve the original Windows exit code. Fixes #49455 Signed-off-by: John Kleinschmidt <kleinschmidtorama@gmail.com>
This commit is contained in:
committed by
John Kleinschmidt
parent
0d869c2007
commit
e87807dcbf
@@ -291,7 +291,7 @@ void UtilityProcessWrapper::OnServiceProcessTerminatedNormally(
|
||||
info.GetProcess().Pid() != pid_)
|
||||
return;
|
||||
|
||||
HandleTermination(info.exit_code());
|
||||
HandleTermination(static_cast<uint32_t>(info.exit_code()));
|
||||
}
|
||||
|
||||
void UtilityProcessWrapper::OnServiceProcessCrashed(
|
||||
@@ -300,7 +300,7 @@ void UtilityProcessWrapper::OnServiceProcessCrashed(
|
||||
info.GetProcess().Pid() != pid_)
|
||||
return;
|
||||
|
||||
HandleTermination(info.exit_code());
|
||||
HandleTermination(static_cast<uint32_t>(info.exit_code()));
|
||||
}
|
||||
|
||||
void UtilityProcessWrapper::CloseConnectorPort() {
|
||||
|
||||
Reference in New Issue
Block a user