dbghelp: Implement SymGetSymFromAddr64.

This commit is contained in:
Robert Shearman 2006-07-25 10:35:49 +01:00 committed by Alexandre Julliard
parent 68249c10df
commit 5c8b22f385
2 changed files with 29 additions and 1 deletions

View File

@ -99,7 +99,7 @@
@ stub SymGetSourceVarFromToken @ stub SymGetSourceVarFromToken
@ stub SymGetSourceVarFromTokenW @ stub SymGetSourceVarFromTokenW
@ stdcall SymGetSymFromAddr(long long ptr ptr) @ stdcall SymGetSymFromAddr(long long ptr ptr)
@ stub SymGetSymFromAddr64 @ stdcall SymGetSymFromAddr64(long long long ptr ptr)
@ stdcall SymGetSymFromName(long str ptr) @ stdcall SymGetSymFromName(long str ptr)
@ stub SymGetSymFromName64 @ stub SymGetSymFromName64
@ stdcall SymGetSymNext(long ptr) @ stdcall SymGetSymNext(long ptr)

View File

@ -1046,6 +1046,34 @@ BOOL WINAPI SymGetSymFromAddr(HANDLE hProcess, DWORD Address,
return TRUE; return TRUE;
} }
/******************************************************************
* SymGetSymFromAddr64 (DBGHELP.@)
*
*/
BOOL WINAPI SymGetSymFromAddr64(HANDLE hProcess, DWORD64 Address,
PDWORD64 Displacement, PIMAGEHLP_SYMBOL64 Symbol)
{
char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME];
SYMBOL_INFO*si = (SYMBOL_INFO*)buffer;
size_t len;
DWORD64 Displacement64;
if (Symbol->SizeOfStruct < sizeof(*Symbol)) return FALSE;
si->SizeOfStruct = sizeof(*si);
si->MaxNameLen = MAX_SYM_NAME;
if (!SymFromAddr(hProcess, Address, &Displacement64, si))
return FALSE;
if (Displacement)
*Displacement = Displacement64;
Symbol->Address = si->Address;
Symbol->Size = si->Size;
Symbol->Flags = si->Flags;
len = min(Symbol->MaxNameLength, si->MaxNameLen);
lstrcpynA(Symbol->Name, si->Name, len);
return TRUE;
}
static BOOL find_name(struct process* pcs, struct module* module, const char* name, static BOOL find_name(struct process* pcs, struct module* module, const char* name,
SYMBOL_INFO* symbol) SYMBOL_INFO* symbol)
{ {