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
ff1dfb42
Commit
ff1dfb42
authored
Sep 01, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Work around a Windows pointer truncation bug in CPU info.
parent
5bd5fecb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
exception.c
dlls/ntdll/tests/exception.c
+6
-0
wow64.c
dlls/ntdll/tests/wow64.c
+4
-2
No files found.
dlls/ntdll/tests/exception.c
View file @
ff1dfb42
...
...
@@ -4350,6 +4350,12 @@ static void test_wow64_context(void)
ok
(
cpu
->
Machine
==
IMAGE_FILE_MACHINE_I386
,
"wrong machine %04x
\n
"
,
cpu
->
Machine
);
ret
=
pRtlWow64GetCpuAreaInfo
(
cpu
,
0
,
&
cpu_info
);
ok
(
!
ret
,
"RtlWow64GetCpuAreaInfo failed %lx
\n
"
,
ret
);
/* work around pointer truncation bug on win10 <= 1709 */
if
(
!
((
ULONG_PTR
)
cpu_info
.
Context
>>
32
))
{
cpu_info
.
Context
=
(
char
*
)
cpu
+
(
ULONG
)((
char
*
)
cpu_info
.
Context
-
(
char
*
)
cpu
);
cpu_info
.
ContextEx
=
(
char
*
)
cpu
+
(
ULONG
)((
char
*
)
cpu_info
.
ContextEx
-
(
char
*
)
cpu
);
}
ctx_ptr
=
(
WOW64_CONTEXT
*
)
cpu_info
.
Context
;
ok
(
!*
(
void
**
)
cpu_info
.
ContextEx
,
"got context_ex %p
\n
"
,
*
(
void
**
)
cpu_info
.
ContextEx
);
ok
(
ctx_ptr
->
ContextFlags
==
WOW64_CONTEXT_ALL
,
"got context flags %#lx
\n
"
,
ctx_ptr
->
ContextFlags
);
...
...
dlls/ntdll/tests/wow64.c
View file @
ff1dfb42
...
...
@@ -1340,8 +1340,10 @@ static void test_cpu_area(void)
status
=
pRtlWow64GetCpuAreaInfo
(
cpu
,
0
,
&
info
);
ok
(
status
==
tests
[
i
].
expect
,
"%lu:%lu: failed %lx
\n
"
,
i
,
j
,
status
);
if
(
status
)
continue
;
ok
(
info
.
Context
==
ALIGN
(
cpu
+
1
,
tests
[
i
].
align
),
"%lu:%lu: wrong offset %lu
\n
"
,
i
,
j
,
(
ULONG
)((
char
*
)
info
.
Context
-
(
char
*
)
cpu
)
);
ok
(
info
.
Context
==
ALIGN
(
cpu
+
1
,
tests
[
i
].
align
)
||
broken
(
(
ULONG_PTR
)
info
.
Context
==
(
ULONG
)(
ULONG_PTR
)
ALIGN
(
cpu
+
1
,
tests
[
i
].
align
)
),
/* win10 <= 1709 */
"%lu:%lu: wrong offset %Iu cpu %p context %p
\n
"
,
i
,
j
,
(
ULONG_PTR
)((
char
*
)
info
.
Context
-
(
char
*
)
cpu
),
cpu
,
info
.
Context
);
ok
(
info
.
ContextEx
==
ALIGN
(
(
char
*
)
info
.
Context
+
tests
[
i
].
size
,
sizeof
(
void
*
)
),
"%lu:%lu: wrong ex offset %lu
\n
"
,
i
,
j
,
(
ULONG
)((
char
*
)
info
.
ContextEx
-
(
char
*
)
cpu
)
);
ok
(
info
.
ContextFlagsLocation
==
(
char
*
)
info
.
Context
+
tests
[
i
].
offset
,
...
...
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