1 /*++ BUILD Version: 0000        Increment this if a change has global effects
2
3 Copyright (c) Microsoft Corporation. All rights reserved.
4
5 Module Name:
6
7       imagehlp.h
8
9 Abstract:
10
11       This module defines the prototypes and constants required for the image
12       help routines.
13
14 Revision History:
15
16 --*/
17
18 #ifndef _IMAGEHLP_
19 #define _IMAGEHLP_
20
21 #if _MSC_VER > 1020
22 #pragma once
23 #endif
24
25
26 // As a general principal always call the 64 bit version
27 // of every API, if a choice exists.  The 64 bit version
28 // works great on 32 bit platforms, and is forward
29 // compatible to 64 bit platforms.
30
31 #ifdef _WIN64
32 #ifndef _IMAGEHLP64
33 #define _IMAGEHLP64
34 #endif
35 #endif
36
37 // for those without specstrings.h
38
39 #ifndef __specstrings
40  #define __in
41  #define __out
42  #define __inout
43  #define __in_opt
44  #define __out_opt
45  #define __inout_opt
46  #define __in_ecount(x)
47  #define __out_ecount(x)
48  #define __inout_ecount(x)
49  #define __in_bcount(x)
50  #define __out_bcount(x)
51  #define __inout_bcount(x)
52  #define __out_xcount(x)
53  #define __deref_opt_out
54  #define __deref_out
55 #endif
56
57
58 #ifndef WINTRUST_H
59 #include <wintrust.h>
60 #endif
61
62
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66
67 #ifdef _IMAGEHLP_SOURCE_
68  #define IMAGEAPI __stdcall
69  #define DBHLP_DEPRECIATED
70 #else
71  #define IMAGEAPI DECLSPEC_IMPORT __stdcall
72  #if (_MSC_VER >= 1300) && !defined(MIDL_PASS)
73   #define DBHLP_DEPRECIATED     __declspec(deprecated)
74  #else
75   #define DBHLP_DEPRECIATED
76  #endif
77 #endif
78
79 #define DBHLPAPI IMAGEAPI
80
81 #define IMAGE_SEPARATION (64*1024)
82
83 // Observant readers may notice that 2 new fields,
84 // 'fReadOnly' and 'Version' have been added to
85 // the LOADED_IMAGE structure after 'fDOSImage'.
86 // This does not change the size of the structure 
87 // from previous headers.  That is because while 
88 // 'fDOSImage' is a byte, it is padded by the 
89 // compiler to 4 bytes.  So the 2 new fields are 
90 // slipped into the extra space.
91
92 typedef struct _LOADED_IMAGE {
93       PSTR                              ModuleName;
94       HANDLE                          hFile;
95       PUCHAR                          MappedAddress;
96 #ifdef _IMAGEHLP64
97       PIMAGE_NT_HEADERS64     FileHeader;
98 #else
99       PIMAGE_NT_HEADERS32     FileHeader;
100 #endif
101       PIMAGE_SECTION_HEADER LastRvaSection;
102       ULONG                            NumberOfSections;
103       PIMAGE_SECTION_HEADER Sections;
104       ULONG                            Characteristics;
Lines 105 ... 4640 are skipped.
4641 //        A pointer to the desired data.
4642 //
4643 //--
4644
4645 #define RVA_TO_ADDR(Mapping,Rva) ((PVOID)(((ULONG_PTR) (Mapping)) + (Rva)))
4646
4647 BOOL
4648 WINAPI
4649 MiniDumpWriteDump(
4650       IN HANDLE hProcess,
4651       IN DWORD ProcessId,
4652       IN HANDLE hFile,
4653       IN MINIDUMP_TYPE DumpType,
4654       IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
4655       IN CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, OPTIONAL
4656       IN CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam OPTIONAL
4657       );
4658
4659 BOOL
4660 WINAPI
4661 MiniDumpReadDumpStream(
4662       IN PVOID BaseOfDump,
4663       IN ULONG StreamNumber,
4664       OUT PMINIDUMP_DIRECTORY * Dir, OPTIONAL
4665       OUT PVOID * StreamPointer, OPTIONAL
4666       OUT ULONG * StreamSize OPTIONAL
4667       );
4668
4669 #if defined(_MSC_VER)
4670 #if _MSC_VER >= 800
4671 #if _MSC_VER >= 1200
4672 #pragma warning(pop)
4673 #else
4674 #pragma warning(default:4200)      /* Zero length array */
4675 #pragma warning(default:4201)      /* Nameless struct/union */
4676 #endif
4677 #endif
4678 #endif
4679
4680 #include <poppack.h>
4681
4682 #ifdef __cplusplus
4683 }
4684 #endif
4685
4686
4687 #endif // _IMAGEHLP_
4688
4689