2023-08-22 19:05:42 -07:00
|
|
|
From 6e2509a34fb6f8f06438ee9908eb61320b73697f Mon Sep 17 00:00:00 2001
|
2014-09-28 14:54:50 -07:00
|
|
|
From: Sebastian Lackner <sebastian@fds-team.de>
|
|
|
|
Date: Sun, 28 Sep 2014 23:39:51 +0200
|
2020-07-28 16:47:49 -07:00
|
|
|
Subject: [PATCH] ntdll: OutputDebugString should throw the exception a second
|
|
|
|
time, if a debugger is attached.
|
2014-09-28 14:54:50 -07:00
|
|
|
|
|
|
|
---
|
2023-08-22 19:05:42 -07:00
|
|
|
dlls/kernelbase/debug.c | 17 +++++++++++++++++
|
|
|
|
1 file changed, 17 insertions(+)
|
2014-09-28 14:54:50 -07:00
|
|
|
|
2019-09-09 16:52:44 -07:00
|
|
|
diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c
|
2023-08-22 19:05:42 -07:00
|
|
|
index e1976777b7f..7294f99da7e 100644
|
2019-09-09 16:52:44 -07:00
|
|
|
--- a/dlls/kernelbase/debug.c
|
|
|
|
+++ b/dlls/kernelbase/debug.c
|
2023-08-22 19:05:42 -07:00
|
|
|
@@ -202,6 +202,23 @@ void WINAPI DECLSPEC_HOTPATCH OutputDebugStringA( LPCSTR str )
|
2014-09-28 14:54:50 -07:00
|
|
|
__ENDTRY
|
|
|
|
if (caught_by_dbg) return;
|
|
|
|
|
|
|
|
+ /* for some unknown reason Windows sends the exception a second time, if a
|
|
|
|
+ * debugger is attached, and the event wasn't handled in the first attempt */
|
|
|
|
+ if (NtCurrentTeb()->Peb->BeingDebugged)
|
|
|
|
+ {
|
|
|
|
+ __TRY
|
|
|
|
+ {
|
|
|
|
+ ULONG_PTR args[2];
|
|
|
|
+ args[0] = strlen(str) + 1;
|
|
|
|
+ args[1] = (ULONG_PTR)str;
|
|
|
|
+ RaiseException( DBG_PRINTEXCEPTION_C, 0, 2, args );
|
|
|
|
+ }
|
|
|
|
+ __EXCEPT(debug_exception_handler)
|
|
|
|
+ {
|
|
|
|
+ }
|
|
|
|
+ __ENDTRY
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
/* send string to a system-wide monitor */
|
|
|
|
if (!mutex_inited)
|
|
|
|
{
|
|
|
|
--
|
2023-08-22 19:05:42 -07:00
|
|
|
2.40.1
|
2014-09-28 14:54:50 -07:00
|
|
|
|