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
aac4e9df
Commit
aac4e9df
authored
Feb 01, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Filter on machine when searching for Wine system PE modules.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
parent
4d2cbb41
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
9 deletions
+9
-9
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+2
-2
elf_module.c
dlls/dbghelp/elf_module.c
+1
-1
macho_module.c
dlls/dbghelp/macho_module.c
+1
-1
path.c
dlls/dbghelp/path.c
+3
-2
pe_module.c
dlls/dbghelp/pe_module.c
+2
-1
dbghelp.c
dlls/dbghelp/tests/dbghelp.c
+0
-2
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
aac4e9df
...
...
@@ -764,8 +764,8 @@ extern BOOL path_find_symbol_file(const struct process* pcs, const struc
PCSTR
full_path
,
enum
module_type
type
,
const
GUID
*
guid
,
DWORD
dw1
,
DWORD
dw2
,
WCHAR
*
buffer
,
BOOL
*
is_unmatched
)
DECLSPEC_HIDDEN
;
extern
WCHAR
*
get_dos_file_name
(
const
WCHAR
*
filename
)
__WINE_DEALLOC
(
HeapFree
,
3
)
__WINE_MALLOC
DECLSPEC_HIDDEN
;
extern
BOOL
search_dll_path
(
const
struct
process
*
process
,
const
WCHAR
*
nam
e
,
BOOL
(
*
match
)(
void
*
,
HANDLE
,
const
WCHAR
*
),
void
*
param
)
DECLSPEC_HIDDEN
;
extern
BOOL
search_dll_path
(
const
struct
process
*
process
,
const
WCHAR
*
name
,
WORD
machin
e
,
BOOL
(
*
match
)(
void
*
,
HANDLE
,
const
WCHAR
*
),
void
*
param
)
DECLSPEC_HIDDEN
;
extern
BOOL
search_unix_path
(
const
WCHAR
*
name
,
const
WCHAR
*
path
,
BOOL
(
*
match
)(
void
*
,
HANDLE
,
const
WCHAR
*
),
void
*
param
)
DECLSPEC_HIDDEN
;
extern
const
WCHAR
*
file_name
(
const
WCHAR
*
str
)
DECLSPEC_HIDDEN
;
extern
const
char
*
file_nameA
(
const
char
*
str
)
DECLSPEC_HIDDEN
;
...
...
dlls/dbghelp/elf_module.c
View file @
aac4e9df
...
...
@@ -1445,7 +1445,7 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
load_elf
.
elf_info
=
elf_info
;
ret
=
search_unix_path
(
filename
,
process_getenv
(
pcs
,
L"LD_LIBRARY_PATH"
),
elf_load_file_cb
,
&
load_elf
)
||
search_dll_path
(
pcs
,
filename
,
elf_load_file_cb
,
&
load_elf
);
||
search_dll_path
(
pcs
,
filename
,
IMAGE_FILE_MACHINE_UNKNOWN
,
elf_load_file_cb
,
&
load_elf
);
}
return
ret
;
...
...
dlls/dbghelp/macho_module.c
View file @
aac4e9df
...
...
@@ -1583,7 +1583,7 @@ static BOOL macho_search_and_load_file(struct process* pcs, const WCHAR* filenam
ret
=
search_unix_path
(
p
,
fallback
,
macho_load_file_cb
,
&
load_params
);
}
if
(
!
ret
&&
p
==
filename
)
ret
=
search_dll_path
(
pcs
,
filename
,
macho_load_file_cb
,
&
load_params
);
ret
=
search_dll_path
(
pcs
,
filename
,
IMAGE_FILE_MACHINE_UNKNOWN
,
macho_load_file_cb
,
&
load_params
);
return
ret
;
}
...
...
dlls/dbghelp/path.c
View file @
aac4e9df
...
...
@@ -722,7 +722,7 @@ static BOOL try_match_file(const WCHAR *name, BOOL (*match)(void*, HANDLE, const
return
FALSE
;
}
BOOL
search_dll_path
(
const
struct
process
*
process
,
const
WCHAR
*
name
,
BOOL
(
*
match
)(
void
*
,
HANDLE
,
const
WCHAR
*
),
void
*
param
)
BOOL
search_dll_path
(
const
struct
process
*
process
,
const
WCHAR
*
name
,
WORD
machine
,
BOOL
(
*
match
)(
void
*
,
HANDLE
,
const
WCHAR
*
),
void
*
param
)
{
const
WCHAR
*
env
;
WCHAR
*
p
,
*
end
;
...
...
@@ -733,7 +733,8 @@ BOOL search_dll_path(const struct process *process, const WCHAR *name, BOOL (*ma
name
=
file_name
(
name
);
cpu
=
process_get_cpu
(
process
);
cpu
=
machine
==
IMAGE_FILE_MACHINE_UNKNOWN
?
process_get_cpu
(
process
)
:
cpu_find
(
machine
);
for
(
machine_dir
=
all_machine_dir
;
machine_dir
<
all_machine_dir
+
ARRAY_SIZE
(
all_machine_dir
);
machine_dir
++
)
if
(
machine_dir
->
machine
==
cpu
->
machine
)
break
;
if
(
machine_dir
>=
all_machine_dir
+
ARRAY_SIZE
(
all_machine_dir
))
return
FALSE
;
...
...
dlls/dbghelp/pe_module.c
View file @
aac4e9df
...
...
@@ -824,7 +824,8 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name,
if
(
pe_map_file
(
hFile
,
&
modfmt
->
u
.
pe_info
->
fmap
,
DMT_PE
))
{
struct
builtin_search
builtin
=
{
NULL
};
if
(
opened
&&
modfmt
->
u
.
pe_info
->
fmap
.
u
.
pe
.
builtin
&&
search_dll_path
(
pcs
,
loaded_name
,
search_builtin_pe
,
&
builtin
))
if
(
opened
&&
modfmt
->
u
.
pe_info
->
fmap
.
u
.
pe
.
builtin
&&
search_dll_path
(
pcs
,
loaded_name
,
modfmt
->
u
.
pe_info
->
fmap
.
u
.
pe
.
file_header
.
Machine
,
search_builtin_pe
,
&
builtin
))
{
TRACE
(
"reloaded %s from %s
\n
"
,
debugstr_w
(
loaded_name
),
debugstr_w
(
builtin
.
path
));
image_unmap_file
(
&
modfmt
->
u
.
pe_info
->
fmap
);
...
...
dlls/dbghelp/tests/dbghelp.c
View file @
aac4e9df
...
...
@@ -240,7 +240,6 @@ static void test_modules(void)
ret
=
SymGetModuleInfoW64
(
GetCurrentProcess
(),
base2
,
&
im
);
ok
(
ret
,
"SymGetModuleInfoW64 failed: %lu
\n
"
,
GetLastError
());
ok
(
im
.
BaseOfImage
==
base2
,
"Wrong base address
\n
"
);
todo_wine_if
(
sizeof
(
void
*
)
==
8
)
ok
(
im
.
MachineType
==
get_module_machine
(
"C:
\\
windows
\\
syswow64
\\
notepad.exe"
),
"Wrong machine %lx
\n
"
,
im
.
MachineType
);
}
...
...
@@ -272,7 +271,6 @@ static void test_modules(void)
ret
=
SymGetModuleInfoW64
(
GetCurrentProcess
(),
base2
,
&
im
);
ok
(
ret
,
"SymGetModuleInfoW64 failed: %lu
\n
"
,
GetLastError
());
ok
(
im
.
BaseOfImage
==
base2
,
"Wrong base address
\n
"
);
todo_wine_if
(
sizeof
(
void
*
)
==
8
)
ok
(
im
.
MachineType
==
get_module_machine
(
"C:
\\
windows
\\
syswow64
\\
notepad.exe"
),
"Wrong machine %lx
\n
"
,
im
.
MachineType
);
}
...
...
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