ReactOS  0.4.15-dev-1148-g8a4273b
rsym.c File Reference
#include <ntstatus.h>
#include <windows.h>
#include <dbghelp.h>
#include <cvconst.h>
#include <stdio.h>
#include "wine/test.h"
Include dependency graph for rsym.c:

Go to the source code of this file.

Classes

struct  _test_context
 
struct  _test_data
 

Macros

#define WIN32_NO_STATUS
 
#define ok_ulonglong(expression, result)
 
#define ok_ulonglong_(file, line, expression, result)
 
#define init_sym(fInvadeProcess)   init_sym_imp(fInvadeProcess, __FILE__, __LINE__)
 
#define INIT_PSYM(buff)
 

Typedefs

typedef struct _test_context test_context
 

Functions

void dump_rsym (const char *filename)
 
int extract_gcc_dll (char szFile[MAX_PATH])
 
void cleanup_gcc_dll ()
 
static HANDLE proc ()
 
static BOOL init_sym_imp (BOOL fInvadeProcess, const char *file, int line)
 
static void deinit_sym ()
 
static BOOL supports_rsym (HANDLE hProc, DWORD64 BaseAddress)
 
static void test_SymFromName (HANDLE hProc, DWORD64 BaseAddress)
 
static void test_SymFromAddr (HANDLE hProc, DWORD64 BaseAddress)
 
static BOOL CALLBACK EnumSymProc (PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext)
 
static void test_SymEnumSymbols (HANDLE hProc, DWORD64 BaseAddress)
 
 START_TEST (rsym)
 

Variables

static struct _test_data test_data []
 

Macro Definition Documentation

◆ INIT_PSYM

#define INIT_PSYM (   buff)
Value:
do { \
memset((buff), 0, sizeof((buff))); \
((PSYMBOL_INFO)(buff))->SizeOfStruct = sizeof(SYMBOL_INFO); \
((PSYMBOL_INFO)(buff))->MaxNameLen = MAX_SYM_NAME; \
} while (0)
#define MAX_SYM_NAME
Definition: rsym.c:34
struct _SYMBOL_INFO * PSYMBOL_INFO
static unsigned char buff[32768]
Definition: fatten.c:17

Definition at line 64 of file rsym.c.

◆ init_sym

#define init_sym (   fInvadeProcess)    init_sym_imp(fInvadeProcess, __FILE__, __LINE__)

Definition at line 62 of file rsym.c.

◆ ok_ulonglong

#define ok_ulonglong (   expression,
  result 
)
Value:
do { \
ULONG64 _value = (expression); \
ULONG64 _result = (result); \
ok(_value == _result, "Wrong value for '%s', expected: " #result " (%s), got: %s\n", \
#expression, wine_dbgstr_longlong(_result), wine_dbgstr_longlong(_value)); \
} while (0)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
GLuint64EXT * result
Definition: glext.h:11304

Definition at line 19 of file rsym.c.

◆ ok_ulonglong_

#define ok_ulonglong_ (   file,
  line,
  expression,
  result 
)
Value:
do { \
ULONG64 _value = (expression); \
ULONG64 _result = (result); \
ok_(file, line)(_value == _result, "Wrong value for '%s', expected: " #result " (%s), got: %s\n", \
#expression, wine_dbgstr_longlong(_result), wine_dbgstr_longlong(_value)); \
} while (0)
Definition: parser.c:48
GLuint64EXT * result
Definition: glext.h:11304
Definition: fci.c:126

Definition at line 27 of file rsym.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 11 of file rsym.c.

Typedef Documentation

◆ test_context

Function Documentation

◆ cleanup_gcc_dll()

void cleanup_gcc_dll ( )

Definition at line 120 of file data.c.

121 {
122  char szFile[MAX_PATH];
123  BOOL ret;
124  const char* dir = tmpdir();
125 
126  sprintf(szFile, "%s\\uffs.dll", dir);
127  ret = DeleteFileA(szFile);
128  ok(ret, "DeleteFileA failed(%d)\n", GetLastError());
130  ok(ret, "RemoveDirectoryA failed(%d)\n", GetLastError());
131 }
static const char * tmpdir()
Definition: data.c:18
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define sprintf(buf, format,...)
Definition: sprintf.c:55
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
unsigned int dir
Definition: maze.c:112
#define MAX_PATH
Definition: compat.h:34
int ret
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714

Referenced by START_TEST().

◆ deinit_sym()

static void deinit_sym ( )
static

Definition at line 57 of file rsym.c.

58 {
59  SymCleanup(proc());
60 }
BOOL WINAPI SymCleanup(HANDLE hProcess)
Definition: dbghelp.c:531
static HANDLE proc()
Definition: rsym.c:41

Referenced by START_TEST().

◆ dump_rsym()

void dump_rsym ( const char filename)

◆ EnumSymProc()

static BOOL CALLBACK EnumSymProc ( PSYMBOL_INFO  pSymInfo,
ULONG  SymbolSize,
PVOID  UserContext 
)
static

Definition at line 252 of file rsym.c.

253 {
254  test_context* ctx = UserContext;
255 
256  if (ctx->Index < ARRAYSIZE(test_data))
257  {
258  ok_ulonglong_(__FILE__, test_data[ctx->Index].Line, pSymInfo->ModBase, ctx->BaseAddress);
259  if (test_data[ctx->Index].AddressOffset > 0x100000)
260  ok_ulonglong_(__FILE__, test_data[ctx->Index].Line, pSymInfo->Address, test_data[ctx->Index].AddressOffset);
261  else
262  ok_ulonglong_(__FILE__, test_data[ctx->Index].Line, pSymInfo->Address, ctx->BaseAddress + test_data[ctx->Index].AddressOffset);
263  ok_hex_(__FILE__, test_data[ctx->Index].Line, pSymInfo->Tag, test_data[ctx->Index].Tag);
264  ok_str_(__FILE__, test_data[ctx->Index].Line, pSymInfo->Name, test_data[ctx->Index].Name);
265 
266  ctx->Index++;
267  }
268  else
269  {
270  ok(0, "Out of bounds (%lu), max is: %i!\n", ctx->Index, ARRAYSIZE(test_data));
271  }
272 
273  return TRUE;
274 }
ULONG Tag
Definition: compat.h:797
CHAR Name[1]
Definition: compat.h:800
#define TRUE
Definition: types.h:120
#define ok_hex_(expression, result)
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
ULONG64 Address
Definition: compat.h:794
#define ok_ulonglong_(file, line, expression, result)
Definition: rsym.c:27
ULONG64 ModBase
Definition: compat.h:791
#define ok_str_(file, line, x, y)
Definition: test.h:866
#define ok(value,...)
Definition: atltest.h:57

Referenced by test_SymEnumSymbols().

◆ extract_gcc_dll()

int extract_gcc_dll ( char  szFile[MAX_PATH])

Definition at line 107 of file data.c.

108 {
109  const char* dir = tmpdir();
111  ok(ret, "CreateDirectoryA failed(%d)\n", GetLastError());
112 
113  sprintf(szFile, "%s\\uffs.dll", dir);
114  if (!extract_one(szFile, "gcc_uffs.dll"))
115  return 0;
116 
117  return 1;
118 }
static int extract_one(const char *filename, const char *resid)
Definition: data.c:28
static const char * tmpdir()
Definition: data.c:18
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define sprintf(buf, format,...)
Definition: sprintf.c:55
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
smooth NULL
Definition: ftsmooth.c:416
unsigned int dir
Definition: maze.c:112
int ret
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().

◆ init_sym_imp()

static BOOL init_sym_imp ( BOOL  fInvadeProcess,
const char file,
int  line 
)
static

Definition at line 46 of file rsym.c.

47 {
48  if (!SymInitialize(proc(), NULL, fInvadeProcess))
49  {
51  ok_(file, line)(0, "Failed to init: 0x%x\n", err);
52  return FALSE;
53  }
54  return TRUE;
55 }
#define TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI SymInitialize(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess)
Definition: dbghelp.c:508
Definition: parser.c:48
unsigned long DWORD
Definition: ntddk_ex.h:95
#define err(...)
static HANDLE proc()
Definition: rsym.c:41
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: fci.c:126

◆ proc()

static HANDLE proc ( )
static

Definition at line 41 of file rsym.c.

42 {
43  return GetCurrentProcess();
44 }
#define GetCurrentProcess()
Definition: compat.h:507

Referenced by deinit_sym(), init_sym_imp(), and START_TEST().

◆ START_TEST()

START_TEST ( rsym  )

Definition at line 297 of file rsym.c.

298 {
299  char szDllName[MAX_PATH];
300 #ifdef _M_IX86
301  HMODULE hMod;
302 #endif
305 
307  Options &= ~(SYMOPT_UNDNAME);
308  //Options |= SYMOPT_DEBUG;
310 
312  {
313  ok(0, "Failed extracting files\n");
314  return;
315  }
316 
317  if (init_sym(FALSE))
318  {
320  BaseAddress = SymLoadModule64(proc(), NULL, szDllName, NULL, 0x600000, 0);
321  dwErr = GetLastError();
322 
323  ok_ulonglong(BaseAddress, 0x600000);
325 
326  if (BaseAddress == 0x600000)
327  {
328  trace("Module loaded by SymLoadModule64\n");
332  }
333 
334  deinit_sym();
335  }
336 
337 #ifdef _M_IX86
338  hMod = LoadLibraryA(szDllName);
339  if (hMod)
340  {
341  BaseAddress = (DWORD64)(DWORD_PTR)hMod;
342  /* Invade process */
343  if (init_sym(TRUE))
344  {
345  trace("Module loaded by LoadLibraryA\n");
349 
350  deinit_sym();
351  }
352 
353  FreeLibrary(hMod);
354  }
355 #endif
356  cleanup_gcc_dll();
357 }
#define ok_ulonglong(expression, result)
Definition: rsym.c:19
#define ERROR_SUCCESS
Definition: deptool.c:10
static const WCHAR szDllName[]
Definition: sip.c:61
DWORD WINAPI SymSetOptions(DWORD opts)
Definition: dbghelp.c:559
#define TRUE
Definition: types.h:120
static void test_SymFromAddr(HANDLE hProc, DWORD64 BaseAddress)
Definition: rsym.c:126
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
enum OPTION_FLAGS Options
Definition: stats.c:44
#define ok_hex(expression, result)
Definition: atltest.h:94
static void deinit_sym()
Definition: rsym.c:57
#define FALSE
Definition: types.h:117
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
smooth NULL
Definition: ftsmooth.c:416
void cleanup_gcc_dll()
Definition: data.c:120
DWORD dwErr
Definition: service.c:36
DWORD64 WINAPI SymLoadModule64(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, DWORD64 BaseOfDll, DWORD SizeOfDll)
Definition: module.c:874
int extract_gcc_dll(char szFile[MAX_PATH])
Definition: data.c:107
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define FreeLibrary(x)
Definition: compat.h:496
#define trace
Definition: atltest.h:70
#define init_sym(fInvadeProcess)
Definition: rsym.c:62
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:500
#define SYMOPT_UNDNAME
Definition: compat.h:736
#define MAX_PATH
Definition: rsym.c:33
uint32_t DWORD_PTR
Definition: typedefs.h:65
uint64_t DWORD64
Definition: typedefs.h:67
DWORD WINAPI SymGetOptions(void)
Definition: dbghelp.c:574
#define ok(value,...)
Definition: atltest.h:57
static void test_SymFromName(HANDLE hProc, DWORD64 BaseAddress)
Definition: rsym.c:85
static HANDLE proc()
Definition: rsym.c:41
static void test_SymEnumSymbols(HANDLE hProc, DWORD64 BaseAddress)
Definition: rsym.c:276

◆ supports_rsym()

static BOOL supports_rsym ( HANDLE  hProc,
DWORD64  BaseAddress 
)
static

Definition at line 70 of file rsym.c.

71 {
72  IMAGEHLP_MODULE64 ModuleInfo;
73  BOOL Ret;
74 
75  memset(&ModuleInfo, 0, sizeof(ModuleInfo));
76  ModuleInfo.SizeOfStruct = sizeof(ModuleInfo);
77  Ret = SymGetModuleInfo64(hProc, BaseAddress, &ModuleInfo);
78 
79  return Ret &&
80  ModuleInfo.SymType == SymDia &&
81  ModuleInfo.CVSig == ('R' | ('S' << 8) | ('Y' << 16) | ('M' << 24));
82 }
SYM_TYPE SymType
Definition: compat.h:992
Definition: compat.h:811
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD SizeOfStruct
Definition: compat.h:986
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define memset(x, y, z)
Definition: compat.h:39
BOOL WINAPI SymGetModuleInfo64(HANDLE hProcess, DWORD64 dwAddr, PIMAGEHLP_MODULE64 ModuleInfo)
Definition: module.c:1215

Referenced by test_SymEnumSymbols(), test_SymFromAddr(), and test_SymFromName().

◆ test_SymEnumSymbols()

static void test_SymEnumSymbols ( HANDLE  hProc,
DWORD64  BaseAddress 
)
static

Definition at line 276 of file rsym.c.

277 {
278  BOOL Ret;
280 
281  ctx.Index = 0;
282  ctx.BaseAddress = BaseAddress;
283 
284  if (!supports_rsym(hProc, ctx.BaseAddress))
285  {
286  skip("dbghelp.dll cannot parse rsym\n");
287  }
288  else
289  {
290  Ret = SymEnumSymbols(hProc, ctx.BaseAddress, NULL, EnumSymProc, &ctx);
291  ok_int(Ret, TRUE);
292  ok_int(ctx.Index, ARRAYSIZE(test_data));
293  }
294 }
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL supports_rsym(HANDLE hProc, DWORD64 BaseAddress)
Definition: rsym.c:70
smooth NULL
Definition: ftsmooth.c:416
#define ok_int(expression, result)
Definition: atltest.h:134
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
static BOOL CALLBACK EnumSymProc(PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext)
Definition: rsym.c:252
BOOL WINAPI SymEnumSymbols(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR Mask, PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, PVOID UserContext)
Definition: symbol.c:1147
#define skip(...)
Definition: atltest.h:64

Referenced by START_TEST().

◆ test_SymFromAddr()

static void test_SymFromAddr ( HANDLE  hProc,
DWORD64  BaseAddress 
)
static

Definition at line 126 of file rsym.c.

127 {
128  BOOL Ret;
129  char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)];
130  PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer;
131 
132  DWORD64 Displacement;
133  DWORD dwErr;
134 
135  if (!supports_rsym(hProc, BaseAddress))
136  {
137  skip("dbghelp.dll cannot parse rsym\n");
138  }
139  else
140  {
141  /* No address found before load address of module */
142  Displacement = 0;
143  INIT_PSYM(buffer);
144  Ret = SymFromAddr(hProc, BaseAddress -1, &Displacement, pSymbol);
145  dwErr = GetLastError();
146  ok_int(Ret, FALSE);
148 
149  /* Right at the start of the module is recognized as the first symbol found */
150  Displacement = 0;
151  INIT_PSYM(buffer);
152  Ret = SymFromAddr(hProc, BaseAddress, &Displacement, pSymbol);
153  /* Our dbghelp.dll does not recognize this yet */
154  todo_if(!Ret)
155  {
156  ok_int(Ret, TRUE);
157  ok_ulonglong(Displacement, 0xffffffffffffffff);
158  ok_ulonglong(pSymbol->ModBase, BaseAddress);
159  ok_hex(pSymbol->Flags, SYMFLAG_FUNCTION);
160  ok_ulonglong(pSymbol->Address, BaseAddress + 0x1000);
161  ok_hex(pSymbol->Tag, SymTagFunction);
162  ok_str(pSymbol->Name, "DllMain");
163  }
164 
165  /* The actual first instruction of the function */
166  Displacement = 0;
167  INIT_PSYM(buffer);
168  Ret = SymFromAddr(hProc, BaseAddress + 0x1000, &Displacement, pSymbol);
169  ok_int(Ret, TRUE);
170  ok_ulonglong(Displacement, 0);
171  ok_ulonglong(pSymbol->ModBase, BaseAddress);
172  ok_hex(pSymbol->Flags, SYMFLAG_FUNCTION);
173  ok_ulonglong(pSymbol->Address, BaseAddress + 0x1000);
174  ok_hex(pSymbol->Tag, SymTagFunction);
175  ok_str(pSymbol->Name, "DllMain");
176 
177  /* The last instruction in the function */
178  Displacement = 0;
179  INIT_PSYM(buffer);
180  Ret = SymFromAddr(hProc, BaseAddress + 0x1009, &Displacement, pSymbol);
181  ok_int(Ret, TRUE);
182  ok_ulonglong(Displacement, 0x9);
183  ok_ulonglong(pSymbol->ModBase, BaseAddress);
184  ok_hex(pSymbol->Flags, SYMFLAG_FUNCTION);
185  ok_ulonglong(pSymbol->Address, BaseAddress + 0x1000);
186  ok_hex(pSymbol->Tag, SymTagFunction);
187  ok_str(pSymbol->Name, "DllMain");
188 
189  /* First byte of the next function */
190  Displacement = 0;
191  INIT_PSYM(buffer);
192  Ret = SymFromAddr(hProc, BaseAddress + 0x103F, &Displacement, pSymbol);
193  ok_int(Ret, TRUE);
194  ok_ulonglong(Displacement, 0);
195  ok_ulonglong(pSymbol->ModBase, BaseAddress);
196  ok_hex(pSymbol->Flags, SYMFLAG_FUNCTION);
197  ok_ulonglong(pSymbol->Address, BaseAddress + 0x103F);
198  ok_hex(pSymbol->Tag, SymTagFunction);
199  ok_str(pSymbol->Name, "FfsChkdsk");
200 
201  /* .idata */
202  Displacement = 0;
203  INIT_PSYM(buffer);
204  Ret = SymFromAddr(hProc, BaseAddress + 0x4000, &Displacement, pSymbol);
205  ok_int(Ret, TRUE);
206  ok_ulonglong(Displacement, 0);
207  ok_ulonglong(pSymbol->ModBase, BaseAddress);
208  ok_hex(pSymbol->Flags, SYMFLAG_EXPORT);
209  ok_ulonglong(pSymbol->Address, BaseAddress + 0x4000);
210  ok_hex(pSymbol->Tag, SymTagPublicSymbol);
211  ok_str(pSymbol->Name, "_head_dll_ntdll_libntdll_a");
212  }
213 }
ULONG Tag
Definition: compat.h:797
CHAR Name[1]
Definition: compat.h:800
#define ok_ulonglong(expression, result)
Definition: rsym.c:19
#define ok_str(x, y)
Definition: atltest.h:127
#define TRUE
Definition: types.h:120
#define MAX_SYM_NAME
Definition: rsym.c:34
ULONG Flags
Definition: compat.h:792
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
GLuint buffer
Definition: glext.h:5915
ULONG64 Address
Definition: compat.h:794
#define INIT_PSYM(buff)
Definition: rsym.c:64
#define ok_hex(expression, result)
Definition: atltest.h:94
struct _SYMBOL_INFO * PSYMBOL_INFO
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL supports_rsym(HANDLE hProc, DWORD64 BaseAddress)
Definition: rsym.c:70
ULONG64 ModBase
Definition: compat.h:791
#define ok_int(expression, result)
Definition: atltest.h:134
DWORD dwErr
Definition: service.c:36
char TCHAR
Definition: xmlstorage.h:189
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define todo_if(is_todo)
Definition: test.h:152
struct _SYMBOL_INFO SYMBOL_INFO
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 Address, DWORD64 *Displacement, PSYMBOL_INFO Symbol)
Definition: symbol.c:1263
#define SYMFLAG_FUNCTION
Definition: compat.h:752
uint64_t DWORD64
Definition: typedefs.h:67
#define SYMFLAG_EXPORT
Definition: compat.h:750
#define skip(...)
Definition: atltest.h:64
#define ERROR_MOD_NOT_FOUND
Definition: compat.h:104

Referenced by START_TEST().

◆ test_SymFromName()

static void test_SymFromName ( HANDLE  hProc,
DWORD64  BaseAddress 
)
static

Definition at line 85 of file rsym.c.

86 {
87  BOOL Ret;
88  char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)];
89  PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer;
90 
91  if (!supports_rsym(hProc, BaseAddress))
92  {
93  skip("dbghelp.dll cannot parse rsym\n");
94  }
95  else
96  {
98  Ret = SymFromName(hProc, "DllMain", pSymbol);
99  ok_int(Ret, TRUE);
100  ok_ulonglong(pSymbol->ModBase, BaseAddress);
101  ok_hex(pSymbol->Flags, SYMFLAG_FUNCTION);
102  ok_ulonglong(pSymbol->Address, BaseAddress + 0x1000);
103  ok_hex(pSymbol->Tag, SymTagFunction);
104  ok_str(pSymbol->Name, "DllMain");
105 
106  INIT_PSYM(buffer);
107  Ret = SymFromName(hProc, "FfsChkdsk", pSymbol);
108  ok_int(Ret, TRUE);
109  ok_ulonglong(pSymbol->ModBase, BaseAddress);
110  ok_hex(pSymbol->Flags, SYMFLAG_FUNCTION);
111  ok_ulonglong(pSymbol->Address, BaseAddress + 0x103F);
112  ok_hex(pSymbol->Tag, SymTagFunction);
113  ok_str(pSymbol->Name, "FfsChkdsk");
114 
115  INIT_PSYM(buffer);
116  Ret = SymFromName(hProc, "FfsFormat", pSymbol);
117  ok_int(Ret, TRUE);
118  ok_ulonglong(pSymbol->ModBase, BaseAddress);
119  ok_hex(pSymbol->Flags, SYMFLAG_FUNCTION);
120  ok_ulonglong(pSymbol->Address, BaseAddress + 0x100C);
121  ok_hex(pSymbol->Tag, SymTagFunction);
122  ok_str(pSymbol->Name, "FfsFormat");
123  }
124 }
ULONG Tag
Definition: compat.h:797
CHAR Name[1]
Definition: compat.h:800
#define ok_ulonglong(expression, result)
Definition: rsym.c:19
#define ok_str(x, y)
Definition: atltest.h:127
#define TRUE
Definition: types.h:120
#define MAX_SYM_NAME
Definition: rsym.c:34
ULONG Flags
Definition: compat.h:792
GLuint buffer
Definition: glext.h:5915
ULONG64 Address
Definition: compat.h:794
#define INIT_PSYM(buff)
Definition: rsym.c:64
#define ok_hex(expression, result)
Definition: atltest.h:94
struct _SYMBOL_INFO * PSYMBOL_INFO
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL supports_rsym(HANDLE hProc, DWORD64 BaseAddress)
Definition: rsym.c:70
ULONG64 ModBase
Definition: compat.h:791
#define ok_int(expression, result)
Definition: atltest.h:134
char TCHAR
Definition: xmlstorage.h:189
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
struct _SYMBOL_INFO SYMBOL_INFO
#define SYMFLAG_FUNCTION
Definition: compat.h:752
#define skip(...)
Definition: atltest.h:64
BOOL WINAPI SymFromName(HANDLE hProcess, PCSTR Name, PSYMBOL_INFO Symbol)
Definition: symbol.c:1392

Referenced by START_TEST().

Variable Documentation

◆ test_data

Initial value:
= {
{ 0x107c, 0, SymTagPublicSymbol, "__CTOR_LIST__", __LINE__ },
{ 0x2074, 0, SymTagPublicSymbol, "__RUNTIME_PSEUDO_RELOC_LIST_END__", __LINE__ },
{ 0x1000, 12, SymTagPublicSymbol, "EntryPoint", __LINE__ },
{ 0x100c, 51, SymTagFunction, "FfsFormat", __LINE__ },
{ 0x4030, 0, SymTagPublicSymbol, "_imp__DbgPrint", __LINE__ },
{ 0x1084, 0, SymTagPublicSymbol, "__DTOR_LIST__", __LINE__ },
{ 0x103f, 53, SymTagFunction, "FfsChkdsk", __LINE__ },
{ 0x2074, 0, SymTagPublicSymbol, "_rt_psrelocs_end", __LINE__ },
{ 0x103f, 53, SymTagPublicSymbol, "ChkdskEx", __LINE__ },
{ 0x4048, 0, SymTagPublicSymbol, "_dll_ntdll_libntdll_a_iname", __LINE__ },
{ 0x2074, 0, SymTagPublicSymbol, "_rt_psrelocs_start", __LINE__ },
{ 0x1000, 12, SymTagFunction, "DllMain", __LINE__ },
{ 0x100c, 0, SymTagPublicSymbol, "FormatEx", __LINE__ },
{ 0x1074, 0, SymTagPublicSymbol, "DbgPrint", __LINE__ },
{ 0x68900000, 0, SymTagPublicSymbol, "__ImageBase", __LINE__ },
{ 0x68902074, 0, SymTagPublicSymbol, "__RUNTIME_PSEUDO_RELOC_LIST__", __LINE__ },
{ 0x4000, 0, SymTagPublicSymbol, "_head_dll_ntdll_libntdll_a", __LINE__ },
}