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
6ee16099
Commit
6ee16099
authored
May 31, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jun 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Implement SymEnumSourceFilesW.
parent
9edafeb7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
121 additions
and
12 deletions
+121
-12
dbghelp.spec
dlls/dbghelp/dbghelp.spec
+1
-1
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+3
-0
module.c
dlls/dbghelp/module.c
+3
-3
source.c
dlls/dbghelp/source.c
+114
-8
No files found.
dlls/dbghelp/dbghelp.spec
View file @
6ee16099
...
...
@@ -45,7 +45,7 @@
@ stub SymEnumProcesses
@ stub SymEnumSourceFileTokens
@ stdcall SymEnumSourceFiles(ptr int64 str ptr ptr)
@ st
ub SymEnumSourceFilesW
@ st
dcall SymEnumSourceFilesW(ptr int64 wstr ptr ptr)
@ stub SymEnumSourceLines
@ stub SymEnumSourceLinesW
@ stub SymEnumSym
...
...
dlls/dbghelp/dbghelp_private.h
View file @
6ee16099
...
...
@@ -538,6 +538,9 @@ extern struct module*
module_find_by_addr
(
const
struct
process
*
pcs
,
unsigned
long
addr
,
enum
module_type
type
)
DECLSPEC_HIDDEN
;
extern
struct
module
*
module_find_by_nameW
(
const
struct
process
*
pcs
,
const
WCHAR
*
name
)
DECLSPEC_HIDDEN
;
extern
struct
module
*
module_find_by_nameA
(
const
struct
process
*
pcs
,
const
char
*
name
)
DECLSPEC_HIDDEN
;
extern
struct
module
*
...
...
dlls/dbghelp/module.c
View file @
6ee16099
...
...
@@ -234,10 +234,10 @@ struct module* module_new(struct process* pcs, const WCHAR* name,
}
/***********************************************************************
* module_find_by_name
* module_find_by_name
W
*
*/
st
atic
struct
module
*
module_find_by_name
(
const
struct
process
*
pcs
,
const
WCHAR
*
name
)
st
ruct
module
*
module_find_by_nameW
(
const
struct
process
*
pcs
,
const
WCHAR
*
name
)
{
struct
module
*
module
;
...
...
@@ -254,7 +254,7 @@ struct module* module_find_by_nameA(const struct process* pcs, const char* name)
WCHAR
wname
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
wname
,
sizeof
(
wname
)
/
sizeof
(
WCHAR
));
return
module_find_by_name
(
pcs
,
wname
);
return
module_find_by_name
W
(
pcs
,
wname
);
}
/***********************************************************************
...
...
dlls/dbghelp/source.c
View file @
6ee16099
...
...
@@ -157,17 +157,19 @@ const char* source_get(const struct module* module, unsigned idx)
}
/******************************************************************
* SymEnumSourceFiles (DBGHELP.@)
* SymEnumSourceFiles
W
(DBGHELP.@)
*
*/
BOOL
WINAPI
SymEnumSourceFiles
(
HANDLE
hProcess
,
ULONG64
ModBase
,
PC
STR
Mask
,
PSYM_ENUMSOURCEFILES_CALLBACK
cbSrcFiles
,
PVOID
UserContext
)
BOOL
WINAPI
SymEnumSourceFiles
W
(
HANDLE
hProcess
,
ULONG64
ModBase
,
PCW
STR
Mask
,
PSYM_ENUMSOURCEFILES_CALLBACKW
cbSrcFiles
,
PVOID
UserContext
)
{
struct
module_pair
pair
;
SOURCEFILE
sf
;
SOURCEFILE
W
sf
;
char
*
ptr
;
WCHAR
*
conversion_buffer
=
NULL
;
DWORD
conversion_buffer_len
=
0
;
if
(
!
cbSrcFiles
)
return
FALSE
;
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
...
...
@@ -181,7 +183,7 @@ BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, PCSTR Mask,
{
if
(
Mask
[
0
]
==
'!'
)
{
pair
.
requested
=
module_find_by_name
A
(
pair
.
pcs
,
Mask
+
1
);
pair
.
requested
=
module_find_by_name
W
(
pair
.
pcs
,
Mask
+
1
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
}
else
...
...
@@ -193,15 +195,119 @@ BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, PCSTR Mask,
if
(
!
pair
.
effective
->
sources
)
return
FALSE
;
for
(
ptr
=
pair
.
effective
->
sources
;
*
ptr
;
ptr
+=
strlen
(
ptr
)
+
1
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
ptr
,
-
1
,
NULL
,
0
);
if
(
len
>
conversion_buffer_len
)
{
HeapFree
(
GetProcessHeap
(),
0
,
conversion_buffer
);
conversion_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
conversion_buffer
)
return
FALSE
;
conversion_buffer_len
=
len
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
ptr
,
-
1
,
conversion_buffer
,
len
);
/* FIXME: not using Mask */
sf
.
ModBase
=
ModBase
;
sf
.
FileName
=
pt
r
;
sf
.
FileName
=
conversion_buffe
r
;
if
(
!
cbSrcFiles
(
&
sf
,
UserContext
))
break
;
}
HeapFree
(
GetProcessHeap
(),
0
,
conversion_buffer
);
return
TRUE
;
}
struct
enum_sources_files_context
{
PSYM_ENUMSOURCEFILES_CALLBACK
callbackA
;
PVOID
caller_context
;
char
*
conversion_buffer
;
DWORD
conversion_buffer_len
;
DWORD
callback_error
;
};
static
BOOL
CALLBACK
enum_source_files_W_to_A
(
PSOURCEFILEW
source_file
,
PVOID
context
)
{
struct
enum_sources_files_context
*
ctx
=
context
;
SOURCEFILE
source_fileA
;
DWORD
len
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
source_file
->
FileName
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
len
>
ctx
->
conversion_buffer_len
)
{
char
*
ptr
=
ctx
->
conversion_buffer
?
HeapReAlloc
(
GetProcessHeap
(),
0
,
ctx
->
conversion_buffer
,
len
)
:
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
if
(
!
ptr
)
{
ctx
->
callback_error
=
ERROR_OUTOFMEMORY
;
return
FALSE
;
}
ctx
->
conversion_buffer
=
ptr
;
ctx
->
conversion_buffer_len
=
len
;
}
WideCharToMultiByte
(
CP_ACP
,
0
,
source_file
->
FileName
,
-
1
,
ctx
->
conversion_buffer
,
len
,
NULL
,
NULL
);
source_fileA
.
ModBase
=
source_file
->
ModBase
;
source_fileA
.
FileName
=
ctx
->
conversion_buffer
;
return
ctx
->
callbackA
(
&
source_fileA
,
ctx
->
caller_context
);
}
/******************************************************************
* SymEnumSourceFiles (DBGHELP.@)
*
*/
BOOL
WINAPI
SymEnumSourceFiles
(
HANDLE
hProcess
,
ULONG64
ModBase
,
PCSTR
Mask
,
PSYM_ENUMSOURCEFILES_CALLBACK
cbSrcFiles
,
PVOID
UserContext
)
{
WCHAR
*
maskW
=
NULL
;
PSYM_ENUMSOURCEFILES_CALLBACKW
callbackW
;
PVOID
context
;
struct
enum_sources_files_context
callback_context
=
{
cbSrcFiles
,
UserContext
};
BOOL
ret
;
if
(
Mask
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
Mask
,
-
1
,
NULL
,
0
);
maskW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
maskW
)
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
Mask
,
-
1
,
maskW
,
len
);
}
if
(
cbSrcFiles
)
{
callbackW
=
enum_source_files_W_to_A
;
context
=
&
callback_context
;
}
else
{
callbackW
=
NULL
;
context
=
UserContext
;
}
ret
=
SymEnumSourceFilesW
(
hProcess
,
ModBase
,
maskW
,
callbackW
,
context
);
if
(
callback_context
.
callback_error
)
{
SetLastError
(
callback_context
.
callback_error
);
ret
=
FALSE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
callback_context
.
conversion_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
maskW
);
return
ret
;
}
/******************************************************************
* SymGetSourceFileToken (DBGHELP.@)
*
...
...
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