A function with this signature may be passed as the Callback parameter to GetSourceLineFromAddress. The callback will be called once for each address GetSourceLineFromAddress attempts to resolve.
BOOL GETSRCPATH_PROC(
LPVOID context,
ULONG_PTR address,
HRESULT result,
PCWSTR filepath,
ULONG linenumber
)
context
Type: LPVOID
[in] The user supplied context that was passed to the Context parameter to GetSourceLineFromAddress.
address
Type: ULONG_PTR
[in] The address of the function being resolved.
result
Type: HRESULT
[in] The result of symbol resolution. S_OK indicates the symbol resolved successfully.
filepath
Type: PCWSTR
[in] A pointer to the fully qualified file name for the function corresponding to the address parameter.
linenumber
Type: ULONG
[in] The line number within filepath for the function corresponding to the address parameter.
Type: BOOL
Indicates whether GetSourceLineFromAddress should continue to enumerate the addresses it was passed. Return true to continue the enumeration and false to stop it.
GETSRCPATH_PROC defines the signature required of functions that are passed as callbacks to the GetSourceLineFromAddress API. Note that the xbSymbolProxy.exe command line tool must be used to establish a connection between your console and a PC from which your title’s symbols can be accessed before calling GetSourceLineFromAddress.
BOOL SrcCallback
(
LPVOID context,
ULONG_PTR address,
HRESULT result,
PCWSTR filepath,
ULONG linenumber
)
{
// the filepath and line number parameters to this callback provide the source file information for a supplied function address.
return TRUE;
}
ULONG_PTR addresses[] =
{
(ULONG_PTR)myTitleFunction
};
HRESULT hr = GetSourceLineFromAddress(
ResolveDisposition::DefaultPriority,
_countof(addresses),
addresses,
SrcCallback,
this);
Header: Declared in SymbolResolve.h.
Library: Use toolhelpx.lib.