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
3e1a5629
Commit
3e1a5629
authored
Nov 15, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Return a Unicode path in path_find_symbol_file().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6030ee5f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
24 deletions
+15
-24
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+1
-1
msc.c
dlls/dbghelp/msc.c
+2
-2
path.c
dlls/dbghelp/path.c
+9
-18
pe_module.c
dlls/dbghelp/pe_module.c
+3
-3
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
3e1a5629
...
...
@@ -659,7 +659,7 @@ extern BOOL pdb_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip,
/* path.c */
extern
BOOL
path_find_symbol_file
(
const
struct
process
*
pcs
,
const
struct
module
*
module
,
PCSTR
full_path
,
const
GUID
*
guid
,
DWORD
dw1
,
DWORD
dw2
,
PSTR
buffer
,
BOOL
*
is_unmatched
)
DECLSPEC_HIDDEN
;
WCHAR
*
buffer
,
BOOL
*
is_unmatched
)
DECLSPEC_HIDDEN
;
/* pe_module.c */
extern
BOOL
pe_load_nt_header
(
HANDLE
hProc
,
DWORD64
base
,
IMAGE_NT_HEADERS
*
nth
)
DECLSPEC_HIDDEN
;
...
...
dlls/dbghelp/msc.c
View file @
3e1a5629
...
...
@@ -2444,7 +2444,7 @@ static HANDLE map_pdb_file(const struct process* pcs,
struct
module
*
module
)
{
HANDLE
hFile
,
hMap
=
NULL
;
char
dbg_file_path
[
MAX_PATH
];
WCHAR
dbg_file_path
[
MAX_PATH
];
BOOL
ret
=
FALSE
;
switch
(
lookup
->
kind
)
...
...
@@ -2463,7 +2463,7 @@ static HANDLE map_pdb_file(const struct process* pcs,
WARN
(
"
\t
Couldn't find %s
\n
"
,
lookup
->
filename
);
return
NULL
;
}
if
((
hFile
=
CreateFile
A
(
dbg_file_path
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
if
((
hFile
=
CreateFile
W
(
dbg_file_path
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
))
!=
INVALID_HANDLE_VALUE
)
{
hMap
=
CreateFileMappingW
(
hFile
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
);
...
...
dlls/dbghelp/path.c
View file @
3e1a5629
...
...
@@ -623,11 +623,10 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
BOOL
path_find_symbol_file
(
const
struct
process
*
pcs
,
const
struct
module
*
module
,
PCSTR
full_path
,
const
GUID
*
guid
,
DWORD
dw1
,
DWORD
dw2
,
PSTR
buffer
,
BOOL
*
is_unmatched
)
WCHAR
*
buffer
,
BOOL
*
is_unmatched
)
{
struct
module_find
mf
;
WCHAR
full_pathW
[
MAX_PATH
];
WCHAR
tmp
[
MAX_PATH
];
WCHAR
*
ptr
;
const
WCHAR
*
filename
;
WCHAR
*
searchPath
=
pcs
->
search_path
;
...
...
@@ -648,7 +647,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul
/* first check full path to file */
if
(
module_find_cb
(
full_pathW
,
&
mf
))
{
WideCharToMultiByte
(
CP_ACP
,
0
,
full_pathW
,
-
1
,
buffer
,
MAX_PATH
,
NULL
,
NULL
);
strcpyW
(
buffer
,
full_pathW
);
return
TRUE
;
}
...
...
@@ -662,38 +661,30 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul
(dll may be exe, or sys depending on the file extension) */
/* 2. check module-path */
file_pathW
(
module
->
module
.
LoadedImageName
,
tmp
);
if
(
do_searchW
(
filename
,
tmp
,
FALSE
,
module_find_cb
,
&
mf
))
{
WideCharToMultiByte
(
CP_ACP
,
0
,
tmp
,
-
1
,
buffer
,
MAX_PATH
,
NULL
,
NULL
);
return
TRUE
;
}
file_pathW
(
module
->
module
.
LoadedImageName
,
buffer
);
if
(
do_searchW
(
filename
,
buffer
,
FALSE
,
module_find_cb
,
&
mf
))
return
TRUE
;
while
(
searchPath
)
{
ptr
=
strchrW
(
searchPath
,
';'
);
if
(
ptr
)
{
memcpy
(
tmp
,
searchPath
,
(
ptr
-
searchPath
)
*
sizeof
(
WCHAR
));
tmp
[
ptr
-
searchPath
]
=
'\0'
;
memcpy
(
buffer
,
searchPath
,
(
ptr
-
searchPath
)
*
sizeof
(
WCHAR
));
buffer
[
ptr
-
searchPath
]
=
'\0'
;
searchPath
=
ptr
+
1
;
}
else
{
strcpyW
(
tmp
,
searchPath
);
strcpyW
(
buffer
,
searchPath
);
searchPath
=
NULL
;
}
if
(
do_searchW
(
filename
,
tmp
,
FALSE
,
module_find_cb
,
&
mf
))
{
/* return first fully matched file */
WideCharToMultiByte
(
CP_ACP
,
0
,
tmp
,
-
1
,
buffer
,
MAX_PATH
,
NULL
,
NULL
);
return
TRUE
;
}
if
(
do_searchW
(
filename
,
buffer
,
FALSE
,
module_find_cb
,
&
mf
))
return
TRUE
;
}
/* if no fully matching file is found, return the best matching file if any */
if
((
dbghelp_options
&
SYMOPT_LOAD_ANYTHING
)
&&
mf
.
matched
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
mf
.
filename
,
-
1
,
buffer
,
MAX_PATH
,
NULL
,
NULL
);
strcpyW
(
buffer
,
mf
.
filename
);
*
is_unmatched
=
TRUE
;
return
TRUE
;
}
...
...
dlls/dbghelp/pe_module.c
View file @
3e1a5629
...
...
@@ -524,7 +524,7 @@ static BOOL pe_load_dwarf(struct module* module)
static
BOOL
pe_load_dbg_file
(
const
struct
process
*
pcs
,
struct
module
*
module
,
const
char
*
dbg_name
,
DWORD
timestamp
)
{
char
tmp
[
MAX_PATH
];
WCHAR
tmp
[
MAX_PATH
];
HANDLE
hFile
=
INVALID_HANDLE_VALUE
,
hMap
=
0
;
const
BYTE
*
dbg_mapping
=
NULL
;
BOOL
ret
=
FALSE
;
...
...
@@ -532,7 +532,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
TRACE
(
"Processing DBG file %s
\n
"
,
debugstr_a
(
dbg_name
));
if
(
path_find_symbol_file
(
pcs
,
module
,
dbg_name
,
NULL
,
timestamp
,
0
,
tmp
,
&
module
->
module
.
DbgUnmatched
)
&&
(
hFile
=
CreateFile
A
(
tmp
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
(
hFile
=
CreateFile
W
(
tmp
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
))
!=
INVALID_HANDLE_VALUE
&&
((
hMap
=
CreateFileMappingW
(
hFile
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
))
!=
0
)
&&
((
dbg_mapping
=
MapViewOfFile
(
hMap
,
FILE_MAP_READ
,
0
,
0
,
0
))
!=
NULL
))
...
...
@@ -555,7 +555,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
hdr
->
DebugDirectorySize
/
sizeof
(
*
dbg
));
}
else
ERR
(
"Couldn't find .DBG file %s (%s)
\n
"
,
debugstr_a
(
dbg_name
),
debugstr_
a
(
tmp
));
ERR
(
"Couldn't find .DBG file %s (%s)
\n
"
,
debugstr_a
(
dbg_name
),
debugstr_
w
(
tmp
));
if
(
dbg_mapping
)
UnmapViewOfFile
(
dbg_mapping
);
if
(
hMap
)
CloseHandle
(
hMap
);
...
...
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