https://bugs.winehq.org/show_bug.cgi?id=56968
--- Comment #8 from Fabian Maurer dark.shadow4@web.de ---
Why do we need it and where? If you mean the NtProtectVirtualMemory() call, it's already done by passing '&ptr'.
Because I modify the "VirtualAddress" value here:
sec[i].VirtualAddress = (UINT_PTR)get_rva( module, sec[i].VirtualAddress );
but that is readonly, so I need to make it read-write.
So we now have
void *ptr = &sec[i].VirtualAddress;
which is the pointer to the address I want to modify. And since NtProtectVirtualMemory needs a pointer to a pointer I pass "&ptr".
In the case without relocations sec.VirtualAddress already contains correct address.
Sure, there is no relocations, but that programs expect the sec.VirtualAddress to not be an offset but an absolute value.