Add support for custom calling convention passing arguments in registers
If the compiler decided to pass an argument in a register on an internal function instead of pushing it on the stack to save time, allow us to specify the register the parameter is going to be in. DHookAddParam received another parameter to set the register.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <sourcehook.h>
|
||||
#include <sh_vector.h>
|
||||
#include <sourcehook_pibuilder.h>
|
||||
#include <registers.h>
|
||||
|
||||
enum CallingConvention
|
||||
{
|
||||
@@ -92,6 +93,7 @@ struct ParamInfo
|
||||
size_t size;
|
||||
unsigned int flags;
|
||||
SourceHook::PassInfo::PassType pass_type;
|
||||
Register_t custom_register;
|
||||
};
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -216,6 +218,11 @@ public:
|
||||
this->callback = nullptr;
|
||||
};
|
||||
~HookSetup(){};
|
||||
|
||||
bool IsVirtual()
|
||||
{
|
||||
return this->offset != -1;
|
||||
}
|
||||
public:
|
||||
unsigned int returnFlag;
|
||||
ReturnType returnType;
|
||||
|
||||
Reference in New Issue
Block a user