From ac21bc761fb068ae58dee485e12b5822d1a82087 Mon Sep 17 00:00:00 2001 From: goaaats <16760685+goaaats@users.noreply.github.com> Date: Fri, 29 Oct 2021 21:51:25 +0200 Subject: [PATCH] feat: crash in hook debug --- Dalamud/Interface/Internal/Windows/DataWindow.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/Windows/DataWindow.cs b/Dalamud/Interface/Internal/Windows/DataWindow.cs index e7355e2ed..7d24198e7 100644 --- a/Dalamud/Interface/Internal/Windows/DataWindow.cs +++ b/Dalamud/Interface/Internal/Windows/DataWindow.cs @@ -40,6 +40,7 @@ using Dalamud.Utility; using ImGuiNET; using ImGuiScene; using Newtonsoft.Json; +using PInvoke; using Serilog; namespace Dalamud.Interface.Internal.Windows @@ -354,7 +355,15 @@ namespace Dalamud.Interface.Internal.Windows private int MessageBoxWDetour(IntPtr hwnd, string text, string caption, NativeFunctions.MessageBoxType type) { Log.Information("[DATAHOOK] {0} {1} {2} {3}", hwnd, text, caption, type); - return this.messageBoxMinHook.Original(hwnd, text, caption, type); + + var result = this.messageBoxMinHook.Original(hwnd, "Cause Access Violation?", caption, NativeFunctions.MessageBoxType.YesNo); + + if (result == (int)User32.MessageBoxResult.IDYES) + { + Marshal.ReadByte(IntPtr.Zero); + } + + return result; } private void DrawServerOpCode()