Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit f2a80d70e485781c48321fe8ccf7b50d79f63cdc
- Author: Rolf Bjarne Kvinge <[email protected]>
- Date: Thu Mar 31 14:09:53 2016 +0200
- [process] Initialize exit code before calling GetExitCodeProcess.
- GetExitCodeProcess may fail (if getting the exit code of an exited process
- we only have the pid for) and not write anything to the *code
- parameter.
- In that case GetExitCodeProcess would return random memory.
- If that random memory happened to be 0x103 (259), then Process.HasExited
- would return false, even though the process had actually exited.
- Due to the reference import of Process in master, this code is
- completely different there, and this bug probably only occurs on
- the mono-4.4.0-branch.
- diff --git a/mono/metadata/process.c b/mono/metadata/process.c
- index f662cf6..5794956 100644
- --- a/mono/metadata/process.c
- +++ b/mono/metadata/process.c
- @@ -867,7 +867,7 @@ gint64 ves_icall_System_Diagnostics_Process_StartTime_internal (HANDLE process)
- gint32 ves_icall_System_Diagnostics_Process_ExitCode_internal (HANDLE process)
- {
- - DWORD code;
- + DWORD code = 0;
- GetExitCodeProcess (process, &code);
Advertisement
Add Comment
Please, Sign In to add comment