59 lines
2.4 KiB
Diff
59 lines
2.4 KiB
Diff
From e8f6ed261e213ced6c0c762988b6fc3446ef510a Mon Sep 17 00:00:00 2001
|
|
From: Derek Lesho <dlesho@codeweavers.com>
|
|
Date: Wed, 22 Apr 2020 10:45:46 -0500
|
|
Subject: [PATCH 1/8] mk11_base
|
|
|
|
---
|
|
dlls/ntdll/signal_x86_64.c | 11 +++++-
|
|
dlls/ws2_32/Makefile.in | 1 +
|
|
3 files changed, 20 insertions(+), 22 deletions(-)
|
|
|
|
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
|
|
index 89caca9f30f..6fb16333397 100644
|
|
--- a/dlls/ntdll/signal_x86_64.c
|
|
+++ b/dlls/ntdll/signal_x86_64.c
|
|
@@ -425,6 +425,8 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex
|
|
UNWIND_HISTORY_TABLE table;
|
|
DISPATCHER_CONTEXT dispatch;
|
|
CONTEXT context;
|
|
+ MEMORY_BASIC_INFORMATION wine_frame_stack_info, current_stack_info;
|
|
+ int is_teb_frame_in_current_stack = 1;
|
|
NTSTATUS status;
|
|
|
|
context = *orig_context;
|
|
@@ -433,6 +435,13 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex
|
|
dispatch.TargetIp = 0;
|
|
dispatch.ContextRecord = &context;
|
|
dispatch.HistoryTable = &table;
|
|
+
|
|
+ if ( !(NtQueryVirtualMemory(NtCurrentProcess(), teb_frame, MemoryBasicInformation, &wine_frame_stack_info, sizeof(MEMORY_BASIC_INFORMATION), NULL)) &&
|
|
+ !(NtQueryVirtualMemory(NtCurrentProcess(), (PVOID)context.Rsp, MemoryBasicInformation, ¤t_stack_info, sizeof(MEMORY_BASIC_INFORMATION), NULL)))
|
|
+ {
|
|
+ is_teb_frame_in_current_stack = wine_frame_stack_info.AllocationBase == current_stack_info.AllocationBase;
|
|
+ }
|
|
+
|
|
for (;;)
|
|
{
|
|
status = virtual_unwind( UNW_FLAG_EHANDLER, &dispatch, &context );
|
|
@@ -2482,7 +2491,7 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex
|
|
}
|
|
}
|
|
/* hack: call wine handlers registered in the tib list */
|
|
- else while ((ULONG64)teb_frame < context.Rsp)
|
|
+ else if (is_teb_frame_in_current_stack) while ((ULONG64)teb_frame < context.Rsp)
|
|
{
|
|
TRACE( "found wine frame %p rsp %lx handler %p\n",
|
|
teb_frame, context.Rsp, teb_frame->Handler );
|
|
diff --git a/dlls/ws2_32/Makefile.in b/dlls/ws2_32/Makefile.in
|
|
index 9d7dfafeb3c..c7f24168dac 100644
|
|
--- a/dlls/ws2_32/Makefile.in
|
|
+++ b/dlls/ws2_32/Makefile.in
|
|
@@ -1,6 +1,7 @@
|
|
EXTRADEFS = -DUSE_WS_PREFIX
|
|
MODULE = ws2_32.dll
|
|
IMPORTLIB = ws2_32
|
|
+IMPORTS = kernelbase
|
|
DELAYIMPORTS = iphlpapi user32
|
|
EXTRALIBS = $(POLL_LIBS)
|
|
|