dbghelp: Improve collision handling in SymLoadModuleEx().
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1465c7de2a
commit
b65ef71fc0
|
@ -969,6 +969,14 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
|
|||
/* we have a conflict as the new module cannot be found by its base address
|
||||
* we need to get rid of one on the two modules
|
||||
*/
|
||||
if (lstrcmpW(module->modulename, altmodule->modulename) != 0)
|
||||
{
|
||||
/* module overlaps an existing but different module... unload new module and return error */
|
||||
WARN("%ls overlaps %ls\n", module->modulename, altmodule->modulename);
|
||||
module_remove(pcs, module);
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
/* loading same module at same address... don't change anything */
|
||||
if (module->module.BaseOfImage == altmodule->module.BaseOfImage)
|
||||
{
|
||||
|
@ -976,9 +984,10 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
|
|||
SetLastError(ERROR_SUCCESS);
|
||||
return 0;
|
||||
}
|
||||
module_remove(pcs, module);
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
/* replace old module with new one, which will look like a shift of base address */
|
||||
WARN("Shift module %ls from %I64x to %I64x\n",
|
||||
module->modulename, altmodule->module.BaseOfImage, module->module.BaseOfImage);
|
||||
module_remove(pcs, altmodule);
|
||||
}
|
||||
|
||||
if ((dbghelp_options & SYMOPT_DEFERRED_LOADS) == 0)
|
||||
|
|
Loading…
Reference in New Issue