ReactOS  0.4.15-dev-1386-g5cb9f87
getraw.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * FILE: lib/rossym/getraw.c
5  * PURPOSE: Convert rossym info to raw external format
6  *
7  * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com)
8  */
9 
10 #define NTOSAPI
11 #include <ntdef.h>
12 #include <reactos/rossym.h>
13 #include "rossympriv.h"
14 
15 ULONG
17 {
18  return sizeof(ROSSYM_HEADER)
19  + RosSymInfo->SymbolsCount * sizeof(ROSSYM_ENTRY)
20  + RosSymInfo->StringsLength;
21 }
22 
23 VOID
24 RosSymGetRawData(PROSSYM_INFO RosSymInfo, PVOID RawData)
25 {
26  PROSSYM_HEADER RosSymHeader;
27 
28  RosSymHeader = (PROSSYM_HEADER) RawData;
29  RosSymHeader->SymbolsOffset = sizeof(ROSSYM_HEADER);
30  RosSymHeader->SymbolsLength = RosSymInfo->SymbolsCount * sizeof(ROSSYM_ENTRY);
31  RosSymHeader->StringsOffset = RosSymHeader->SymbolsOffset + RosSymHeader->SymbolsLength;
32  RosSymHeader->StringsLength = RosSymInfo->StringsLength;
33 
34  memcpy((char *) RawData + RosSymHeader->SymbolsOffset, RosSymInfo->Symbols,
35  RosSymHeader->SymbolsLength);
36  memcpy((char *) RawData + RosSymHeader->StringsOffset, RosSymInfo->Strings,
37  RosSymHeader->StringsLength);
38 }
struct _ROSSYM_HEADER * PROSSYM_HEADER
Definition: rossym.h:26
unsigned long StringsOffset
Definition: rossym.h:22
ULONG RosSymGetRawDataLength(PROSSYM_INFO RosSymInfo)
Definition: getraw.c:16
struct _ROSSYM_HEADER ROSSYM_HEADER
PCHAR Strings
Definition: rossympriv.h:15
struct _ROSSYM_ENTRY ROSSYM_ENTRY
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ULONG StringsLength
Definition: rossympriv.h:16
unsigned long StringsLength
Definition: rossym.h:23
unsigned long SymbolsLength
Definition: rossym.h:21
unsigned int ULONG
Definition: retypes.h:1
ULONG SymbolsCount
Definition: rossympriv.h:14
unsigned long SymbolsOffset
Definition: rossym.h:20
PROSSYM_ENTRY Symbols
Definition: rossympriv.h:13
VOID RosSymGetRawData(PROSSYM_INFO RosSymInfo, PVOID RawData)
Definition: getraw.c:24