我们为什么工作SymGetSymFromAddr64不工作

SymGetModuleInfo64 function
Retrieves the module information of the specified module.
BOOL WINAPI SymGetModuleInfo64(
_Out_ PIMAGEHLP_MODULE64 ModuleInfo
Parameters
hProcess [in]
A handle to the process that was originally passed to the
dwAddr [in]
The virtual address that is contained in one of the modules loaded by the
ModuleInfo [out]
A pointer to an
structure. The SizeOfStruct member must be set to the size of the
IMAGEHLP_MODULE64 structure. An invalid value will result in an error.
Return value
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To retrieve extended error information, call
The module table is searched for a module that contains the dwAddr. The module is located based on the load address and size of each module. If a valid module is found, the ModuleInfo parameter is filled with the information about the module.
The size of the
structure used by this function has changed over the years.
If a version of DbgHelp.dll is called that is older than the DbgHelp.h used to compile the calling code, then this function may fail with an error code of ERROR_INVALID_PARAMETER.
This most commonly occurs when the system version (%WinDir%\System32\DbgHelp.dll) is called.
Code that calls the system version of DbgHelp.dll must be compiled using the appropriate SDK for that Windows release or the SDK for a previous release.
The recommended model is to redistribute the required version of DbgHelp.dll along with the calling software.
This allows the caller to use the most robust versions of DbgHelp.dll as well as a simplifying upgrades.
The most recent version of DbgHelp.dll can always be found in the
As a general rule, code that is compiled to work with older versions will always work with newer versions.
All DbgHelp functions, such as this one, are single threaded. Therefore, calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize all concurrent calls from more than one thread to this function.
To call the Unicode version of this function, define DBGHELP_TRANSLATE_TCHAR. SymGetModuleInfoW64 is defined as follows in DbgHelp.h.
SymGetModuleInfoW64(
__in HANDLE hProcess,
__in DWORD64 qwAddr,
__out PIMAGEHLP_MODULEW64 ModuleInfo
#ifdef DBGHELP_TRANSLATE_TCHAR
#define SymGetModuleInfo64
SymGetModuleInfoW64
This function supersedes the SymGetModuleInfo function. For more information, see
. SymGetModuleInfo is defined as follows in DbgHelp.h.
#if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
#define SymGetModuleInfo
SymGetModuleInfo64
#define SymGetModuleInfoW
SymGetModuleInfoW64
SymGetModuleInfo(
__in HANDLE hProcess,
__in DWORD dwAddr,
__out PIMAGEHLP_MODULE ModuleInfo
SymGetModuleInfoW(
__in HANDLE hProcess,
__in DWORD dwAddr,
__out PIMAGEHLP_MODULEW ModuleInfo
Requirements
Redistributable
DbgHelp.dll 5.1 or later
Dbghelp.lib
Dbghelp.dll
Unicode and ANSI names
SymGetModuleInfoW64 (Unicode) and SymGetModuleInfo64 (ANSI)
IN THIS ARTICLE
Is this page helpful?
Additional feedback?
1500 characters remaining
Thank you!
We appreciate your feedback.
© Microsoft 2017SymFromAddr function
Retrieves symbol information for the specified address.
BOOL WINAPI SymFromAddr(
_Out_opt_ PDWORD64
Displacement,
PSYMBOL_INFO Symbol
Parameters
hProcess [in]
A handle to a process. This handle must have been previously passed to the
Address [in]
The address for which a symbol should be located. The address does not have to be on a symbol boundary. If the address comes after the beginning of a symbol and before the end of the symbol, the symbol is found.
Displacement [out, optional]
The displacement from the beginning of the symbol, or zero.
Symbol [in, out]
A pointer to a
structure that provides information about the symbol. The symbol name i therefore this buffer must be large enough to hold the name stored at the end of the
SYMBOL_INFO structure. Be sure to set the MaxNameLen member to the number of bytes reserved for the name.
Return value
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To retrieve extended error information, call
All DbgHelp functions, such as this one, are single threaded. Therefore, calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize all concurrent calls from more than one thread to this function.
To call the Unicode version of this function, define DBGHELP_TRANSLATE_TCHAR.
For an example, see
Requirements
Redistributable
DbgHelp.dll 5.1 or later
Dbghelp.lib
Dbghelp.dll
Unicode and ANSI names
SymFromAddrW (Unicode) and SymFromAddr (ANSI)
IN THIS ARTICLE
Is this page helpful?
Additional feedback?
1500 characters remaining
Thank you!
We appreciate your feedback.
© Microsoft 2017SymLoadModule64 function
Loads the symbol table.
This function has been superseded by the
DWORD64 WINAPI SymLoadModule64(
_In_opt_ HANDLE
_In_opt_ PCSTR
ImageName,
_In_opt_ PCSTR
ModuleName,
DWORD64 BaseOfDll,
Parameters
hProcess [in]
A handle to the process. This handle must have been previously passed to the
hFile [in, optional]
A handle to the file for the executable image. This argument is used mostly by debuggers, where the debugger passes the file handle obtained from a debugging event. A value of NULL indicates that hFile is not used.
ImageName [in, optional]
The name of the executable image. This name can contain a partial path, a full path, or no path at all. If the file cannot be located by the name provided, the symbol search path is used.
ModuleName [in, optional]
A shortcut name for the module. If the pointer value is NULL, the library creates a name using the base name of the symbol file.
BaseOfDll [in]
The load address of the module. If the value is zero, the library obtains the load address from the symbol file. The load address contained in the symbol file is not necessarily the actual load address. Debuggers and other applications having an actual load address should use the real load address when calling this function.
If the image is a .pdb file, this parameter cannot be zero.
SizeOfDll [in]
The size of the module, in bytes. If the value is zero, the library obtains the size from the symbol file. The size contained in the symbol file is not necessarily the actual size. Debuggers and other applications having an actual size should use the real size when calling this function.
If the image is a .pdb file, this parameter cannot be zero.
Return value
If the function succeeds, the return value is the base address of the loaded module.
If the function fails, the return value is zero. To retrieve extended error information, call
If the module is already loaded, the return value is zero and
returns ERROR_SUCCESS.
The symbol handler creates an entry for the module and if the deferred symbol loading option is turned off, an attempt is made to load the symbols. If deferred symbol loading is enabled, the module is marked as deferred and the symbols are not loaded until a reference is made to a symbol in the module.
To unload the symbol table, use the
All DbgHelp functions, such as this one, are single threaded. Therefore, calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize all concurrent calls from more than one thread to this function.
This function supersedes the SymLoadModule function. For more information, see
. SymLoadModule is defined as follows in DbgHelp.h.
#if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
#define SymLoadModule SymLoadModule64
SymLoadModule(
__in HANDLE hProcess,
__in_opt HANDLE hFile,
__in_opt PCSTR ImageName,
__in_opt PCSTR ModuleName,
__in DWORD BaseOfDll,
__in DWORD SizeOfDll
Requirements
Redistributable
DbgHelp.dll 5.1 or later
Dbghelp.lib
Dbghelp.dll
IN THIS ARTICLE
Is this page helpful?
Additional feedback?
1500 characters remaining
Thank you!
We appreciate your feedback.
© Microsoft 2017SymGetLineFromAddr64 function
Locates the source line for the specified address.
BOOL WINAPI SymGetLineFromAddr64(
_Out_ PDWORD
pdwDisplacement,
_Out_ PIMAGEHLP_LINE64 Line
Parameters
hProcess [in]
A handle to the process that was originally passed to the
dwAddr [in]
The address for which a line should be located. It is not necessary for the address to be on a line
boundary. If the address appears after the beginning of a line and before the end of the line, the line is
pdwDisplacement [out]
The displacement in bytes from the beginning of the line, or zero.
Line [out]
A pointer to an
structure.
Return value
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To retrieve extended error
information, call .
The caller must allocate the Line buffer properly and fill in the required members
structure before
calling SymGetLineFromAddr64.
This function returns a pointer to a buffer that may be reused by another function. Therefore, be sure to copy
the data returned to another buffer immediately.
All DbgHelp functions, such as this one, are single threaded. Therefore, calls from more than one thread to
this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize
all concurrent calls from more than one thread to this function.
To call the Unicode version of this function, define DBGHELP_TRANSLATE_TCHAR.
SymGetLineFromAddrW64 is defined as follows in
Dbghelp.h.
SymGetLineFromAddrW64(
_In_ HANDLE hProcess,
_In_ DWORD64 dwAddr,
_Out_ PDWORD pdwDisplacement,
_Out_ PIMAGEHLP_LINEW64 Line
#ifdef DBGHELP_TRANSLATE_TCHAR
#define SymGetLineFromAddr64
SymGetLineFromAddrW64
This function supersedes the SymGetLineFromAddr function. For more information, see
. SymGetLineFromAddr is defined as follows in Dbghelp.h.
#if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
#define SymGetLineFromAddr SymGetLineFromAddr64
#define SymGetLineFromAddrW SymGetLineFromAddrW64
SymGetLineFromAddr(
_In_ HANDLE hProcess,
_In_ DWORD dwAddr,
_Out_ PDWORD pdwDisplacement,
_Out_ PIMAGEHLP_LINE Line
SymGetLineFromAddrW(
_In_ HANDLE hProcess,
_In_ DWORD dwAddr,
_Out_ PDWORD pdwDisplacement,
_Out_ PIMAGEHLP_LINEW Line
For an example, see
Requirements
Redistributable
DbgHelp.dll 5.1 or later
Dbghelp.lib
Dbghelp.dll
Unicode and ANSI names
SymGetLineFromAddrW64 (Unicode) and SymGetLineFromAddr64 (ANSI)
IN THIS ARTICLE
Is this page helpful?
Additional feedback?
1500 characters remaining
Thank you!
We appreciate your feedback.
© Microsoft 2017}

我要回帖

更多关于 你为什么而工作 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信