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
fb5cfacc
Commit
fb5cfacc
authored
Jul 11, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Return the 32-bit PEB for NtQueryInformationProcess(ProcessWow64Information).
parent
7e521b4d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
info.c
dlls/ntdll/tests/info.c
+4
-1
wow64.c
dlls/ntdll/tests/wow64.c
+7
-0
process.c
dlls/ntdll/unix/process.c
+6
-5
No files found.
dlls/ntdll/tests/info.c
View file @
fb5cfacc
...
...
@@ -1735,7 +1735,8 @@ static void test_query_process_wow64(void)
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
is_wow64
==
(
pbi
[
0
]
!=
0
),
"is_wow64 %x, pbi[0] %Ix
\n
"
,
is_wow64
,
pbi
[
0
]);
ok
(
pbi
[
0
]
!=
dummy
,
"pbi[0] %Ix
\n
"
,
pbi
[
0
]);
if
(
is_wow64
)
ok
(
(
void
*
)
pbi
[
0
]
==
NtCurrentTeb
()
->
Peb
,
"pbi[0] %Ix / %p
\n
"
,
pbi
[
0
],
NtCurrentTeb
()
->
Peb
);
ok
(
pbi
[
1
]
==
dummy
,
"pbi[1] changed to %Ix
\n
"
,
pbi
[
1
]);
/* Test written size on 64 bit by checking high 32 bit buffer */
if
(
sizeof
(
ULONG_PTR
)
>
sizeof
(
DWORD
))
...
...
@@ -1750,6 +1751,8 @@ static void test_query_process_wow64(void)
status
=
NtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessWow64Information
,
pbi
,
sizeof
(
ULONG_PTR
),
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08lx
\n
"
,
status
);
ok
(
is_wow64
==
(
pbi
[
0
]
!=
0
),
"is_wow64 %x, pbi[0] %Ix
\n
"
,
is_wow64
,
pbi
[
0
]);
if
(
is_wow64
)
ok
(
(
void
*
)
pbi
[
0
]
==
NtCurrentTeb
()
->
Peb
,
"pbi[0] %Ix / %p
\n
"
,
pbi
[
0
],
NtCurrentTeb
()
->
Peb
);
ok
(
pbi
[
1
]
==
dummy
,
"pbi[1] changed to %Ix
\n
"
,
pbi
[
1
]);
ok
(
ReturnLength
==
sizeof
(
ULONG_PTR
),
"Inconsistent length %ld
\n
"
,
ReturnLength
);
...
...
dlls/ntdll/tests/wow64.c
View file @
fb5cfacc
...
...
@@ -277,6 +277,7 @@ static void test_peb_teb(void)
PEB32
peb32
;
RTL_USER_PROCESS_PARAMETERS
params
;
RTL_USER_PROCESS_PARAMETERS32
params32
;
ULONG_PTR
peb_ptr
;
Wow64DisableWow64FsRedirection
(
&
redir
);
...
...
@@ -317,6 +318,12 @@ static void test_peb_teb(void)
ok
(
!
status
,
"ProcessBasicInformation failed %lx
\n
"
,
status
);
ok
(
proc_info
.
PebBaseAddress
==
teb
.
Peb
,
"wrong peb %p / %p
\n
"
,
proc_info
.
PebBaseAddress
,
teb
.
Peb
);
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessWow64Information
,
&
peb_ptr
,
sizeof
(
peb_ptr
),
NULL
);
ok
(
!
status
,
"ProcessWow64Information failed %lx
\n
"
,
status
);
ok
(
(
void
*
)
peb_ptr
==
(
is_wow64
?
teb
.
Peb
:
ULongToPtr
(
teb32
.
Peb
)),
"wrong peb %p
\n
"
,
(
void
*
)
peb_ptr
);
if
(
!
ReadProcessMemory
(
pi
.
hProcess
,
proc_info
.
PebBaseAddress
,
&
peb
,
sizeof
(
peb
),
&
res
))
res
=
0
;
ok
(
res
==
sizeof
(
peb
),
"wrong len %Ix
\n
"
,
res
);
ok
(
!
peb
.
BeingDebugged
,
"BeingDebugged is %u
\n
"
,
peb
.
BeingDebugged
);
...
...
dlls/ntdll/unix/process.c
View file @
fb5cfacc
...
...
@@ -1430,9 +1430,8 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
case
ProcessWow64Information
:
len
=
sizeof
(
ULONG_PTR
);
if
(
size
!=
len
)
return
STATUS_INFO_LENGTH_MISMATCH
;
else
if
(
!
info
)
ret
=
STATUS_ACCESS_VIOLATION
;
else
if
(
!
handle
)
ret
=
STATUS_INVALID_HANDLE
;
else
if
(
handle
==
GetCurrentProcess
())
*
(
ULONG_PTR
*
)
info
=
is_wow64
();
if
(
handle
==
GetCurrentProcess
())
*
(
ULONG_PTR
*
)
info
=
is_old_wow64
()
?
(
ULONG_PTR
)
peb
:
(
ULONG_PTR
)
wow_peb
;
else
{
ULONG_PTR
val
=
0
;
...
...
@@ -1440,10 +1439,12 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
SERVER_START_REQ
(
get_process_info
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
if
(
!
(
ret
=
wine_server_call
(
req
)))
val
=
(
reply
->
machine
!=
native_machine
);
ret
=
wine_server_call
(
req
);
if
(
!
ret
&&
!
is_machine_64bit
(
reply
->
machine
)
&&
is_machine_64bit
(
native_machine
))
val
=
reply
->
peb
+
0x1000
;
}
SERVER_END_REQ
;
*
(
ULONG_PTR
*
)
info
=
val
;
if
(
!
ret
)
*
(
ULONG_PTR
*
)
info
=
val
;
}
break
;
...
...
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