Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
57550776
Commit
57550776
authored
Feb 10, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Added emulation of ATL thunks for platforms with NX support.
parent
d7187d79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
signal_i386.c
dlls/ntdll/signal_i386.c
+32
-1
No files found.
dlls/ntdll/signal_i386.c
View file @
57550776
...
...
@@ -902,6 +902,34 @@ static inline int is_privileged_instr( CONTEXT86 *context )
}
#include "pshpack1.h"
struct
atl_thunk
{
DWORD
movl
;
/* movl this,4(%esp) */
DWORD
this
;
BYTE
jmp
;
/* jmp func */
int
func
;
};
#include "poppack.h"
/**********************************************************************
* check_atl_thunk
*
* Check if code destination is an ATL thunk, and emulate it if so.
*/
static
BOOL
check_atl_thunk
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
)
{
struct
atl_thunk
*
thunk
=
(
struct
atl_thunk
*
)
rec
->
ExceptionInformation
[
1
];
if
(
thunk
->
movl
!=
0x042444c7
||
thunk
->
jmp
!=
0xe9
)
return
FALSE
;
*
((
DWORD
*
)
context
->
Esp
+
1
)
=
thunk
->
this
;
context
->
Eip
=
(
DWORD_PTR
)(
&
thunk
->
func
+
1
)
+
thunk
->
func
;
TRACE
(
"emulating ATL thunk at %p, func=%08lx arg=%08lx
\n
"
,
thunk
,
context
->
Eip
,
*
((
DWORD
*
)
context
->
Esp
+
1
)
);
return
TRUE
;
}
/***********************************************************************
* setup_exception
*
...
...
@@ -1026,7 +1054,10 @@ static void WINAPI raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context
{
case
EXCEPTION_ACCESS_VIOLATION
:
if
(
rec
->
NumberParameters
==
2
)
{
if
((
rec
->
ExceptionInformation
[
0
]
==
8
)
&&
check_atl_thunk
(
rec
,
context
))
goto
done
;
rec
->
ExceptionCode
=
VIRTUAL_HandleFault
(
(
void
*
)
rec
->
ExceptionInformation
[
1
]
);
}
break
;
case
EXCEPTION_DATATYPE_MISALIGNMENT
:
/* FIXME: pass through exception handler first? */
...
...
@@ -1175,7 +1206,7 @@ static HANDLER_DEF(segv_handler)
rec
->
ExceptionCode
=
EXCEPTION_ACCESS_VIOLATION
;
#ifdef FAULT_ADDRESS
rec
->
NumberParameters
=
2
;
rec
->
ExceptionInformation
[
0
]
=
(
get_error_code
(
HANDLER_CONTEXT
)
&
2
)
!=
0
;
rec
->
ExceptionInformation
[
0
]
=
(
get_error_code
(
HANDLER_CONTEXT
)
>>
1
)
&
0x09
;
rec
->
ExceptionInformation
[
1
]
=
(
ULONG_PTR
)
FAULT_ADDRESS
;
#endif
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment