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
4c50ef69
Commit
4c50ef69
authored
Jul 05, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add RtlRestoreContext implementation.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9729d15a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
34 deletions
+41
-34
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-1
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+39
-33
No files found.
dlls/kernel32/kernel32.spec
View file @
4c50ef69
...
...
@@ -1293,7 +1293,7 @@
@ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory
@ stdcall -arch=x86_64,arm RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader
@ stdcall -arch=arm -register RtlRaiseException(ptr) ntdll.RtlRaiseException
# @ stub -arch=x86_64
RtlRestoreContext
@ stdcall -arch=x86_64 RtlRestoreContext(ptr ptr) ntdll.
RtlRestoreContext
@ stdcall RtlUnwind(ptr ptr ptr long) ntdll.RtlUnwind
@ stdcall -arch=x86_64 RtlUnwindEx(long long ptr long ptr) ntdll.RtlUnwindEx
@ stdcall -arch=x86_64 RtlVirtualUnwind(long long long ptr ptr ptr ptr ptr) ntdll.RtlVirtualUnwind
...
...
dlls/ntdll/ntdll.spec
View file @
4c50ef69
...
...
@@ -838,6 +838,7 @@
@ stdcall RtlRemoveVectoredContinueHandler(ptr)
@ stdcall RtlRemoveVectoredExceptionHandler(ptr)
@ stub RtlResetRtlTranslations
@ stdcall -arch=x86_64 RtlRestoreContext(ptr ptr)
@ stdcall RtlRestoreLastWin32Error(long) RtlSetLastWin32Error
@ stub RtlRevertMemoryStream
@ stub RtlRunDecodeUnicodeString
...
...
dlls/ntdll/signal_x86_64.c
View file @
4c50ef69
...
...
@@ -3437,6 +3437,44 @@ __ASM_GLOBAL_FUNC( call_consolidate_callback,
__ASM_CFI
(
".cfi_same_value %rbp
\n\t
"
)
"ret"
)
/*******************************************************************
* RtlRestoreContext (NTDLL.@)
*/
void
WINAPI
RtlRestoreContext
(
CONTEXT
*
context
,
EXCEPTION_RECORD
*
rec
)
{
if
(
rec
&&
rec
->
ExceptionCode
==
STATUS_LONGJUMP
&&
rec
->
NumberParameters
>=
1
)
{
struct
MSVCRT_JUMP_BUFFER
*
jmp
=
(
struct
MSVCRT_JUMP_BUFFER
*
)
rec
->
ExceptionInformation
[
0
];
context
->
Rbx
=
jmp
->
Rbx
;
context
->
Rsp
=
jmp
->
Rsp
;
context
->
Rbp
=
jmp
->
Rbp
;
context
->
Rsi
=
jmp
->
Rsi
;
context
->
Rdi
=
jmp
->
Rdi
;
context
->
R12
=
jmp
->
R12
;
context
->
R13
=
jmp
->
R13
;
context
->
R14
=
jmp
->
R14
;
context
->
R15
=
jmp
->
R15
;
context
->
u
.
s
.
Xmm6
=
jmp
->
Xmm6
;
context
->
u
.
s
.
Xmm7
=
jmp
->
Xmm7
;
context
->
u
.
s
.
Xmm8
=
jmp
->
Xmm8
;
context
->
u
.
s
.
Xmm9
=
jmp
->
Xmm9
;
context
->
u
.
s
.
Xmm10
=
jmp
->
Xmm10
;
context
->
u
.
s
.
Xmm11
=
jmp
->
Xmm11
;
context
->
u
.
s
.
Xmm12
=
jmp
->
Xmm12
;
context
->
u
.
s
.
Xmm13
=
jmp
->
Xmm13
;
context
->
u
.
s
.
Xmm14
=
jmp
->
Xmm14
;
context
->
u
.
s
.
Xmm15
=
jmp
->
Xmm15
;
}
else
if
(
rec
&&
rec
->
ExceptionCode
==
STATUS_UNWIND_CONSOLIDATE
&&
rec
->
NumberParameters
>=
1
)
{
PVOID
(
CALLBACK
*
consolidate
)(
EXCEPTION_RECORD
*
)
=
(
void
*
)
rec
->
ExceptionInformation
[
0
];
TRACE
(
"calling consolidate callback %p (rec=%p)
\n
"
,
consolidate
,
rec
);
context
->
Rip
=
(
ULONG64
)
call_consolidate_callback
(
context
,
consolidate
,
rec
);
}
TRACE
(
"returning to %lx stack %lx
\n
"
,
context
->
Rip
,
context
->
Rsp
);
set_cpu_context
(
context
);
}
/*******************************************************************
* RtlUnwindEx (NTDLL.@)
...
...
@@ -3597,41 +3635,9 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec
*
context
=
new_context
;
}
if
(
rec
->
ExceptionCode
==
STATUS_LONGJUMP
&&
rec
->
NumberParameters
>=
1
)
{
struct
MSVCRT_JUMP_BUFFER
*
jmp
=
(
struct
MSVCRT_JUMP_BUFFER
*
)
rec
->
ExceptionInformation
[
0
];
context
->
Rbx
=
jmp
->
Rbx
;
context
->
Rsp
=
jmp
->
Rsp
;
context
->
Rbp
=
jmp
->
Rbp
;
context
->
Rsi
=
jmp
->
Rsi
;
context
->
Rdi
=
jmp
->
Rdi
;
context
->
R12
=
jmp
->
R12
;
context
->
R13
=
jmp
->
R13
;
context
->
R14
=
jmp
->
R14
;
context
->
R15
=
jmp
->
R15
;
context
->
Rip
=
jmp
->
Rip
;
context
->
u
.
s
.
Xmm6
=
jmp
->
Xmm6
;
context
->
u
.
s
.
Xmm7
=
jmp
->
Xmm7
;
context
->
u
.
s
.
Xmm8
=
jmp
->
Xmm8
;
context
->
u
.
s
.
Xmm9
=
jmp
->
Xmm9
;
context
->
u
.
s
.
Xmm10
=
jmp
->
Xmm10
;
context
->
u
.
s
.
Xmm11
=
jmp
->
Xmm11
;
context
->
u
.
s
.
Xmm12
=
jmp
->
Xmm12
;
context
->
u
.
s
.
Xmm13
=
jmp
->
Xmm13
;
context
->
u
.
s
.
Xmm14
=
jmp
->
Xmm14
;
context
->
u
.
s
.
Xmm15
=
jmp
->
Xmm15
;
}
else
if
(
rec
->
ExceptionCode
==
STATUS_UNWIND_CONSOLIDATE
&&
rec
->
NumberParameters
>=
1
)
{
PVOID
(
CALLBACK
*
consolidate
)(
EXCEPTION_RECORD
*
)
=
(
void
*
)
rec
->
ExceptionInformation
[
0
];
TRACE
(
"calling consolidate callback %p (rec=%p)
\n
"
,
consolidate
,
rec
);
target_ip
=
call_consolidate_callback
(
context
,
consolidate
,
rec
);
TRACE
(
"-> target=%p
\n
"
,
target_ip
);
}
context
->
Rax
=
(
ULONG64
)
retval
;
context
->
Rip
=
(
ULONG64
)
target_ip
;
TRACE
(
"returning to %lx stack %lx
\n
"
,
context
->
Rip
,
context
->
Rsp
);
set_cpu_context
(
context
);
RtlRestoreContext
(
context
,
rec
);
}
...
...
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