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
a9828988
Commit
a9828988
authored
Jul 27, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add a test for a Wow64-only syscall.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d457b14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
15 deletions
+26
-15
wow64.c
dlls/ntdll/tests/wow64.c
+26
-15
No files found.
dlls/ntdll/tests/wow64.c
View file @
a9828988
...
...
@@ -1176,24 +1176,16 @@ static void test_iosb(void)
static
NTSTATUS
invoke_syscall
(
const
char
*
name
,
ULONG
args32
[]
)
{
NTSTATUS
status
;
ULONG64
args64
[]
=
{
-
1
,
PtrToUlong
(
args32
)
};
ULONG64
ptr
,
res
,
func
=
get_proc_address64
(
wow64_module
,
"Wow64SystemServiceEx"
);
BYTE
syscall
[
32
]
;
ULONG64
func
=
get_proc_address64
(
wow64_module
,
"Wow64SystemServiceEx"
);
BYTE
*
syscall
=
(
BYTE
*
)
GetProcAddress
(
GetModuleHandleA
(
"ntdll.dll"
),
name
)
;
if
(
!
(
ptr
=
get_proc_address64
(
ntdll_module
,
name
)))
return
STATUS_NOT_IMPLEMENTED
;
ok
(
syscall
!=
NULL
,
"syscall %s not found
\n
"
,
name
);
if
(
syscall
[
0
]
==
0xb8
)
args64
[
0
]
=
*
(
DWORD
*
)(
syscall
+
1
);
else
win_skip
(
"syscall thunk %s not recognized
\n
"
,
name
);
if
(
pNtWow64ReadVirtualMemory64
)
{
HANDLE
process
=
OpenProcess
(
PROCESS_ALL_ACCESS
,
FALSE
,
GetCurrentProcessId
()
);
status
=
pNtWow64ReadVirtualMemory64
(
process
,
ptr
,
syscall
,
sizeof
(
syscall
),
&
res
);
ok
(
!
status
,
"NtWow64ReadVirtualMemory64 failed %x
\n
"
,
status
);
if
(
syscall
[
0
]
==
0x4c
&&
syscall
[
1
]
==
0x8b
&&
syscall
[
2
]
==
0xd1
&&
syscall
[
3
]
==
0xb8
)
args64
[
0
]
=
*
(
DWORD
*
)(
syscall
+
4
);
else
win_skip
(
"syscall thunk not recognized
\n
"
);
NtClose
(
process
);
}
return
call_func64
(
func
,
ARRAY_SIZE
(
args64
),
args64
);
}
...
...
@@ -1262,6 +1254,25 @@ static void test_syscalls(void)
status
=
NtClose
(
event
);
ok
(
!
status
,
"NtClose failed %x
\n
"
,
status
);
if
(
pNtWow64ReadVirtualMemory64
)
{
TEB64
*
teb64
=
(
TEB64
*
)
NtCurrentTeb
()
->
GdiBatchCount
;
PEB64
peb64
,
peb64_2
;
ULONG64
res
,
res2
;
HANDLE
process
=
OpenProcess
(
PROCESS_ALL_ACCESS
,
FALSE
,
GetCurrentProcessId
()
);
ULONG
args32
[]
=
{
HandleToLong
(
process
),
(
ULONG
)
teb64
->
Peb
,
teb64
->
Peb
>>
32
,
PtrToUlong
(
&
peb64_2
),
sizeof
(
peb64_2
),
0
,
PtrToUlong
(
&
res2
)
};
ok
(
process
!=
0
,
"failed to open current process %u
\n
"
,
GetLastError
()
);
status
=
pNtWow64ReadVirtualMemory64
(
process
,
teb64
->
Peb
,
&
peb64
,
sizeof
(
peb64
),
&
res
);
ok
(
!
status
,
"NtWow64ReadVirtualMemory64 failed %x
\n
"
,
status
);
status
=
invoke_syscall
(
"NtWow64ReadVirtualMemory64"
,
args32
);
ok
(
!
status
,
"NtWow64ReadVirtualMemory64 failed %x
\n
"
,
status
);
ok
(
res2
==
res
,
"wrong len %s / %s
\n
"
,
wine_dbgstr_longlong
(
res
),
wine_dbgstr_longlong
(
res2
)
);
ok
(
!
memcmp
(
&
peb64
,
&
peb64_2
,
res
),
"data is different
\n
"
);
NtClose
(
process
);
}
}
static
void
test_cpu_area
(
void
)
...
...
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