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
1cddd8d5
Commit
1cddd8d5
authored
Aug 31, 2021
by
Eric Pouech
Committed by
Alexandre Julliard
Aug 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Fix SymInitialize for a live 32bit target from a 64bit caller in WOW64.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4a03ffc1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
dbghelp.c
dlls/dbghelp/dbghelp.c
+10
-4
No files found.
dlls/dbghelp/dbghelp.c
View file @
1cddd8d5
...
...
@@ -286,7 +286,7 @@ const WCHAR *process_getenv(const struct process *process, const WCHAR *name)
* check_live_target
*
*/
static
BOOL
check_live_target
(
struct
process
*
pcs
)
static
BOOL
check_live_target
(
struct
process
*
pcs
,
BOOL
wow64
,
BOOL
child_wow64
)
{
PROCESS_BASIC_INFORMATION
pbi
;
ULONG_PTR
base
=
0
,
env
=
0
;
...
...
@@ -300,11 +300,17 @@ static BOOL check_live_target(struct process* pcs)
if
(
!
pcs
->
is_64bit
)
{
const
char
*
peb32_addr
;
DWORD
env32
;
PEB32
peb32
;
C_ASSERT
(
sizeof
(
void
*
)
!=
4
||
FIELD_OFFSET
(
RTL_USER_PROCESS_PARAMETERS
,
Environment
)
==
0x48
);
if
(
!
ReadProcessMemory
(
pcs
->
handle
,
pbi
.
PebBaseAddress
,
&
peb32
,
sizeof
(
peb32
),
NULL
))
return
FALSE
;
if
(
!
ReadProcessMemory
(
pcs
->
handle
,
(
char
*
)
pbi
.
PebBaseAddress
+
0x460
/* CloudFileFlags */
,
&
base
,
sizeof
(
base
),
NULL
))
return
FALSE
;
peb32_addr
=
(
const
char
*
)
pbi
.
PebBaseAddress
;
if
(
!
wow64
&&
child_wow64
)
/* current process is 64bit, while child process is 32 bit, need to read 32bit PEB */
peb32_addr
+=
0x1000
;
if
(
!
ReadProcessMemory
(
pcs
->
handle
,
peb32_addr
,
&
peb32
,
sizeof
(
peb32
),
NULL
))
return
FALSE
;
if
(
!
ReadProcessMemory
(
pcs
->
handle
,
peb32_addr
+
0x460
/* CloudFileFlags */
,
&
base
,
sizeof
(
base
),
NULL
))
return
FALSE
;
if
(
read_process_memory
(
pcs
,
peb32
.
ProcessParameters
+
0x48
,
&
env32
,
sizeof
(
env32
)))
env
=
env32
;
}
else
...
...
@@ -454,7 +460,7 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP
pcs
->
next
=
process_first
;
process_first
=
pcs
;
if
(
check_live_target
(
pcs
))
if
(
check_live_target
(
pcs
,
wow64
,
child_wow64
))
{
if
(
fInvadeProcess
)
EnumerateLoadedModulesW64
(
hProcess
,
process_invade_cb
,
hProcess
);
...
...
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