unbreak building with visual studio clang platform toolset

This commit is contained in:
Aliaksey Kandratsenka 2023-06-21 10:38:35 -04:00
parent 0451d21e83
commit 9bde8d837b
2 changed files with 3 additions and 2 deletions

View File

@ -121,7 +121,7 @@ enum AddressingMethod {
// The reason we use a full 4 bytes and a mask, is that we need
// to combine these flags with the enAddressingMethod to store the details
// on the operand in a single integer.
enum OperandType {
enum OperandType : unsigned {
OT_MASK = 0xFF000000,
OT_A = 0x01000000,
OT_B = 0x02000000,

View File

@ -328,10 +328,11 @@ struct ModuleEntryCopy {
FARPROC target = ::GetProcAddress(
reinterpret_cast<const HMODULE>(mi.lpBaseOfDll),
LibcInfo::function_name(i));
void* target_addr = reinterpret_cast<void*>(target);
// Sometimes a DLL forwards a function to a function in another
// DLL. We don't want to patch those forwarded functions --
// they'll get patched when the other DLL is processed.
if (target >= modBaseAddr && target < modEndAddr)
if (modBaseAddr <= target_addr && target_addr < modEndAddr)
rgProcAddresses[i] = (GenericFnPtr)target;
else
rgProcAddresses[i] = (GenericFnPtr)NULL;