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
0d89f67e
Commit
0d89f67e
authored
May 17, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Add support for dumping handle data stream from minidumps.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a9f9c1a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
6 deletions
+83
-6
minidumpapiset.h
include/minidumpapiset.h
+39
-0
minidump.c
tools/winedump/minidump.c
+44
-6
No files found.
include/minidumpapiset.h
View file @
0d89f67e
...
...
@@ -373,6 +373,38 @@ typedef struct _MINIDUMP_USER_STREAM_INFORMATION
PMINIDUMP_USER_STREAM
UserStreamArray
;
}
MINIDUMP_USER_STREAM_INFORMATION
,
*
PMINIDUMP_USER_STREAM_INFORMATION
;
typedef
struct
_MINIDUMP_HANDLE_DATA_STREAM
{
ULONG32
SizeOfHeader
;
ULONG32
SizeOfDescriptor
;
ULONG32
NumberOfDescriptors
;
ULONG32
Reserved
;
}
MINIDUMP_HANDLE_DATA_STREAM
,
*
PMINIDUMP_HANDLE_DATA_STREAM
;
typedef
struct
_MINIDUMP_HANDLE_DESCRIPTOR
{
ULONG64
Handle
;
RVA
TypeNameRva
;
RVA
ObjectNameRva
;
ULONG32
Attributes
;
ULONG32
GrantedAccess
;
ULONG32
HandleCount
;
ULONG32
PointerCount
;
}
MINIDUMP_HANDLE_DESCRIPTOR
,
*
PMINIDUMP_HANDLE_DESCRIPTOR
;
typedef
struct
_MINIDUMP_HANDLE_DESCRIPTOR_2
{
ULONG64
Handle
;
RVA
TypeNameRva
;
RVA
ObjectNameRva
;
ULONG32
Attributes
;
ULONG32
GrantedAccess
;
ULONG32
HandleCount
;
ULONG32
PointerCount
;
RVA
ObjectInfoRva
;
ULONG32
Reserved0
;
}
MINIDUMP_HANDLE_DESCRIPTOR_2
,
*
PMINIDUMP_HANDLE_DESCRIPTOR_2
;
typedef
enum
_MINIDUMP_STREAM_TYPE
{
UnusedStream
=
0
,
...
...
@@ -393,6 +425,13 @@ typedef enum _MINIDUMP_STREAM_TYPE
MiscInfoStream
=
15
,
MemoryInfoListStream
=
16
,
ThreadInfoListStream
=
17
,
HandleOperationListStream
=
18
,
TokenStream
=
19
,
JavaScriptDataStream
=
20
,
SystemMemoryInfoStream
=
21
,
ProcessVmCountersStream
=
22
,
IptTraceStream
=
23
,
ThreadNamesStream
=
24
,
LastReservedStream
=
0xffff
}
MINIDUMP_STREAM_TYPE
;
...
...
tools/winedump/minidump.c
View file @
0d89f67e
...
...
@@ -34,7 +34,9 @@ static void dump_mdmp_data(const MINIDUMP_LOCATION_DESCRIPTOR* md, const char* p
static
void
dump_mdmp_string
(
DWORD
rva
)
{
const
MINIDUMP_STRING
*
ms
=
PRD
(
rva
,
sizeof
(
MINIDUMP_STRING
));
if
(
ms
)
if
(
!
rva
)
printf
(
"<<rva=0>>"
);
else
if
(
ms
)
dump_unicode_str
(
ms
->
Buffer
,
ms
->
Length
/
sizeof
(
WCHAR
)
);
else
printf
(
"<<?>>"
);
...
...
@@ -80,7 +82,7 @@ void mdmp_dump(void)
const
MINIDUMP_HEADER
*
hdr
=
PRD
(
0
,
sizeof
(
MINIDUMP_HEADER
));
const
MINIDUMP_DIRECTORY
*
dir
;
const
void
*
stream
;
unsigned
int
idx
;
unsigned
int
i
,
i
dx
;
if
(
!
hdr
)
{
...
...
@@ -110,7 +112,6 @@ void mdmp_dump(void)
{
const
MINIDUMP_THREAD_LIST
*
mtl
=
stream
;
const
MINIDUMP_THREAD
*
mt
=
mtl
->
Threads
;
unsigned
int
i
;
printf
(
"Threads: %u
\n
"
,
(
UINT
)
mtl
->
NumberOfThreads
);
for
(
i
=
0
;
i
<
mtl
->
NumberOfThreads
;
i
++
,
mt
++
)
...
...
@@ -133,7 +134,6 @@ void mdmp_dump(void)
{
const
MINIDUMP_MODULE_LIST
*
mml
=
stream
;
const
MINIDUMP_MODULE
*
mm
=
mml
->
Modules
;
unsigned
int
i
;
const
char
*
p1
;
const
char
*
p2
;
...
...
@@ -224,7 +224,6 @@ void mdmp_dump(void)
{
const
MINIDUMP_MEMORY_LIST
*
mml
=
stream
;
const
MINIDUMP_MEMORY_DESCRIPTOR
*
mmd
=
mml
->
MemoryRanges
;
unsigned
int
i
;
printf
(
"Memory Ranges: %u
\n
"
,
mml
->
NumberOfMemoryRanges
);
for
(
i
=
0
;
i
<
mml
->
NumberOfMemoryRanges
;
i
++
,
mmd
++
)
...
...
@@ -419,7 +418,6 @@ void mdmp_dump(void)
case
ExceptionStream
:
{
const
MINIDUMP_EXCEPTION_STREAM
*
mes
=
stream
;
unsigned
int
i
;
printf
(
"Exception:
\n
"
);
printf
(
" ThreadId: %#x
\n
"
,
mes
->
ThreadId
);
...
...
@@ -438,6 +436,46 @@ void mdmp_dump(void)
dump_mdmp_data
(
&
mes
->
ThreadContext
,
" "
);
}
break
;
case
HandleDataStream
:
{
const
MINIDUMP_HANDLE_DATA_STREAM
*
mhd
=
stream
;
const
BYTE
*
desc
;
printf
(
"Handle data:
\n
"
);
printf
(
" SizeOfHeader: %u
\n
"
,
mhd
->
SizeOfHeader
);
printf
(
" SizeOfDescriptor: %u
\n
"
,
mhd
->
SizeOfDescriptor
);
printf
(
" NumberOfDescriptors: %u
\n
"
,
mhd
->
NumberOfDescriptors
);
desc
=
(
BYTE
*
)
mhd
+
sizeof
(
*
mhd
);
for
(
i
=
0
;
i
<
mhd
->
NumberOfDescriptors
;
++
i
)
{
const
MINIDUMP_HANDLE_DESCRIPTOR_2
*
hd
=
(
void
*
)
desc
;
printf
(
" Handle [%u]:
\n
"
,
i
);
print_longlong
(
" Handle"
,
hd
->
Handle
);
printf
(
" TypeName: "
);
dump_mdmp_string
(
hd
->
TypeNameRva
);
printf
(
"
\n
"
);
printf
(
" ObjectName: "
);
dump_mdmp_string
(
hd
->
ObjectNameRva
);
printf
(
"
\n
"
);
printf
(
" Attributes: %#x
\n
"
,
hd
->
Attributes
);
printf
(
" GrantedAccess: %#x
\n
"
,
hd
->
GrantedAccess
);
printf
(
" HandleCount: %u
\n
"
,
hd
->
HandleCount
);
printf
(
" PointerCount: %#x
\n
"
,
hd
->
PointerCount
);
if
(
mhd
->
SizeOfDescriptor
>=
sizeof
(
MINIDUMP_HANDLE_DESCRIPTOR_2
))
{
printf
(
" ObjectInfo: "
);
dump_mdmp_string
(
hd
->
ObjectInfoRva
);
printf
(
"
\n
"
);
printf
(
" Reserved0: %#x
\n
"
,
hd
->
Reserved0
);
}
desc
+=
mhd
->
SizeOfDescriptor
;
}
}
break
;
default:
printf
(
"NIY %d
\n
"
,
dir
->
StreamType
);
...
...
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