diff --git a/WeModPatcher/Core/RuntimePatcher.cs b/WeModPatcher/Core/RuntimePatcher.cs index bf97196..a6942a4 100644 --- a/WeModPatcher/Core/RuntimePatcher.cs +++ b/WeModPatcher/Core/RuntimePatcher.cs @@ -44,13 +44,22 @@ namespace WeModPatcher.Core var debugEvent = new Imports.DEBUG_EVENT(); var processIds = new List(); - while (Imports.WaitForDebugEvent(ref debugEvent, 1000)) + while (Imports.WaitForDebugEvent(ref debugEvent, uint.MaxValue)) { var code = debugEvent.dwDebugEventCode; if (code == Imports.CREATE_PROCESS_DEBUG_EVENT) { processIds.Add(debugEvent.dwProcessId); } + else if (code == Imports.EXIT_PROCESS_DEBUG_EVENT) + { + processIds.Remove(debugEvent.dwProcessId); + + if(processIds.Count == 0) + { + break; + } + } else if (code == Imports.EXCEPTION_DEBUG_EVENT) { var exceptionInfo = Imports.MapUnmanagedStructure(debugEvent.Union); diff --git a/WeModPatcher/Properties/AssemblyInfo.cs b/WeModPatcher/Properties/AssemblyInfo.cs index 48deafc..e12de21 100644 --- a/WeModPatcher/Properties/AssemblyInfo.cs +++ b/WeModPatcher/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] [assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/WeModPatcher/Utils/Win32/Imports.cs b/WeModPatcher/Utils/Win32/Imports.cs index 1e3de8e..814cc40 100644 --- a/WeModPatcher/Utils/Win32/Imports.cs +++ b/WeModPatcher/Utils/Win32/Imports.cs @@ -247,6 +247,7 @@ namespace WeModPatcher.Utils.Win32 public const uint DEBUG_PROCESS = 0x00000001; public const uint DBG_CONTINUE = 0x00010002; public const uint CREATE_PROCESS_DEBUG_EVENT = 3; + public const uint EXIT_PROCESS_DEBUG_EVENT = 5; public const uint EXCEPTION_DEBUG_EVENT = 1; public const uint LOAD_DLL_DEBUG_EVENT = 6; public const uint OUTPUT_DEBUG_STRING_EVENT = 8;