[CMAKE]
[reactos.git] / include / reactos / rossym.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: include/reactos/rossym.h
5 * PURPOSE: Handling of rossym symbol info
6 *
7 * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com)
8 */
9
10 #ifndef REACTOS_ROSSYM_H_INCLUDED
11 #define REACTOS_ROSSYM_H_INCLUDED
12
13 #define ROSSYM_SECTION_NAME ".rossym"
14
15 typedef struct _ROSSYM_HEADER {
16 unsigned long SymbolsOffset;
17 unsigned long SymbolsLength;
18 unsigned long StringsOffset;
19 unsigned long StringsLength;
20 } ROSSYM_HEADER, *PROSSYM_HEADER;
21
22 typedef struct _ROSSYM_ENTRY {
23 ULONG_PTR Address;
24 ULONG FunctionOffset;
25 ULONG FileOffset;
26 ULONG SourceLine;
27 } ROSSYM_ENTRY, *PROSSYM_ENTRY;
28
29 typedef struct _ROSSYM_CALLBACKS {
30 PVOID (*AllocMemProc)(ULONG_PTR Size);
31 VOID (*FreeMemProc)(PVOID Area);
32 BOOLEAN (*ReadFileProc)(PVOID FileContext, PVOID Buffer, ULONG Size);
33 BOOLEAN (*SeekFileProc)(PVOID FileContext, ULONG_PTR Position);
34 } ROSSYM_CALLBACKS, *PROSSYM_CALLBACKS;
35
36 typedef struct _ROSSYM_INFO *PROSSYM_INFO;
37
38 VOID RosSymInit(PROSSYM_CALLBACKS Callbacks);
39 VOID RosSymInitKernelMode(VOID);
40 VOID RosSymInitUserMode(VOID);
41
42 BOOLEAN RosSymCreateFromRaw(PVOID RawData, ULONG_PTR DataSize,
43 PROSSYM_INFO *RosSymInfo);
44 BOOLEAN RosSymCreateFromMem(PVOID ImageStart, ULONG_PTR ImageSize,
45 PROSSYM_INFO *RosSymInfo);
46 BOOLEAN RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo);
47 ULONG RosSymGetRawDataLength(PROSSYM_INFO RosSymInfo);
48 VOID RosSymGetRawData(PROSSYM_INFO RosSymInfo, PVOID RawData);
49 BOOLEAN RosSymGetAddressInformation(PROSSYM_INFO RosSymInfo,
50 ULONG_PTR RelativeAddress,
51 ULONG *LineNumber,
52 char *FileName,
53 char *FunctionName);
54 VOID RosSymDelete(PROSSYM_INFO RosSymInfo);
55
56 #endif /* REACTOS_ROSSYM_H_INCLUDED */
57
58 /* EOF */
59