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
ee5d29b7
Commit
ee5d29b7
authored
Mar 23, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Use search_dll_path in elf_search_and_load_file.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
21af2e19
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
38 deletions
+21
-38
elf_module.c
dlls/dbghelp/elf_module.c
+21
-38
No files found.
dlls/dbghelp/elf_module.c
View file @
ee5d29b7
...
...
@@ -38,7 +38,6 @@
#include "image_private.h"
#include "wine/library.h"
#include "wine/debug.h"
#include "wine/heap.h"
...
...
@@ -1261,6 +1260,20 @@ static BOOL elf_load_file(struct process* pcs, const WCHAR* filename,
return
ret
;
}
struct
elf_load_file_params
{
struct
process
*
process
;
ULONG_PTR
load_offset
;
ULONG_PTR
dyn_addr
;
struct
elf_info
*
elf_info
;
};
static
BOOL
elf_load_file_cb
(
void
*
param
,
HANDLE
handle
,
const
WCHAR
*
filename
)
{
struct
elf_load_file_params
*
load_file
=
param
;
return
elf_load_file
(
load_file
->
process
,
filename
,
load_file
->
load_offset
,
load_file
->
dyn_addr
,
load_file
->
elf_info
);
}
/******************************************************************
* elf_load_file_from_path
* tries to load an ELF file from a set of paths (separated by ':')
...
...
@@ -1302,41 +1315,6 @@ static BOOL elf_load_file_from_path(HANDLE hProcess,
return
ret
;
}
/******************************************************************
* elf_load_file_from_dll_path
*
* Tries to load an ELF file from the dll path
*/
static
BOOL
elf_load_file_from_dll_path
(
HANDLE
hProcess
,
const
WCHAR
*
filename
,
unsigned
long
load_offset
,
unsigned
long
dyn_addr
,
struct
elf_info
*
elf_info
)
{
BOOL
ret
=
FALSE
;
unsigned
int
index
=
0
;
const
char
*
path
;
while
(
!
ret
&&
(
path
=
wine_dll_enum_load_path
(
index
++
)))
{
WCHAR
*
name
;
unsigned
len
;
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
path
,
-
1
,
NULL
,
0
);
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
lstrlenW
(
filename
)
+
2
)
*
sizeof
(
WCHAR
)
);
if
(
!
name
)
break
;
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
path
,
-
1
,
name
,
len
);
strcatW
(
name
,
S_SlashW
);
strcatW
(
name
,
filename
);
ret
=
elf_load_file
(
hProcess
,
name
,
load_offset
,
dyn_addr
,
elf_info
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
return
ret
;
}
#ifdef AT_SYSINFO_EHDR
/******************************************************************
* elf_search_auxv
...
...
@@ -1434,12 +1412,17 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
/* if relative pathname, try some absolute base dirs */
if
(
!
ret
&&
filename
==
file_name
(
filename
))
{
struct
elf_load_file_params
load_elf
;
load_elf
.
process
=
pcs
;
load_elf
.
load_offset
=
load_offset
;
load_elf
.
dyn_addr
=
dyn_addr
;
load_elf
.
elf_info
=
elf_info
;
ret
=
elf_load_file_from_path
(
pcs
,
filename
,
load_offset
,
dyn_addr
,
getenv
(
"PATH"
),
elf_info
)
||
elf_load_file_from_path
(
pcs
,
filename
,
load_offset
,
dyn_addr
,
getenv
(
"LD_LIBRARY_PATH"
),
elf_info
);
if
(
!
ret
)
ret
=
elf_load_file_from_dll_path
(
pcs
,
filename
,
load_offset
,
dyn_addr
,
elf_info
);
if
(
!
ret
)
ret
=
search_dll_path
(
filename
,
elf_load_file_cb
,
&
load_elf
);
}
return
ret
;
...
...
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