I manual map dll and i can't get MODULEINFO for it's working region with GetModuleInformation (it's always answer for me with "Unable to obtain module")?. That happens because that function tries to get data from the module list in the process environment block. But a manually mapped dll is usually not linked in that list unless of course you manually add a new list entry. It doesn't use the info from the header (or at least not directly). So i already has dllBase that is hModule. So now i only need to get it's size. Is any way to get it without GetModuleInformation?
static void someFunc(HINSTANCE hModule)
{
// all the vars we need for the GetModuleInformation call
MODULEINFO modInfo;
HANDLE hProcess = GetCurrentProcess();
if (GetModuleInformation(hProcess, hModule, &modInfo, sizeof(MODULEINFO)))
{
// some work
}
else {
std::cout << "Unable to obtain module" << std::endl;
}
}