DbgHelpSymLoadModuleEx Method

Loads the symbol table for the specified module.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("DbgHelp.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static ulong SymLoadModuleEx(
	IntPtr hProcess,
	IntPtr hFile,
	string imageName,
	string moduleName,
	ulong baseOfDll,
	int dllSize,
	IntPtr data,
	SymLoadModuleFlags flags
)

Parameters

hProcess  IntPtr
A handle to the process that was originally passed to the SymInitialize(IntPtr, String, Boolean) function.
hFile  IntPtr
The h fileA 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 debugging event.

A value of Zero indicates that hFile is not used.

imageName  String
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  String
A shortcut name for the module.

If the pointer value is , the library creates a name using the base name of the symbol file.

baseOfDll  UInt64
The load address of the module.

If the value is zero, the library 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.

If the image is a .pdb file, this parameter cannot be zero.

dllSize  Int32
The size of the module, in bytes.

If the value is zero, the library 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.

If the image is a .pdb file, this parameter cannot be zero.

data  IntPtr
A pointer to a MODLOAD_DATA structure that represents headers other than the standard PE header.

This parameter is optional and can be Zero.

flags  SymLoadModuleFlags
This parameter can be one or more of the SymLoadModuleFlags Enum values.

Return Value

UInt64
If the function succeeds, the return value is the base address of the loaded module.

If the function fails, the return value is zero.

To retrieve extended error information, call GetLastWin32Error.

If the module is already loaded, the return value is zero and GetLastWin32Error returns ERROR_SUCCESS.

Remarks

See Also