hybridclr_unity/Data~/Templates/ReversePInvokeMethodStub.cp...

37 lines
821 B
Plaintext
Raw Normal View History

2022-09-22 08:56:07 +08:00
#include "ReversePInvokeMethodStub.h"
#include "MetadataModule.h"
namespace hybridclr
{
namespace metadata
{
void CallLuaFunction(void* xState, int32_t wrapperIndex)
{
const MethodInfo* method = MetadataModule::GetMethodInfoByReversePInvokeWrapperIndex(wrapperIndex);
typedef void (*Callback)(void* xState, const MethodInfo* method);
((Callback)(method->methodPointerCallByInterp))(xState, method);
2022-09-22 08:56:07 +08:00
}
//!!!{{REVERSE_PINVOKE_METHOD_STUB
2022-09-22 08:56:07 +08:00
void __ReversePInvokeMethod_0(void* xState)
{
CallLuaFunction(xState, 0);
}
void __ReversePInvokeMethod_1(void* xState)
{
CallLuaFunction(xState, 1);
}
Il2CppMethodPointer s_ReversePInvokeMethodStub[]
{
(Il2CppMethodPointer)__ReversePInvokeMethod_0,
(Il2CppMethodPointer)__ReversePInvokeMethod_1,
nullptr,
};
//!!!}}REVERSE_PINVOKE_METHOD_STUB
}
}