SymLoadModule
The SymLoadModule function loads the symbol table.
BOOL SymLoadModule(
IN HANDLE hProcess,
IN HANDLE hFile,
IN LPSTR ImageName,
IN LPSTR ModuleName,
IN DWORD BaseOfDll,
IN DWORD SizeOfDll
);
Parameters
-
hProcess
-
Handle to the process that was originally passed to the SymInitialize function.
-
hFile
-
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 debug event. A value of NULL indicates that hFile is not used.
-
ImageName
-
Pointer to a null-terminated string that specifies 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
-
Pointer to a null-terminated string that specifies a shortcut name for the module. If the pointer value is NULL, ImageHlp creates a name using the base name of the symbol file.
-
BaseOfDll
-
Specifies the load address of the module. If the value is zero, ImageHlp 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.
-
SizeOfDll
-
Specifies the size of the module. If the value is zero, ImageHlp 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.
Return Values
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To retrieve extended error information, call GetLastError.
Remarks
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 SymUnloadModule function.
QuickInfo
Windows NT: Requires version 4.0 or later.
Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in imagehlp.h.
Import Library: Use imagehlp.lib.
See Also
PE Image Helper (ImageHlp) Overview, Symbol Handler, SymInitialize, SymUnloadModule