Debugging Tools for Windows |
The GetOffsetByName and GetOffsetByNameWide methods return the location of a symbol identified by name.
HRESULT
IDebugSymbols::GetOffsetByName(
IN PCSTR Symbol,
OUT PULONG64 Offset
);
HRESULT
IDebugSymbols3::GetOffsetByNameWide(
IN PCWSTR Symbol,
OUT PULONG64 Offset
);
#ifdef UNICODE
#define GetOffsetByNameT GetOffsetByNameWide
#else
#define GetOffsetByNameT GetOffsetByName
#endif
This method may also return other error values. See Return Values for more details.
GetOffsetByName is available in all versions of IDebugSymbols. GetOffsetByNameWide is available in IDebugSymbols3 and later versions.
If the name Symbol is not unique and GetOffsetByName finds multiple symbols with that name, then the ambiguity will be resolved arbitrarily. In this case the value S_FALSE will be returned. StartSymbolMatch can be used to initiate a search to determine which is the desired result.
GetNameByOffset does not support pattern matching (e.g. wildcards). To find a symbol using pattern matching use StartSymbolMatch.
If the module name for the symbol is known, it is best to qualify the symbol name with the module name. Otherwise the engine will search the symbols for all modules until it finds a match; this can take a long time if it has to load the symbol files for a lot of modules. If the symbol name is qualified with a module name, the engine only searches the symbols for that module.
For more information about symbols and symbol names, see Symbols.
Headers: Defined in Dbgeng.h. Include Dbgeng.h.