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
751d2529
Commit
751d2529
authored
Jan 11, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Apr 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Factor out context_copy_ranges() function.
(cherry picked from commit
4679b556
)
parent
3450a5ec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
24 deletions
+27
-24
exception.c
dlls/ntdll/exception.c
+27
-24
No files found.
dlls/ntdll/exception.c
View file @
751d2529
...
@@ -961,6 +961,32 @@ ULONG64 WINAPI RtlGetExtendedFeaturesMask( CONTEXT_EX *context_ex )
...
@@ -961,6 +961,32 @@ ULONG64 WINAPI RtlGetExtendedFeaturesMask( CONTEXT_EX *context_ex )
}
}
static
void
context_copy_ranges
(
BYTE
*
d
,
DWORD
context_flags
,
BYTE
*
s
,
const
struct
context_parameters
*
p
)
{
const
struct
context_copy_range
*
range
;
unsigned
int
start
;
*
((
ULONG
*
)(
d
+
p
->
flags_offset
))
|=
context_flags
;
start
=
0
;
range
=
p
->
copy_ranges
;
do
{
if
(
range
->
flag
&
context_flags
)
{
if
(
!
start
)
start
=
range
->
start
;
}
else
if
(
start
)
{
memcpy
(
d
+
start
,
s
+
start
,
range
->
start
-
start
);
start
=
0
;
}
}
while
(
range
++->
start
!=
p
->
context_size
);
}
/***********************************************************************
/***********************************************************************
* RtlCopyContext (NTDLL.@)
* RtlCopyContext (NTDLL.@)
*/
*/
...
@@ -1010,12 +1036,9 @@ NTSTATUS WINAPI RtlCopyContext( CONTEXT *dst, DWORD context_flags, CONTEXT *src
...
@@ -1010,12 +1036,9 @@ NTSTATUS WINAPI RtlCopyContext( CONTEXT *dst, DWORD context_flags, CONTEXT *src
*/
*/
NTSTATUS
WINAPI
RtlCopyExtendedContext
(
CONTEXT_EX
*
dst
,
ULONG
context_flags
,
CONTEXT_EX
*
src
)
NTSTATUS
WINAPI
RtlCopyExtendedContext
(
CONTEXT_EX
*
dst
,
ULONG
context_flags
,
CONTEXT_EX
*
src
)
{
{
const
struct
context_copy_range
*
range
;
const
struct
context_parameters
*
p
;
const
struct
context_parameters
*
p
;
XSTATE
*
dst_xs
,
*
src_xs
;
XSTATE
*
dst_xs
,
*
src_xs
;
ULONG64
feature_mask
;
ULONG64
feature_mask
;
unsigned
int
start
;
BYTE
*
d
,
*
s
;
TRACE
(
"dst %p, context_flags %#lx, src %p.
\n
"
,
dst
,
context_flags
,
src
);
TRACE
(
"dst %p, context_flags %#lx, src %p.
\n
"
,
dst
,
context_flags
,
src
);
...
@@ -1025,27 +1048,7 @@ NTSTATUS WINAPI RtlCopyExtendedContext( CONTEXT_EX *dst, ULONG context_flags, CO
...
@@ -1025,27 +1048,7 @@ NTSTATUS WINAPI RtlCopyExtendedContext( CONTEXT_EX *dst, ULONG context_flags, CO
if
(
!
(
feature_mask
=
RtlGetEnabledExtendedFeatures
(
~
(
ULONG64
)
0
))
&&
context_flags
&
0x40
)
if
(
!
(
feature_mask
=
RtlGetEnabledExtendedFeatures
(
~
(
ULONG64
)
0
))
&&
context_flags
&
0x40
)
return
STATUS_NOT_SUPPORTED
;
return
STATUS_NOT_SUPPORTED
;
d
=
RtlLocateLegacyContext
(
dst
,
NULL
);
context_copy_ranges
(
RtlLocateLegacyContext
(
dst
,
NULL
),
context_flags
,
RtlLocateLegacyContext
(
src
,
NULL
),
p
);
s
=
RtlLocateLegacyContext
(
src
,
NULL
);
*
((
ULONG
*
)(
d
+
p
->
flags_offset
))
|=
context_flags
;
start
=
0
;
range
=
p
->
copy_ranges
;
do
{
if
(
range
->
flag
&
context_flags
)
{
if
(
!
start
)
start
=
range
->
start
;
}
else
if
(
start
)
{
memcpy
(
d
+
start
,
s
+
start
,
range
->
start
-
start
);
start
=
0
;
}
}
while
(
range
++->
start
!=
p
->
context_size
);
if
(
!
(
context_flags
&
0x40
))
if
(
!
(
context_flags
&
0x40
))
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
...
...
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