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
cf6bbb96
Commit
cf6bbb96
authored
Apr 06, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Build with ucrtbase.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5bc58410
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
89 additions
and
88 deletions
+89
-88
Makefile.in
dlls/dbghelp/Makefile.in
+2
-0
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+0
-1
dwarf.c
dlls/dbghelp/dwarf.c
+2
-2
elf_module.c
dlls/dbghelp/elf_module.c
+7
-7
macho_module.c
dlls/dbghelp/macho_module.c
+10
-10
module.c
dlls/dbghelp/module.c
+31
-31
path.c
dlls/dbghelp/path.c
+32
-32
pe_module.c
dlls/dbghelp/pe_module.c
+1
-1
symbol.c
dlls/dbghelp/symbol.c
+4
-4
No files found.
dlls/dbghelp/Makefile.in
View file @
cf6bbb96
...
...
@@ -3,6 +3,8 @@ IMPORTLIB = dbghelp
EXTRADEFS
=
-D_IMAGEHLP_SOURCE_
DELAYIMPORTS
=
version
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
coff.c
\
cpu_arm.c
\
...
...
dlls/dbghelp/dbghelp_private.h
View file @
cf6bbb96
...
...
@@ -30,7 +30,6 @@
#include "oaidl.h"
#include "winnls.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "wine/rbtree.h"
#include "cvconst.h"
...
...
dlls/dbghelp/dwarf.c
View file @
cf6bbb96
...
...
@@ -718,7 +718,7 @@ compute_location(const struct module *module, dwarf2_traverse_context_t* ctx, st
case
DW_OP_pick
:
stack
[
stk
+
1
]
=
stack
[
stk
-
dwarf2_parse_byte
(
ctx
)];
stk
++
;
break
;
case
DW_OP_swap
:
tmp
=
stack
[
stk
];
stack
[
stk
]
=
stack
[
stk
-
1
];
stack
[
stk
-
1
]
=
tmp
;
break
;
case
DW_OP_rot
:
tmp
=
stack
[
stk
];
stack
[
stk
]
=
stack
[
stk
-
1
];
stack
[
stk
-
1
]
=
stack
[
stk
-
2
];
stack
[
stk
-
2
]
=
tmp
;
break
;
case
DW_OP_abs
:
stack
[
stk
]
=
labs
(
stack
[
stk
]);
break
;
case
DW_OP_abs
:
stack
[
stk
]
=
sizeof
(
stack
[
stk
])
==
8
?
llabs
((
INT64
)
stack
[
stk
])
:
abs
((
INT32
)
stack
[
stk
]);
break
;
case
DW_OP_neg
:
stack
[
stk
]
=
-
stack
[
stk
];
break
;
case
DW_OP_not
:
stack
[
stk
]
=
~
stack
[
stk
];
break
;
case
DW_OP_and
:
stack
[
stk
-
1
]
&=
stack
[
stk
];
stk
--
;
break
;
...
...
@@ -3119,7 +3119,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w
case
DW_OP_pick
:
stack
[
sp
+
1
]
=
stack
[
sp
-
dwarf2_parse_byte
(
&
ctx
)];
sp
++
;
break
;
case
DW_OP_swap
:
tmp
=
stack
[
sp
];
stack
[
sp
]
=
stack
[
sp
-
1
];
stack
[
sp
-
1
]
=
tmp
;
break
;
case
DW_OP_rot
:
tmp
=
stack
[
sp
];
stack
[
sp
]
=
stack
[
sp
-
1
];
stack
[
sp
-
1
]
=
stack
[
sp
-
2
];
stack
[
sp
-
2
]
=
tmp
;
break
;
case
DW_OP_abs
:
stack
[
sp
]
=
labs
(
stack
[
sp
]);
break
;
case
DW_OP_abs
:
stack
[
sp
]
=
sizeof
(
stack
[
sp
])
==
8
?
llabs
((
INT64
)
stack
[
sp
])
:
abs
((
INT32
)
stack
[
sp
]);
break
;
case
DW_OP_neg
:
stack
[
sp
]
=
-
stack
[
sp
];
break
;
case
DW_OP_not
:
stack
[
sp
]
=
~
stack
[
sp
];
break
;
case
DW_OP_and
:
stack
[
sp
-
1
]
&=
stack
[
sp
];
sp
--
;
break
;
...
...
dlls/dbghelp/elf_module.c
View file @
cf6bbb96
...
...
@@ -333,7 +333,7 @@ struct elf_map_file_data
};
static
BOOL
elf_map_file_read
(
struct
image_file_map
*
fmap
,
struct
elf_map_file_data
*
emfd
,
void
*
buf
,
size_t
len
,
off
_t
off
)
void
*
buf
,
size_t
len
,
size
_t
off
)
{
LARGE_INTEGER
li
;
DWORD
bytes_read
;
...
...
@@ -1068,8 +1068,8 @@ static BOOL elf_load_debug_info_from_map(struct module* module,
lret
=
dwarf2_parse
(
module
,
module
->
reloc_delta
,
thunks
,
fmap
);
ret
=
ret
||
lret
;
}
if
(
strstrW
(
module
->
module
.
ModuleName
,
S_ElfW
)
||
!
strcmpW
(
module
->
module
.
ModuleName
,
S_WineLoaderW
))
if
(
wcsstr
(
module
->
module
.
ModuleName
,
S_ElfW
)
||
!
wcscmp
(
module
->
module
.
ModuleName
,
S_WineLoaderW
))
{
/* add the thunks for native libraries */
if
(
!
(
dbghelp_options
&
SYMOPT_PUBLICS_ONLY
))
...
...
@@ -1263,7 +1263,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename,
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
filename
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
ptr
)
{
strcpyW
(
ptr
,
filename
);
l
strcpyW
(
ptr
,
filename
);
elf_info
->
module_name
=
ptr
;
}
else
ret
=
FALSE
;
...
...
@@ -1424,7 +1424,7 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
return
module
->
module
.
SymType
;
}
if
(
strstrW
(
filename
,
S_libstdcPPW
))
return
FALSE
;
/* We know we can't do it */
if
(
wcsstr
(
filename
,
S_libstdcPPW
))
return
FALSE
;
/* We know we can't do it */
ret
=
elf_load_file
(
pcs
,
filename
,
load_offset
,
dyn_addr
,
elf_info
);
/* if relative pathname, try some absolute base dirs */
if
(
!
ret
&&
filename
==
file_name
(
filename
))
...
...
@@ -1494,7 +1494,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs,
{
bufstr
[
sizeof
(
bufstr
)
-
1
]
=
'\0'
;
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
bufstr
,
-
1
,
bufstrW
,
ARRAY_SIZE
(
bufstrW
));
if
(
main_name
&&
!
bufstrW
[
0
])
strcpyW
(
bufstrW
,
main_name
);
if
(
main_name
&&
!
bufstrW
[
0
])
l
strcpyW
(
bufstrW
,
main_name
);
if
(
!
cb
(
bufstrW
,
(
ULONG_PTR
)
lm
.
l_addr
,
(
ULONG_PTR
)
lm
.
l_ld
,
FALSE
,
user
))
break
;
}
...
...
@@ -1536,7 +1536,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs,
{
bufstr
[
sizeof
(
bufstr
)
-
1
]
=
'\0'
;
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
bufstr
,
-
1
,
bufstrW
,
ARRAY_SIZE
(
bufstrW
));
if
(
main_name
&&
!
bufstrW
[
0
])
strcpyW
(
bufstrW
,
main_name
);
if
(
main_name
&&
!
bufstrW
[
0
])
l
strcpyW
(
bufstrW
,
main_name
);
if
(
!
cb
(
bufstrW
,
(
ULONG_PTR
)
lm
.
l_addr
,
(
ULONG_PTR
)
lm
.
l_ld
,
FALSE
,
user
))
break
;
}
...
...
dlls/dbghelp/macho_module.c
View file @
cf6bbb96
...
...
@@ -1267,7 +1267,7 @@ static WCHAR *query_dsym(const GUID *uuid, const WCHAR *filename)
p
+=
query
->
DeviceNameLength
/
sizeof
(
WCHAR
);
memcpy
(
p
,
dsym_subpath
,
sizeof
(
dsym_subpath
));
p
+=
ARRAY_SIZE
(
dsym_subpath
)
-
1
;
strcpyW
(
p
,
filename
);
l
strcpyW
(
p
,
filename
);
}
if
(
query
!=
(
void
*
)
buf
)
HeapFree
(
GetProcessHeap
(),
0
,
query
);
...
...
@@ -1300,19 +1300,19 @@ static void find_and_map_dsym(struct process *pcs, struct module* module)
return
;
p
=
file_name
(
module
->
module
.
LoadedImageName
);
len
=
strlenW
(
module
->
module
.
LoadedImageName
)
+
strlenW
(
dot_dsym
)
+
strlenW
(
dsym_subpath
)
+
strlenW
(
p
)
+
1
;
len
=
lstrlenW
(
module
->
module
.
LoadedImageName
)
+
lstrlenW
(
dot_dsym
)
+
lstrlenW
(
dsym_subpath
)
+
l
strlenW
(
p
)
+
1
;
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
path
)
return
;
strcpyW
(
path
,
module
->
module
.
LoadedImageName
);
strcatW
(
path
,
dot_dsym
);
strcatW
(
path
,
dsym_subpath
);
strcatW
(
path
,
p
);
l
strcpyW
(
path
,
module
->
module
.
LoadedImageName
);
l
strcatW
(
path
,
dot_dsym
);
l
strcatW
(
path
,
dsym_subpath
);
l
strcatW
(
path
,
p
);
if
(
try_dsym
(
pcs
,
path
,
fmap
))
goto
found
;
strcpyW
(
path
+
strlenW
(
module
->
module
.
LoadedImageName
),
dot_dwarf
);
lstrcpyW
(
path
+
l
strlenW
(
module
->
module
.
LoadedImageName
),
dot_dwarf
);
if
(
try_dsym
(
pcs
,
path
,
fmap
))
goto
found
;
...
...
@@ -1514,7 +1514,7 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename,
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
filename
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
ptr
)
{
strcpyW
(
ptr
,
filename
);
l
strcpyW
(
ptr
,
filename
);
macho_info
->
module_name
=
ptr
;
}
else
ret
=
FALSE
;
...
...
@@ -1566,7 +1566,7 @@ static BOOL macho_search_and_load_file(struct process* pcs, const WCHAR* filenam
return
module
->
module
.
SymType
;
}
if
(
strstrW
(
filename
,
S_libstdcPPW
))
return
FALSE
;
/* We know we can't do it */
if
(
wcsstr
(
filename
,
S_libstdcPPW
))
return
FALSE
;
/* We know we can't do it */
load_params
.
process
=
pcs
;
load_params
.
load_addr
=
load_addr
;
...
...
@@ -1658,7 +1658,7 @@ static BOOL macho_enum_modules_internal(const struct process* pcs,
bufstr
[
sizeof
(
bufstr
)
-
1
]
=
'\0'
;
TRACE
(
"[%d] image file %s
\n
"
,
i
,
debugstr_a
(
bufstr
));
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
bufstr
,
-
1
,
bufstrW
,
ARRAY_SIZE
(
bufstrW
));
if
(
main_name
&&
!
bufstrW
[
0
])
strcpyW
(
bufstrW
,
main_name
);
if
(
main_name
&&
!
bufstrW
[
0
])
l
strcpyW
(
bufstrW
,
main_name
);
if
(
!
cb
(
bufstrW
,
info
.
imageLoadAddress
,
user
))
break
;
}
}
...
...
dlls/dbghelp/module.c
View file @
cf6bbb96
...
...
@@ -55,9 +55,9 @@ static int match_ext(const WCHAR* ptr, size_t len)
for
(
e
=
ext
;
*
e
;
e
++
)
{
l
=
strlenW
(
*
e
);
l
=
l
strlenW
(
*
e
);
if
(
l
>=
len
)
return
0
;
if
(
strncmpiW
(
&
ptr
[
len
-
l
],
*
e
,
l
))
continue
;
if
(
wcsnicmp
(
&
ptr
[
len
-
l
],
*
e
,
l
))
continue
;
return
l
;
}
return
0
;
...
...
@@ -67,7 +67,7 @@ static const WCHAR* get_filename(const WCHAR* name, const WCHAR* endptr)
{
const
WCHAR
*
ptr
;
if
(
!
endptr
)
endptr
=
name
+
strlenW
(
name
);
if
(
!
endptr
)
endptr
=
name
+
l
strlenW
(
name
);
for
(
ptr
=
endptr
-
1
;
ptr
>=
name
;
ptr
--
)
{
if
(
*
ptr
==
'/'
||
*
ptr
==
'\\'
)
break
;
...
...
@@ -95,14 +95,14 @@ static BOOL is_wine_loader(const WCHAR *module)
else
{
buffer
=
heap_alloc
(
sizeof
(
wineW
)
+
2
*
sizeof
(
WCHAR
)
);
strcpyW
(
buffer
,
wineW
);
l
strcpyW
(
buffer
,
wineW
);
}
if
(
!
strcmpW
(
filename
,
buffer
))
if
(
!
wcscmp
(
filename
,
buffer
))
ret
=
TRUE
;
strcatW
(
buffer
,
suffixW
);
if
(
!
strcmpW
(
filename
,
buffer
))
l
strcatW
(
buffer
,
suffixW
);
if
(
!
wcscmp
(
filename
,
buffer
))
ret
=
TRUE
;
heap_free
(
buffer
);
...
...
@@ -114,7 +114,7 @@ static void module_fill_module(const WCHAR* in, WCHAR* out, size_t size)
const
WCHAR
*
ptr
,
*
endptr
;
size_t
len
,
l
;
ptr
=
get_filename
(
in
,
endptr
=
in
+
strlenW
(
in
));
ptr
=
get_filename
(
in
,
endptr
=
in
+
l
strlenW
(
in
));
len
=
min
(
endptr
-
ptr
,
size
-
1
);
memcpy
(
out
,
ptr
,
len
*
sizeof
(
WCHAR
));
out
[
len
]
=
'\0'
;
...
...
@@ -124,11 +124,11 @@ static void module_fill_module(const WCHAR* in, WCHAR* out, size_t size)
lstrcpynW
(
out
,
S_WineLoaderW
,
size
);
else
{
if
(
len
>
3
&&
!
strcmpiW
(
&
out
[
len
-
3
],
S_DotSoW
)
&&
if
(
len
>
3
&&
!
wcsicmp
(
&
out
[
len
-
3
],
S_DotSoW
)
&&
(
l
=
match_ext
(
out
,
len
-
3
)))
strcpyW
(
&
out
[
len
-
l
-
3
],
S_ElfW
);
l
strcpyW
(
&
out
[
len
-
l
-
3
],
S_ElfW
);
}
while
((
*
out
=
to
lowerW
(
*
out
)))
out
++
;
while
((
*
out
=
to
wlower
(
*
out
)))
out
++
;
}
void
module_set_module
(
struct
module
*
module
,
const
WCHAR
*
name
)
...
...
@@ -157,15 +157,15 @@ WCHAR *get_wine_loader_name(struct process *pcs)
else
{
buffer
=
heap_alloc
(
sizeof
(
wineW
)
+
2
*
sizeof
(
WCHAR
)
);
strcpyW
(
buffer
,
wineW
);
l
strcpyW
(
buffer
,
wineW
);
}
p
=
buffer
+
strlenW
(
buffer
)
-
strlenW
(
suffixW
);
if
(
p
>
buffer
&&
!
strcmpW
(
p
,
suffixW
))
p
=
buffer
+
lstrlenW
(
buffer
)
-
l
strlenW
(
suffixW
);
if
(
p
>
buffer
&&
!
wcscmp
(
p
,
suffixW
))
*
p
=
0
;
if
(
pcs
->
is_64bit
)
strcatW
(
buffer
,
suffixW
);
l
strcatW
(
buffer
,
suffixW
);
TRACE
(
"returning %s
\n
"
,
debugstr_w
(
buffer
)
);
return
buffer
;
...
...
@@ -269,7 +269,7 @@ struct module* module_find_by_nameW(const struct process* pcs, const WCHAR* name
for
(
module
=
pcs
->
lmodules
;
module
;
module
=
module
->
next
)
{
if
(
!
strcmpiW
(
name
,
module
->
module
.
ModuleName
))
return
module
;
if
(
!
wcsicmp
(
name
,
module
->
module
.
ModuleName
))
return
module
;
}
SetLastError
(
ERROR_INVALID_NAME
);
return
NULL
;
...
...
@@ -295,14 +295,14 @@ struct module* module_is_already_loaded(const struct process* pcs, const WCHAR*
/* first compare the loaded image name... */
for
(
module
=
pcs
->
lmodules
;
module
;
module
=
module
->
next
)
{
if
(
!
strcmpiW
(
name
,
module
->
module
.
LoadedImageName
))
if
(
!
wcsicmp
(
name
,
module
->
module
.
LoadedImageName
))
return
module
;
}
/* then compare the standard filenames (without the path) ... */
filename
=
get_filename
(
name
,
NULL
);
for
(
module
=
pcs
->
lmodules
;
module
;
module
=
module
->
next
)
{
if
(
!
strcmpiW
(
filename
,
get_filename
(
module
->
module
.
LoadedImageName
,
NULL
)))
if
(
!
wcsicmp
(
filename
,
get_filename
(
module
->
module
.
LoadedImageName
,
NULL
)))
return
module
;
}
SetLastError
(
ERROR_INVALID_NAME
);
...
...
@@ -444,7 +444,7 @@ static BOOL module_is_container_loaded(const struct process* pcs,
if
(
!
base
)
return
FALSE
;
filename
=
get_filename
(
ImageName
,
NULL
);
len
=
strlenW
(
filename
);
len
=
l
strlenW
(
filename
);
for
(
module
=
pcs
->
lmodules
;
module
;
module
=
module
->
next
)
{
...
...
@@ -453,7 +453,7 @@ static BOOL module_is_container_loaded(const struct process* pcs,
base
<
module
->
module
.
BaseOfImage
+
module
->
module
.
ImageSize
)
{
modname
=
get_filename
(
module
->
module
.
LoadedImageName
,
NULL
);
if
(
!
strncmpiW
(
modname
,
filename
,
len
)
&&
if
(
!
wcsnicmp
(
modname
,
filename
,
len
)
&&
!
memcmp
(
modname
+
len
,
S_DotSoW
,
3
*
sizeof
(
WCHAR
)))
{
return
TRUE
;
...
...
@@ -532,17 +532,17 @@ static BOOL image_locate_debug_link(const struct module* module, struct image_fi
if
(
!
fmap_link
)
return
FALSE
;
filename_len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
filename
,
-
1
,
NULL
,
0
);
path_len
=
strlenW
(
module
->
module
.
LoadedImageName
);
if
(
module
->
real_path
)
path_len
=
max
(
path_len
,
strlenW
(
module
->
real_path
));
path_len
=
l
strlenW
(
module
->
module
.
LoadedImageName
);
if
(
module
->
real_path
)
path_len
=
max
(
path_len
,
l
strlenW
(
module
->
real_path
));
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
globalDebugDirLen
+
path_len
+
6
+
1
+
filename_len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
p
)
goto
found
;
/* we prebuild the string with "execdir" */
strcpyW
(
p
,
module
->
module
.
LoadedImageName
);
l
strcpyW
(
p
,
module
->
module
.
LoadedImageName
);
slash
=
p
;
if
((
slash2
=
strrchrW
(
slash
,
'/'
)))
slash
=
slash2
+
1
;
if
((
slash2
=
strrchrW
(
slash
,
'\\'
)))
slash
=
slash2
+
1
;
if
((
slash2
=
wcsrchr
(
slash
,
'/'
)))
slash
=
slash2
+
1
;
if
((
slash2
=
wcsrchr
(
slash
,
'\\'
)))
slash
=
slash2
+
1
;
/* testing execdir/filename */
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
filename
,
-
1
,
slash
,
filename_len
);
...
...
@@ -555,10 +555,10 @@ static BOOL image_locate_debug_link(const struct module* module, struct image_fi
if
(
module
->
real_path
)
{
strcpyW
(
p
,
module
->
real_path
);
l
strcpyW
(
p
,
module
->
real_path
);
slash
=
p
;
if
((
slash2
=
strrchrW
(
slash
,
'/'
)))
slash
=
slash2
+
1
;
if
((
slash2
=
strrchrW
(
slash
,
'\\'
)))
slash
=
slash2
+
1
;
if
((
slash2
=
wcsrchr
(
slash
,
'/'
)))
slash
=
slash2
+
1
;
if
((
slash2
=
wcsrchr
(
slash
,
'\\'
)))
slash
=
slash2
+
1
;
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
filename
,
-
1
,
slash
,
filename_len
);
if
(
image_check_debug_link
(
p
,
fmap_link
,
crc
))
goto
found
;
}
...
...
@@ -1174,9 +1174,9 @@ BOOL WINAPI SymGetModuleInfoW(HANDLE hProcess, DWORD dwAddr,
miw
.
CheckSum
=
miw64
.
CheckSum
;
miw
.
NumSyms
=
miw64
.
NumSyms
;
miw
.
SymType
=
miw64
.
SymType
;
strcpyW
(
miw
.
ModuleName
,
miw64
.
ModuleName
);
strcpyW
(
miw
.
ImageName
,
miw64
.
ImageName
);
strcpyW
(
miw
.
LoadedImageName
,
miw64
.
LoadedImageName
);
l
strcpyW
(
miw
.
ModuleName
,
miw64
.
ModuleName
);
l
strcpyW
(
miw
.
ImageName
,
miw64
.
ImageName
);
l
strcpyW
(
miw
.
LoadedImageName
,
miw64
.
LoadedImageName
);
memcpy
(
ModuleInfo
,
&
miw
,
ModuleInfo
->
SizeOfStruct
);
return
TRUE
;
...
...
dlls/dbghelp/path.c
View file @
cf6bbb96
...
...
@@ -46,7 +46,7 @@ const WCHAR* file_name(const WCHAR* str)
{
const
WCHAR
*
p
;
for
(
p
=
str
+
strlenW
(
str
)
-
1
;
p
>=
str
&&
!
is_sep
(
*
p
);
p
--
);
for
(
p
=
str
+
l
strlenW
(
str
)
-
1
;
p
>=
str
&&
!
is_sep
(
*
p
);
p
--
);
return
p
+
1
;
}
...
...
@@ -54,7 +54,7 @@ static inline void file_pathW(const WCHAR *src, WCHAR *dst)
{
int
len
;
for
(
len
=
strlenW
(
src
)
-
1
;
(
len
>
0
)
&&
(
!
is_sep
(
src
[
len
]));
len
--
);
for
(
len
=
l
strlenW
(
src
)
-
1
;
(
len
>
0
)
&&
(
!
is_sep
(
src
[
len
]));
len
--
);
memcpy
(
dst
,
src
,
len
*
sizeof
(
WCHAR
)
);
dst
[
len
]
=
0
;
}
...
...
@@ -176,12 +176,12 @@ BOOL WINAPI SymMatchFileNameW(PCWSTR file, PCWSTR match,
TRACE
(
"(%s %s %p %p)
\n
"
,
debugstr_w
(
file
),
debugstr_w
(
match
),
filestop
,
matchstop
);
fptr
=
file
+
strlenW
(
file
)
-
1
;
mptr
=
match
+
strlenW
(
match
)
-
1
;
fptr
=
file
+
l
strlenW
(
file
)
-
1
;
mptr
=
match
+
l
strlenW
(
match
)
-
1
;
while
(
fptr
>=
file
&&
mptr
>=
match
)
{
if
(
to
upperW
(
*
fptr
)
!=
toupperW
(
*
mptr
)
&&
!
(
is_sep
(
*
fptr
)
&&
is_sep
(
*
mptr
)))
if
(
to
wupper
(
*
fptr
)
!=
towupper
(
*
mptr
)
&&
!
(
is_sep
(
*
fptr
)
&&
is_sep
(
*
mptr
)))
break
;
fptr
--
;
mptr
--
;
}
...
...
@@ -229,10 +229,10 @@ static BOOL do_searchW(PCWSTR file, PWSTR buffer, BOOL recurse,
static
const
WCHAR
S_DotW
[]
=
{
'.'
,
'\0'
};
static
const
WCHAR
S_DotDotW
[]
=
{
'.'
,
'.'
,
'\0'
};
pos
=
strlenW
(
buffer
);
pos
=
l
strlenW
(
buffer
);
if
(
pos
==
0
)
return
FALSE
;
if
(
buffer
[
pos
-
1
]
!=
'\\'
)
buffer
[
pos
++
]
=
'\\'
;
strcpyW
(
buffer
+
pos
,
S_AllW
);
l
strcpyW
(
buffer
+
pos
,
S_AllW
);
if
((
h
=
FindFirstFileW
(
buffer
,
&
fd
))
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
/* doc doesn't specify how the tree is enumerated...
...
...
@@ -240,9 +240,9 @@ static BOOL do_searchW(PCWSTR file, PWSTR buffer, BOOL recurse,
*/
do
{
if
(
!
strcmpW
(
fd
.
cFileName
,
S_DotW
)
||
!
strcmpW
(
fd
.
cFileName
,
S_DotDotW
))
continue
;
if
(
!
wcscmp
(
fd
.
cFileName
,
S_DotW
)
||
!
wcscmp
(
fd
.
cFileName
,
S_DotDotW
))
continue
;
strcpyW
(
buffer
+
pos
,
fd
.
cFileName
);
l
strcpyW
(
buffer
+
pos
,
fd
.
cFileName
);
if
(
recurse
&&
(
fd
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
found
=
do_searchW
(
file
,
buffer
,
TRUE
,
cb
,
user
);
else
if
(
SymMatchFileNameW
(
buffer
,
file
,
NULL
,
NULL
))
...
...
@@ -263,7 +263,7 @@ BOOL WINAPI SearchTreeForFileW(PCWSTR root, PCWSTR file, PWSTR buffer)
{
TRACE
(
"(%s, %s, %p)
\n
"
,
debugstr_w
(
root
),
debugstr_w
(
file
),
buffer
);
strcpyW
(
buffer
,
root
);
l
strcpyW
(
buffer
,
root
);
return
do_searchW
(
file
,
buffer
,
TRUE
,
NULL
,
NULL
);
}
...
...
@@ -296,7 +296,7 @@ BOOL WINAPI EnumDirTreeW(HANDLE hProcess, PCWSTR root, PCWSTR file,
TRACE
(
"(%p %s %s %p %p %p)
\n
"
,
hProcess
,
debugstr_w
(
root
),
debugstr_w
(
file
),
buffer
,
cb
,
user
);
strcpyW
(
buffer
,
root
);
l
strcpyW
(
buffer
,
root
);
return
do_searchW
(
file
,
buffer
,
TRUE
,
cb
,
user
);
}
...
...
@@ -390,13 +390,13 @@ BOOL WINAPI SymFindFileInPathW(HANDLE hProcess, PCWSTR searchPath, PCWSTR full_p
/* first check full path to file */
if
(
sffip_cb
(
full_path
,
&
s
))
{
strcpyW
(
buffer
,
full_path
);
l
strcpyW
(
buffer
,
full_path
);
return
TRUE
;
}
while
(
searchPath
)
{
ptr
=
strchrW
(
searchPath
,
';'
);
ptr
=
wcschr
(
searchPath
,
';'
);
if
(
ptr
)
{
memcpy
(
tmp
,
searchPath
,
(
ptr
-
searchPath
)
*
sizeof
(
WCHAR
));
...
...
@@ -405,12 +405,12 @@ BOOL WINAPI SymFindFileInPathW(HANDLE hProcess, PCWSTR searchPath, PCWSTR full_p
}
else
{
strcpyW
(
tmp
,
searchPath
);
l
strcpyW
(
tmp
,
searchPath
);
searchPath
=
NULL
;
}
if
(
do_searchW
(
filename
,
tmp
,
FALSE
,
sffip_cb
,
&
s
))
{
strcpyW
(
buffer
,
tmp
);
l
strcpyW
(
buffer
,
tmp
);
return
TRUE
;
}
}
...
...
@@ -584,7 +584,7 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
}
if
(
matched
>
mf
->
matched
)
{
strcpyW
(
mf
->
filename
,
buffer
);
l
strcpyW
(
mf
->
filename
,
buffer
);
mf
->
matched
=
matched
;
}
/* yes, EnumDirTree/do_search and SymFindFileInPath callbacks use the opposite
...
...
@@ -619,7 +619,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
))
{
strcpyW
(
buffer
,
full_pathW
);
l
strcpyW
(
buffer
,
full_pathW
);
return
TRUE
;
}
...
...
@@ -643,7 +643,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul
while
(
searchPath
)
{
ptr
=
strchrW
(
searchPath
,
';'
);
ptr
=
wcschr
(
searchPath
,
';'
);
if
(
ptr
)
{
memcpy
(
buffer
,
searchPath
,
(
ptr
-
searchPath
)
*
sizeof
(
WCHAR
));
...
...
@@ -652,7 +652,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul
}
else
{
strcpyW
(
buffer
,
searchPath
);
l
strcpyW
(
buffer
,
searchPath
);
searchPath
=
NULL
;
}
/* return first fully matched file */
...
...
@@ -661,7 +661,7 @@ BOOL path_find_symbol_file(const struct process* pcs, const struct module* modul
/* if no fully matching file is found, return the best matching file if any */
if
((
dbghelp_options
&
SYMOPT_LOAD_ANYTHING
)
&&
mf
.
matched
)
{
strcpyW
(
buffer
,
mf
.
filename
);
l
strcpyW
(
buffer
,
mf
.
filename
);
*
is_unmatched
=
TRUE
;
return
TRUE
;
}
...
...
@@ -716,12 +716,12 @@ BOOL search_dll_path(const WCHAR *name, BOOL (*match)(void*, HANDLE, const WCHAR
end
=
buf
+
GetEnvironmentVariableW
(
winebuilddirW
,
buf
,
len
);
memcpy
(
end
,
dllsW
,
sizeof
(
dllsW
));
strcpyW
(
end
+
ARRAY_SIZE
(
dllsW
),
name
);
if
((
p
=
strrchrW
(
end
,
'.'
))
&&
!
lstrcmpW
(
p
,
dot_soW
))
*
p
=
0
;
if
((
p
=
strrchrW
(
end
,
'.'
))
&&
!
lstrcmpW
(
p
,
dot_dllW
))
*
p
=
0
;
p
=
end
+
strlenW
(
end
);
l
strcpyW
(
end
+
ARRAY_SIZE
(
dllsW
),
name
);
if
((
p
=
wcsrchr
(
end
,
'.'
))
&&
!
lstrcmpW
(
p
,
dot_soW
))
*
p
=
0
;
if
((
p
=
wcsrchr
(
end
,
'.'
))
&&
!
lstrcmpW
(
p
,
dot_dllW
))
*
p
=
0
;
p
=
end
+
l
strlenW
(
end
);
*
p
++
=
'\\'
;
strcpyW
(
p
,
name
);
l
strcpyW
(
p
,
name
);
file
=
CreateFileW
(
buf
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
file
!=
INVALID_HANDLE_VALUE
)
{
...
...
@@ -732,12 +732,12 @@ BOOL search_dll_path(const WCHAR *name, BOOL (*match)(void*, HANDLE, const WCHAR
memcpy
(
end
,
programsW
,
sizeof
(
programsW
));
end
+=
ARRAY_SIZE
(
programsW
);
strcpyW
(
end
,
name
);
if
((
p
=
strrchrW
(
end
,
'.'
))
&&
!
lstrcmpW
(
p
,
dot_soW
))
*
p
=
0
;
if
((
p
=
strrchrW
(
end
,
'.'
))
&&
!
lstrcmpW
(
p
,
dot_exeW
))
*
p
=
0
;
p
=
end
+
strlenW
(
end
);
l
strcpyW
(
end
,
name
);
if
((
p
=
wcsrchr
(
end
,
'.'
))
&&
!
lstrcmpW
(
p
,
dot_soW
))
*
p
=
0
;
if
((
p
=
wcsrchr
(
end
,
'.'
))
&&
!
lstrcmpW
(
p
,
dot_exeW
))
*
p
=
0
;
p
=
end
+
l
strlenW
(
end
);
*
p
++
=
'\\'
;
strcpyW
(
p
,
name
);
l
strcpyW
(
p
,
name
);
file
=
CreateFileW
(
buf
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
file
!=
INVALID_HANDLE_VALUE
)
{
...
...
@@ -752,13 +752,13 @@ BOOL search_dll_path(const WCHAR *name, BOOL (*match)(void*, HANDLE, const WCHAR
for
(
i
=
0
;;
i
++
)
{
WCHAR
env_name
[
64
];
s
printfW
(
env_name
,
winedlldirW
,
i
);
s
wprintf
(
env_name
,
ARRAY_SIZE
(
env_name
)
,
winedlldirW
,
i
);
if
(
!
(
len
=
GetEnvironmentVariableW
(
env_name
,
NULL
,
0
)))
break
;
if
(
!
(
buf
=
heap_alloc
((
len
+
lstrlenW
(
name
)
+
2
)
*
sizeof
(
WCHAR
))))
return
FALSE
;
len
=
GetEnvironmentVariableW
(
env_name
,
buf
,
len
);
buf
[
len
++
]
=
'\\'
;
strcpyW
(
buf
+
len
,
name
);
l
strcpyW
(
buf
+
len
,
name
);
file
=
CreateFileW
(
buf
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
file
!=
INVALID_HANDLE_VALUE
)
{
...
...
dlls/dbghelp/pe_module.c
View file @
cf6bbb96
...
...
@@ -777,7 +777,7 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name,
return
NULL
;
opened
=
TRUE
;
}
else
if
(
name
)
strcpyW
(
loaded_name
,
name
);
else
if
(
name
)
l
strcpyW
(
loaded_name
,
name
);
else
if
(
dbghelp_options
&
SYMOPT_DEFERRED_LOADS
)
FIXME
(
"Trouble ahead (no module name passed in deferred mode)
\n
"
);
if
(
!
(
modfmt
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
module_format
)
+
sizeof
(
struct
pe_module_info
))))
...
...
dlls/dbghelp/symbol.c
View file @
cf6bbb96
...
...
@@ -1039,7 +1039,7 @@ static BOOL sym_enum(HANDLE hProcess, ULONG64 BaseOfDll, PCWSTR Mask,
if
(
BaseOfDll
==
0
)
{
/* do local variables ? */
if
(
!
Mask
||
!
(
bang
=
strchrW
(
Mask
,
'!'
)))
if
(
!
Mask
||
!
(
bang
=
wcschr
(
Mask
,
'!'
)))
return
symt_enum_locals
(
pair
.
pcs
,
Mask
,
se
);
if
(
bang
==
Mask
)
return
FALSE
;
...
...
@@ -1082,7 +1082,7 @@ static BOOL sym_enum(HANDLE hProcess, ULONG64 BaseOfDll, PCWSTR Mask,
return
FALSE
;
/* we always ignore module name from Mask when BaseOfDll is defined */
if
(
Mask
&&
(
bang
=
strchrW
(
Mask
,
'!'
)))
if
(
Mask
&&
(
bang
=
wcschr
(
Mask
,
'!'
)))
{
if
(
bang
==
Mask
)
return
FALSE
;
Mask
=
bang
+
1
;
...
...
@@ -1841,7 +1841,7 @@ DWORD WINAPI UnDecorateSymbolNameW(const WCHAR *decorated_name, WCHAR *undecorat
{
MultiByteToWideChar
(
CP_ACP
,
0
,
ptr
,
-
1
,
undecorated_name
,
undecorated_length
);
undecorated_name
[
undecorated_length
-
1
]
=
0
;
ret
=
strlenW
(
undecorated_name
);
ret
=
l
strlenW
(
undecorated_name
);
und_free
(
ptr
);
}
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
...
...
@@ -1864,7 +1864,7 @@ static int re_fetch_char(const WCHAR** re)
static
inline
int
re_match_char
(
WCHAR
ch1
,
WCHAR
ch2
,
BOOL
_case
)
{
return
_case
?
ch1
-
ch2
:
to
upperW
(
ch1
)
-
toupperW
(
ch2
);
return
_case
?
ch1
-
ch2
:
to
wupper
(
ch1
)
-
towupper
(
ch2
);
}
static
const
WCHAR
*
re_match_one
(
const
WCHAR
*
string
,
const
WCHAR
*
elt
,
BOOL
_case
)
...
...
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