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
af74bd31
Commit
af74bd31
authored
Mar 02, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use syscall dispatcher to restore context in NtSetContextThread.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e990bd46
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
7 deletions
+26
-7
exception.c
dlls/ntdll/tests/exception.c
+1
-1
signal_i386.c
dlls/ntdll/unix/signal_i386.c
+16
-5
import.c
tools/winebuild/import.c
+9
-1
No files found.
dlls/ntdll/tests/exception.c
View file @
af74bd31
...
...
@@ -7762,7 +7762,7 @@ static void test_extended_context(void)
memset
(
&
xs
->
YmmContext
,
0xcc
,
sizeof
(
xs
->
YmmContext
));
bret
=
GetThreadContext
(
thread
,
context
);
ok
(
bret
,
"Got unexpected bret %#x, GetLastError() %u.
\n
"
,
bret
,
GetLastError
());
ok
(
xs
->
Mask
==
(
sizeof
(
void
*
)
==
4
?
4
:
0
)
||
broken
(
sizeof
(
void
*
)
==
4
&&
!
xs
->
Mask
)
/* Win7u */
,
ok
(
!
xs
->
Mask
||
(
sizeof
(
void
*
)
==
4
&&
xs
->
Mask
==
4
)
,
"Got unexpected Mask %s.
\n
"
,
wine_dbgstr_longlong
(
xs
->
Mask
));
for
(
i
=
0
;
i
<
16
*
4
;
++
i
)
ok
(((
ULONG
*
)
&
xs
->
YmmContext
)[
i
]
==
(
xs
->
Mask
?
(
i
<
8
*
4
?
0
:
0x48484848
)
:
0xcccccccc
),
...
...
dlls/ntdll/unix/signal_i386.c
View file @
af74bd31
...
...
@@ -1258,8 +1258,6 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
xsave
->
xstate
.
mask
&=
~
XSTATE_MASK_GSSE
;
}
if
(
!
(
flags
&
CONTEXT_INTEGER
))
frame
->
eax
=
STATUS_SUCCESS
;
signal_restore_full_cpu_context
();
return
STATUS_SUCCESS
;
}
...
...
@@ -2176,9 +2174,22 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext )
struct
xcontext
xcontext
;
init_handler
(
sigcontext
);
save_context
(
&
xcontext
,
sigcontext
);
wait_suspend
(
&
xcontext
.
c
);
restore_context
(
&
xcontext
,
sigcontext
);
if
(
x86_thread_data
()
->
syscall_frame
)
{
DECLSPEC_ALIGN
(
64
)
XSTATE
xs
;
xcontext
.
c
.
ContextFlags
=
CONTEXT_FULL
;
context_init_xstate
(
&
xcontext
.
c
,
&
xs
);
NtGetContextThread
(
GetCurrentThread
(),
&
xcontext
.
c
);
wait_suspend
(
&
xcontext
.
c
);
NtSetContextThread
(
GetCurrentThread
(),
&
xcontext
.
c
);
}
else
{
save_context
(
&
xcontext
,
sigcontext
);
wait_suspend
(
&
xcontext
.
c
);
restore_context
(
&
xcontext
,
sigcontext
);
}
}
...
...
tools/winebuild/import.c
View file @
af74bd31
...
...
@@ -1509,10 +1509,18 @@ static void output_syscall_dispatcher( int count, const char *variant )
output
(
"
\t
frstor (%%ebx)
\n
"
);
output
(
"
\t
fwait
\n
"
);
}
else
else
if
(
!
strcmp
(
variant
,
"_fxsave"
))
{
output
(
"
\t
fxrstor (%%ebx)
\n
"
);
}
else
{
output
(
"
\t
movl %%eax,%%ecx
\n
"
);
output
(
"
\t
movl $7,%%eax
\n
"
);
output
(
"
\t
xorl %%edx,%%edx
\n
"
);
output
(
"
\t
xrstor (%%ebx)
\n
"
);
output
(
"
\t
movl %%ecx,%%eax
\n
"
);
}
output
(
"
\t
leal -0x30(%%ebp),%%ebx
\n
"
);
output_cfi
(
".cfi_def_cfa_register %%ebx"
);
output_cfi
(
".cfi_adjust_cfa_offset 0x30
\n
"
);
...
...
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