I'm trying to load several symbol modules using the following code:
DWORD64 dwBaseDllSymLocal = 0;
SymInitializeW(GetCurrentProcess(), NULL, FALSE);
SymSetOptions(SYMOPT_DEBUG);
dwBaseDllSymLocal = SymLoadModuleExW(GetCurrentProcess(), NULL, L"C:\\module1.dll", NULL, 0, 0, NULL, 0);
if (0 == dwBaseDllSymLocal)
{
__debugbreak();
}
dwBaseDllSymLocal is 10000000 now.
dwBaseDllSymLocal = SymLoadModuleExW(GetCurrentProcess(), NULL, L"C:\\module2.dll", NULL, 0, 0, NULL, 0);
if (0 == dwBaseDllSymLocal)
{
__debugbreak();
}
Dbghelp gives the following message: module1 is already loaded at 10000000
.
Same behavior happens when I try to load the same module twice. (unlike what is written in the documentation of the function).
Last error is ERROR_INVALID_ADDRESS
though it doesn't seem relevant, because last error has this value following the first successful function call too.
Is it possible to load several modules with SymLoadModuleExW
? What is the right way to do so?