Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e8a1341f
Commit
e8a1341f
authored
May 18, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add platform-specific helpers for getting/setting the Wow64 context.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ee0b909f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
24 deletions
+101
-24
signal_arm.c
dlls/ntdll/unix/signal_arm.c
+18
-0
signal_arm64.c
dlls/ntdll/unix/signal_arm64.c
+36
-0
signal_i386.c
dlls/ntdll/unix/signal_i386.c
+18
-0
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+25
-0
thread.c
dlls/ntdll/unix/thread.c
+2
-24
unix_private.h
dlls/ntdll/unix/unix_private.h
+2
-0
No files found.
dlls/ntdll/unix/signal_arm.c
View file @
e8a1341f
...
...
@@ -412,6 +412,24 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
/***********************************************************************
* set_thread_wow64_context
*/
NTSTATUS
set_thread_wow64_context
(
HANDLE
handle
,
const
void
*
ctx
,
ULONG
size
)
{
return
STATUS_INVALID_INFO_CLASS
;
}
/***********************************************************************
* get_thread_wow64_context
*/
NTSTATUS
get_thread_wow64_context
(
HANDLE
handle
,
void
*
ctx
,
ULONG
size
)
{
return
STATUS_INVALID_INFO_CLASS
;
}
/***********************************************************************
* setup_exception
*
* Modify the signal context to call the exception raise function.
...
...
dlls/ntdll/unix/signal_arm64.c
View file @
e8a1341f
...
...
@@ -481,6 +481,42 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
}
/***********************************************************************
* set_thread_wow64_context
*/
NTSTATUS
set_thread_wow64_context
(
HANDLE
handle
,
const
void
*
ctx
,
ULONG
size
)
{
BOOL
self
;
USHORT
machine
;
switch
(
size
)
{
case
sizeof
(
I386_CONTEXT
):
machine
=
IMAGE_FILE_MACHINE_I386
;
break
;
case
sizeof
(
ARM_CONTEXT
):
machine
=
IMAGE_FILE_MACHINE_ARMNT
;
break
;
default:
return
STATUS_INFO_LENGTH_MISMATCH
;
}
return
set_thread_context
(
handle
,
ctx
,
&
self
,
machine
);
}
/***********************************************************************
* get_thread_wow64_context
*/
NTSTATUS
get_thread_wow64_context
(
HANDLE
handle
,
void
*
ctx
,
ULONG
size
)
{
BOOL
self
;
USHORT
machine
;
switch
(
size
)
{
case
sizeof
(
I386_CONTEXT
):
machine
=
IMAGE_FILE_MACHINE_I386
;
break
;
case
sizeof
(
ARM_CONTEXT
):
machine
=
IMAGE_FILE_MACHINE_ARMNT
;
break
;
default:
return
STATUS_INFO_LENGTH_MISMATCH
;
}
return
get_thread_context
(
handle
,
ctx
,
&
self
,
machine
);
}
/* Note, unwind_builtin_dll above has hardcoded assumptions on how this
* function stores things on the stack; if modified, modify that one in
* sync as well. */
...
...
dlls/ntdll/unix/signal_i386.c
View file @
e8a1341f
...
...
@@ -1256,6 +1256,24 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
/***********************************************************************
* set_thread_wow64_context
*/
NTSTATUS
set_thread_wow64_context
(
HANDLE
handle
,
const
void
*
ctx
,
ULONG
size
)
{
return
STATUS_INVALID_INFO_CLASS
;
}
/***********************************************************************
* get_thread_wow64_context
*/
NTSTATUS
get_thread_wow64_context
(
HANDLE
handle
,
void
*
ctx
,
ULONG
size
)
{
return
STATUS_INVALID_INFO_CLASS
;
}
/***********************************************************************
* is_privileged_instr
*
* Check if the fault location is a privileged instruction.
...
...
dlls/ntdll/unix/signal_x86_64.c
View file @
e8a1341f
...
...
@@ -1849,6 +1849,31 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
return
STATUS_SUCCESS
;
}
/***********************************************************************
* set_thread_wow64_context
*/
NTSTATUS
set_thread_wow64_context
(
HANDLE
handle
,
const
void
*
ctx
,
ULONG
size
)
{
BOOL
self
;
if
(
size
!=
sizeof
(
I386_CONTEXT
))
return
STATUS_INFO_LENGTH_MISMATCH
;
return
set_thread_context
(
handle
,
ctx
,
&
self
,
IMAGE_FILE_MACHINE_I386
);
}
/***********************************************************************
* get_thread_wow64_context
*/
NTSTATUS
get_thread_wow64_context
(
HANDLE
handle
,
void
*
ctx
,
ULONG
size
)
{
BOOL
self
;
if
(
size
!=
sizeof
(
I386_CONTEXT
))
return
STATUS_INFO_LENGTH_MISMATCH
;
return
get_thread_context
(
handle
,
ctx
,
&
self
,
IMAGE_FILE_MACHINE_I386
);
}
extern
void
CDECL
raise_func_trampoline
(
void
*
dispatcher
);
__ASM_GLOBAL_FUNC
(
raise_func_trampoline
,
...
...
dlls/ntdll/unix/thread.c
View file @
e8a1341f
...
...
@@ -1665,19 +1665,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
}
case
ThreadWow64Context
:
{
#ifdef _WIN64
BOOL
self
;
WOW64_CONTEXT
*
context
=
data
;
if
(
length
!=
sizeof
(
*
context
))
return
STATUS_INFO_LENGTH_MISMATCH
;
if
((
status
=
get_thread_context
(
handle
,
context
,
&
self
,
IMAGE_FILE_MACHINE_I386
)))
return
status
;
if
(
ret_len
&&
!
status
)
*
ret_len
=
sizeof
(
*
context
);
return
status
;
#else
return
STATUS_INVALID_INFO_CLASS
;
#endif
}
return
get_thread_wow64_context
(
handle
,
data
,
length
);
case
ThreadHideFromDebugger
:
if
(
length
!=
sizeof
(
BOOLEAN
))
return
STATUS_INFO_LENGTH_MISMATCH
;
...
...
@@ -1860,17 +1848,7 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
}
case
ThreadWow64Context
:
{
#ifdef _WIN64
BOOL
self
;
const
WOW64_CONTEXT
*
context
=
data
;
if
(
length
!=
sizeof
(
*
context
))
return
STATUS_INFO_LENGTH_MISMATCH
;
return
set_thread_context
(
handle
,
context
,
&
self
,
IMAGE_FILE_MACHINE_I386
);
#else
return
STATUS_INVALID_INFO_CLASS
;
#endif
}
return
set_thread_wow64_context
(
handle
,
data
,
length
);
case
ThreadEnableAlignmentFaultFixup
:
if
(
length
!=
sizeof
(
BOOLEAN
))
return
STATUS_INFO_LENGTH_MISMATCH
;
...
...
dlls/ntdll/unix/unix_private.h
View file @
e8a1341f
...
...
@@ -236,6 +236,8 @@ extern void DECLSPEC_NORETURN signal_start_thread( PRTL_THREAD_START_ROUTINE ent
extern
void
DECLSPEC_NORETURN
signal_exit_thread
(
int
status
,
void
(
*
func
)(
int
)
)
DECLSPEC_HIDDEN
;
extern
void
__wine_syscall_dispatcher
(
void
)
DECLSPEC_HIDDEN
;
extern
void
signal_restore_full_cpu_context
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
get_thread_wow64_context
(
HANDLE
handle
,
void
*
ctx
,
ULONG
size
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
set_thread_wow64_context
(
HANDLE
handle
,
const
void
*
ctx
,
ULONG
size
)
DECLSPEC_HIDDEN
;
extern
void
fill_vm_counters
(
VM_COUNTERS_EX
*
pvmi
,
int
unix_pid
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
open_hkcu_key
(
const
char
*
path
,
HANDLE
*
key
)
DECLSPEC_HIDDEN
;
...
...
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