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
fa4dfa43
Commit
fa4dfa43
authored
Aug 06, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Aug 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Implement UnDecorateSymbolNameW.
Also fixes a bug in UnDecorateSymbolName when undecorated_length == 0.
parent
82dffc95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
15 deletions
+52
-15
dbghelp.spec
dlls/dbghelp/dbghelp.spec
+2
-2
symbol.c
dlls/dbghelp/symbol.c
+50
-13
No files found.
dlls/dbghelp/dbghelp.spec
View file @
fa4dfa43
...
@@ -183,8 +183,8 @@
...
@@ -183,8 +183,8 @@
@ stdcall SymUnDName64(ptr str long)
@ stdcall SymUnDName64(ptr str long)
@ stdcall SymUnloadModule(long long)
@ stdcall SymUnloadModule(long long)
@ stdcall SymUnloadModule64(long int64)
@ stdcall SymUnloadModule64(long int64)
@ stdcall UnDecorateSymbolName(str
s
tr long long)
@ stdcall UnDecorateSymbolName(str
p
tr long long)
@ st
ub UnDecorateSymbolNameW
@ st
dcall UnDecorateSymbolNameW(wstr ptr long long)
@ stdcall UnmapDebugInformation(ptr)
@ stdcall UnmapDebugInformation(ptr)
@ stdcall WinDbgExtensionDllInit(ptr long long)
@ stdcall WinDbgExtensionDllInit(ptr long long)
#@ stub block
#@ stub block
...
...
dlls/dbghelp/symbol.c
View file @
fa4dfa43
...
@@ -1752,32 +1752,69 @@ BOOL WINAPI SymUnDName64(PIMAGEHLP_SYMBOL64 sym, PSTR UnDecName, DWORD UnDecName
...
@@ -1752,32 +1752,69 @@ BOOL WINAPI SymUnDName64(PIMAGEHLP_SYMBOL64 sym, PSTR UnDecName, DWORD UnDecName
static
void
*
CDECL
und_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
void
*
CDECL
und_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
void
CDECL
und_free
(
void
*
ptr
)
{
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
static
void
CDECL
und_free
(
void
*
ptr
)
{
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
/***********************************************************************
static
char
*
und_name
(
char
*
buffer
,
const
char
*
mangled
,
int
buflen
,
unsigned
short
flags
)
* UnDecorateSymbolName (DBGHELP.@)
*/
DWORD
WINAPI
UnDecorateSymbolName
(
PCSTR
DecoratedName
,
PSTR
UnDecoratedName
,
DWORD
UndecoratedLength
,
DWORD
Flags
)
{
{
/* undocumented from msvcrt */
/* undocumented from msvcrt */
static
HANDLE
hMsvcrt
;
static
HANDLE
hMsvcrt
;
static
char
*
(
CDECL
*
p_undname
)(
char
*
,
const
char
*
,
int
,
void
*
(
CDECL
*
)(
size_t
),
void
(
CDECL
*
)(
void
*
),
unsigned
short
);
static
char
*
(
CDECL
*
p_undname
)(
char
*
,
const
char
*
,
int
,
void
*
(
CDECL
*
)(
size_t
),
void
(
CDECL
*
)(
void
*
),
unsigned
short
);
static
const
WCHAR
szMsvcrt
[]
=
{
'm'
,
's'
,
'v'
,
'c'
,
'r'
,
't'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
szMsvcrt
[]
=
{
'm'
,
's'
,
'v'
,
'c'
,
'r'
,
't'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
TRACE
(
"(%s, %p, %d, 0x%08x)
\n
"
,
debugstr_a
(
DecoratedName
),
UnDecoratedName
,
UndecoratedLength
,
Flags
);
if
(
!
p_undname
)
if
(
!
p_undname
)
{
{
if
(
!
hMsvcrt
)
hMsvcrt
=
LoadLibraryW
(
szMsvcrt
);
if
(
!
hMsvcrt
)
hMsvcrt
=
LoadLibraryW
(
szMsvcrt
);
if
(
hMsvcrt
)
p_undname
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"__unDName"
);
if
(
hMsvcrt
)
p_undname
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"__unDName"
);
if
(
!
p_undname
)
return
0
;
if
(
!
p_undname
)
return
NULL
;
}
}
if
(
!
UnDecoratedName
)
return
0
;
return
p_undname
(
buffer
,
mangled
,
buflen
,
und_alloc
,
und_free
,
flags
);
if
(
!
p_undname
(
UnDecoratedName
,
DecoratedName
,
UndecoratedLength
,
}
und_alloc
,
und_free
,
Flags
))
/***********************************************************************
* UnDecorateSymbolName (DBGHELP.@)
*/
DWORD
WINAPI
UnDecorateSymbolName
(
const
char
*
decorated_name
,
char
*
undecorated_name
,
DWORD
undecorated_length
,
DWORD
flags
)
{
TRACE
(
"(%s, %p, %d, 0x%08x)
\n
"
,
debugstr_a
(
decorated_name
),
undecorated_name
,
undecorated_length
,
flags
);
if
(
!
undecorated_name
||
!
undecorated_length
)
return
0
;
if
(
!
und_name
(
undecorated_name
,
decorated_name
,
undecorated_length
,
flags
))
return
0
;
return
strlen
(
undecorated_name
);
}
/***********************************************************************
* UnDecorateSymbolNameW (DBGHELP.@)
*/
DWORD
WINAPI
UnDecorateSymbolNameW
(
const
WCHAR
*
decorated_name
,
WCHAR
*
undecorated_name
,
DWORD
undecorated_length
,
DWORD
flags
)
{
char
*
buf
,
*
ptr
;
int
len
,
ret
=
0
;
TRACE
(
"(%s, %p, %d, 0x%08x)
\n
"
,
debugstr_w
(
decorated_name
),
undecorated_name
,
undecorated_length
,
flags
);
if
(
!
undecorated_name
||
!
undecorated_length
)
return
0
;
return
0
;
return
strlen
(
UnDecoratedName
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
decorated_name
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
{
WideCharToMultiByte
(
CP_ACP
,
0
,
decorated_name
,
-
1
,
buf
,
len
,
NULL
,
NULL
);
if
((
ptr
=
und_name
(
NULL
,
buf
,
0
,
flags
)))
{
MultiByteToWideChar
(
CP_ACP
,
0
,
ptr
,
-
1
,
undecorated_name
,
undecorated_length
);
undecorated_name
[
undecorated_length
-
1
]
=
0
;
ret
=
strlenW
(
undecorated_name
);
und_free
(
ptr
);
}
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
return
ret
;
}
}
#define WILDCHAR(x) (-(x))
#define WILDCHAR(x) (-(x))
...
...
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