Microsoft KB Archive/220913

{|
 * width="100%"|

PRB: SymGetLineFromAddr May Fail With Error 487

 * }

Q220913

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), included with:
 * the operating system: Microsoft Windows 2000
 * Microsoft Windows 98
 * Microsoft Windows 95

-

SYMPTOMS
The SymGetLineFromAddr ImageHlp API sometimes fails with error 487 when it cannot find the source line information corresponding to the specific virtual address.

CAUSE
By default the symbol handler does not load the line number information. Moreover, the symbol information for a module is positioned based on the symbol search path associated with the process.

MORE INFORMATION
An application specifies the SYMOPT_LOAD_LINES mask in the SymSetOptions API to indicate that the symbol handler loads the line number information when the symbols are located for a module. The symbol information for a module is loaded when the bInvade parameter is passed as TRUE and SymInitialize is called. Alternatively, an application can also use SymLoadModule to load the symbol information of a specified module or the symbol handler loads it as deferred until a reference is made requiring the symbols be loaded. If the SYMOPT_LOAD_LINES option is not set before the symbol information is loaded, the SymGetLineFromAddr API fails and GetLastError returns the 487 error (ERROR_INVALID_ADDRESS).

Finally, the symbol handler uses the symbol search path to locate the symbol file. If the symbol file cannot be located by the symbol handler, SymGetLineFromAddr API fails with the same error.