After a symbol file has been loaded into the symbol handler, an application can use the symbol locator functions to return symbol information for a specified address. These functions can also find a source code file name and line number location for an address.
To retrieve a list of all symbol files loaded by module name, call the SymEnumerateModules64 function. For an example, see Enumerating Symbol Modules. To retrieve a list of symbols for a given module, call the SymEnumSymbols function. For an example, see Enumerating Symbols.
To retrieve symbolic information for a specific address, use the SymFromAddr function. This function retrieves information and stores it in a SYMBOL_INFO structure. Because symbol names are variable in length, you must provide additional buffer space following the SYMBOL_INFO structure declaration. For an example, see Retrieving Symbol Information by Address.
Note that the address does not need to be on a symbol boundary. If the address comes after the beginning of a symbol but before the end of the symbol (the beginning of the symbol plus the symbol size), the function will locate the symbol.
To retrieve symbolic information in a SYMBOL_INFO structure for a specific module and symbol name, use the SymFromName function. If deferred symbol loading is set, SymFromName will attempt to load the symbol file for a module if it has not already been loaded. To specify a module name along with a symbol name, use the syntax Module!SymName. The "!" character delimits the module name from the symbol name. For an example, see Retrieving Symbol Information by Name.
To retrieve the source code location for a specific address, use the SymGetLineFromAddr64 function. This function fills an IMAGEHLP_LINE64 structure that includes the source file name and line number location referred to by the specified address. For an example, see Retrieving Symbol Information by Address.
To retrieve source code location for a specific symbol name, use the SymGetLineFromName64 function. This function is similar to SymGetSymFromName64, but retrieves an IMAGEHLP_LINE64 structure. To use SymGetLineFromAddr64 or SymGetLineFromName64, you must set the load lines option (SYMOPT_LOAD_LINES) using the SymSetOptions function. For an example, see Retrieving Symbol Information by Name.