2
0
mirror of https://github.com/rehlds/reapi.git synced 2025-01-01 01:25:47 +03:00
This commit is contained in:
asmodai 2017-03-11 12:36:13 +03:00
parent 532f8291b8
commit d38ded61bc

View File

@ -237,7 +237,17 @@ NOINLINE R DLLEXPORT _callForward(const hook_t* hook, original_t original, volat
g_hookCtx = hookCtx; g_hookCtx = hookCtx;
if (unlikely(!hookCtx->retVal.set)) { if (unlikely(!hookCtx->retVal.set)) {
hookCtx->retVal._integer = *(int *)&retVal; switch (sizeof retVal) {
case sizeof(int8):
hookCtx->retVal._integer = *(int8 *)&retVal;
break;
case sizeof(int16):
hookCtx->retVal._integer = *(int16 *)&retVal;
break;
case sizeof(int32):
hookCtx->retVal._integer = *(int32 *)&retVal;
break;
}
hookCtx->retVal.set = true; hookCtx->retVal.set = true;
} }
} }