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
b32cfb18
Commit
b32cfb18
authored
Jan 13, 2008
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: In Minidump, change a couple of internal names for consistency.
parent
2af9736f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
41 deletions
+41
-41
minidump.c
dlls/dbghelp/minidump.c
+41
-41
No files found.
dlls/dbghelp/minidump.c
View file @
b32cfb18
...
...
@@ -57,8 +57,8 @@ struct dump_context
void
*
pcs_buffer
;
SYSTEM_PROCESS_INFORMATION
*
spi
;
/* module information */
struct
dump_module
*
module
;
unsigned
num_module
;
struct
dump_module
*
module
s
;
unsigned
num_module
s
;
/* exception information */
/* output information */
MINIDUMP_TYPE
type
;
...
...
@@ -71,12 +71,12 @@ struct dump_context
};
/******************************************************************
* fetch_process_info
* fetch_process
es
_info
*
* reads system wide process information, and make spi point to the record
* for process of id 'pid'
*/
static
BOOL
fetch_process_info
(
struct
dump_context
*
dc
)
static
BOOL
fetch_process
es
_info
(
struct
dump_context
*
dc
)
{
ULONG
buf_size
=
0x1000
;
NTSTATUS
nts
;
...
...
@@ -221,24 +221,24 @@ static BOOL add_module(struct dump_context* dc, const WCHAR* name,
DWORD
base
,
DWORD
size
,
DWORD
timestamp
,
DWORD
checksum
,
BOOL
is_elf
)
{
if
(
!
dc
->
module
)
dc
->
module
=
HeapAlloc
(
GetProcessHeap
(),
0
,
++
dc
->
num_module
*
sizeof
(
*
dc
->
module
));
if
(
!
dc
->
module
s
)
dc
->
module
s
=
HeapAlloc
(
GetProcessHeap
(),
0
,
++
dc
->
num_modules
*
sizeof
(
*
dc
->
modules
));
else
dc
->
module
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
dc
->
module
,
++
dc
->
num_module
*
sizeof
(
*
dc
->
module
));
if
(
!
dc
->
module
)
return
FALSE
;
dc
->
module
s
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
dc
->
modules
,
++
dc
->
num_modules
*
sizeof
(
*
dc
->
modules
));
if
(
!
dc
->
module
s
)
return
FALSE
;
if
(
is_elf
||
!
GetModuleFileNameExW
(
dc
->
hProcess
,
(
HMODULE
)
base
,
dc
->
module
[
dc
->
num_module
-
1
].
name
,
sizeof
(
dc
->
module
[
dc
->
num_module
-
1
].
name
)
/
sizeof
(
WCHAR
)))
lstrcpynW
(
dc
->
module
[
dc
->
num_module
-
1
].
name
,
name
,
sizeof
(
dc
->
module
[
dc
->
num_module
-
1
].
name
)
/
sizeof
(
WCHAR
));
dc
->
module
[
dc
->
num_module
-
1
].
base
=
base
;
dc
->
module
[
dc
->
num_module
-
1
].
size
=
size
;
dc
->
module
[
dc
->
num_module
-
1
].
timestamp
=
timestamp
;
dc
->
module
[
dc
->
num_module
-
1
].
checksum
=
checksum
;
dc
->
module
[
dc
->
num_module
-
1
].
is_elf
=
is_elf
;
dc
->
module
s
[
dc
->
num_modules
-
1
].
name
,
sizeof
(
dc
->
module
s
[
dc
->
num_modules
-
1
].
name
)
/
sizeof
(
WCHAR
)))
lstrcpynW
(
dc
->
module
s
[
dc
->
num_modules
-
1
].
name
,
name
,
sizeof
(
dc
->
module
s
[
dc
->
num_modules
-
1
].
name
)
/
sizeof
(
WCHAR
));
dc
->
module
s
[
dc
->
num_modules
-
1
].
base
=
base
;
dc
->
module
s
[
dc
->
num_modules
-
1
].
size
=
size
;
dc
->
module
s
[
dc
->
num_modules
-
1
].
timestamp
=
timestamp
;
dc
->
module
s
[
dc
->
num_modules
-
1
].
checksum
=
checksum
;
dc
->
module
s
[
dc
->
num_modules
-
1
].
is_elf
=
is_elf
;
return
TRUE
;
}
...
...
@@ -285,7 +285,7 @@ static BOOL fetch_elf_module_info_cb(const WCHAR* name, unsigned long base,
return
TRUE
;
}
static
void
fetch_module_info
(
struct
dump_context
*
dc
)
static
void
fetch_module
s
_info
(
struct
dump_context
*
dc
)
{
EnumerateLoadedModulesW64
(
dc
->
hProcess
,
fetch_pe_module_info_cb
,
dc
);
/* Since we include ELF modules in a separate stream from the regular PE ones,
...
...
@@ -410,10 +410,10 @@ static void dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
RVA
rva_base
;
DWORD
flags_out
;
for
(
i
=
nmod
=
0
;
i
<
dc
->
num_module
;
i
++
)
for
(
i
=
nmod
=
0
;
i
<
dc
->
num_module
s
;
i
++
)
{
if
((
dc
->
module
[
i
].
is_elf
&&
dump_elf
)
||
(
!
dc
->
module
[
i
].
is_elf
&&
!
dump_elf
))
if
((
dc
->
module
s
[
i
].
is_elf
&&
dump_elf
)
||
(
!
dc
->
module
s
[
i
].
is_elf
&&
!
dump_elf
))
nmod
++
;
}
...
...
@@ -425,10 +425,10 @@ static void dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
*/
rva_base
=
dc
->
rva
;
dc
->
rva
+=
*
size
=
sizeof
(
mdModuleList
.
NumberOfModules
)
+
sizeof
(
mdModule
)
*
nmod
;
for
(
i
=
0
;
i
<
dc
->
num_module
;
i
++
)
for
(
i
=
0
;
i
<
dc
->
num_module
s
;
i
++
)
{
if
((
dc
->
module
[
i
].
is_elf
&&
!
dump_elf
)
||
(
!
dc
->
module
[
i
].
is_elf
&&
dump_elf
))
if
((
dc
->
module
s
[
i
].
is_elf
&&
!
dump_elf
)
||
(
!
dc
->
module
s
[
i
].
is_elf
&&
dump_elf
))
continue
;
flags_out
=
ModuleWriteModule
|
ModuleWriteMiscRecord
|
ModuleWriteCvRecord
;
...
...
@@ -438,10 +438,10 @@ static void dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
flags_out
|=
ModuleWriteTlsData
;
if
(
dc
->
type
&
MiniDumpWithCodeSegs
)
flags_out
|=
ModuleWriteCodeSegs
;
ms
->
Length
=
(
lstrlenW
(
dc
->
module
[
i
].
name
)
+
1
)
*
sizeof
(
WCHAR
);
ms
->
Length
=
(
lstrlenW
(
dc
->
module
s
[
i
].
name
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
sizeof
(
ULONG
)
+
ms
->
Length
>
sizeof
(
tmp
))
FIXME
(
"Buffer overflow!!!
\n
"
);
lstrcpyW
(
ms
->
Buffer
,
dc
->
module
[
i
].
name
);
lstrcpyW
(
ms
->
Buffer
,
dc
->
module
s
[
i
].
name
);
if
(
dc
->
cb
)
{
...
...
@@ -453,10 +453,10 @@ static void dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
cbin
.
CallbackType
=
ModuleCallback
;
cbin
.
u
.
Module
.
FullPath
=
ms
->
Buffer
;
cbin
.
u
.
Module
.
BaseOfImage
=
dc
->
module
[
i
].
base
;
cbin
.
u
.
Module
.
SizeOfImage
=
dc
->
module
[
i
].
size
;
cbin
.
u
.
Module
.
CheckSum
=
dc
->
module
[
i
].
checksum
;
cbin
.
u
.
Module
.
TimeDateStamp
=
dc
->
module
[
i
].
timestamp
;
cbin
.
u
.
Module
.
BaseOfImage
=
dc
->
module
s
[
i
].
base
;
cbin
.
u
.
Module
.
SizeOfImage
=
dc
->
module
s
[
i
].
size
;
cbin
.
u
.
Module
.
CheckSum
=
dc
->
module
s
[
i
].
checksum
;
cbin
.
u
.
Module
.
TimeDateStamp
=
dc
->
module
s
[
i
].
timestamp
;
memset
(
&
cbin
.
u
.
Module
.
VersionInfo
,
0
,
sizeof
(
cbin
.
u
.
Module
.
VersionInfo
));
cbin
.
u
.
Module
.
CvRecord
=
NULL
;
cbin
.
u
.
Module
.
SizeOfCvRecord
=
0
;
...
...
@@ -470,10 +470,10 @@ static void dump_modules(struct dump_context* dc, BOOL dump_elf, DWORD *size
}
if
(
flags_out
&
ModuleWriteModule
)
{
mdModule
.
BaseOfImage
=
dc
->
module
[
i
].
base
;
mdModule
.
SizeOfImage
=
dc
->
module
[
i
].
size
;
mdModule
.
CheckSum
=
dc
->
module
[
i
].
checksum
;
mdModule
.
TimeDateStamp
=
dc
->
module
[
i
].
timestamp
;
mdModule
.
BaseOfImage
=
dc
->
module
s
[
i
].
base
;
mdModule
.
SizeOfImage
=
dc
->
module
s
[
i
].
size
;
mdModule
.
CheckSum
=
dc
->
module
s
[
i
].
checksum
;
mdModule
.
TimeDateStamp
=
dc
->
module
s
[
i
].
timestamp
;
mdModule
.
ModuleNameRva
=
dc
->
rva
;
ms
->
Length
-=
sizeof
(
WCHAR
);
append
(
dc
,
ms
,
sizeof
(
ULONG
)
+
ms
->
Length
+
sizeof
(
WCHAR
));
...
...
@@ -700,16 +700,16 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
dc
.
hProcess
=
hProcess
;
dc
.
hFile
=
hFile
;
dc
.
pid
=
pid
;
dc
.
module
=
NULL
;
dc
.
num_module
=
0
;
dc
.
module
s
=
NULL
;
dc
.
num_module
s
=
0
;
dc
.
cb
=
CallbackParam
;
dc
.
type
=
DumpType
;
dc
.
mem
=
NULL
;
dc
.
num_mem
=
0
;
dc
.
rva
=
0
;
if
(
!
fetch_process_info
(
&
dc
))
return
FALSE
;
fetch_module_info
(
&
dc
);
if
(
!
fetch_process
es
_info
(
&
dc
))
return
FALSE
;
fetch_module
s
_info
(
&
dc
);
/* 1) init */
nStreams
=
6
+
(
ExceptionParam
?
1
:
0
)
+
...
...
@@ -806,7 +806,7 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile,
HeapFree
(
GetProcessHeap
(),
0
,
dc
.
pcs_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
dc
.
mem
);
HeapFree
(
GetProcessHeap
(),
0
,
dc
.
module
);
HeapFree
(
GetProcessHeap
(),
0
,
dc
.
module
s
);
return
TRUE
;
}
...
...
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