2007-06-16 10:36:34 +02:00
|
|
|
#ifndef _INCLUDE_SOURCEMOD_VALVE_CALLER_H_
|
|
|
|
#define _INCLUDE_SOURCEMOD_VALVE_CALLER_H_
|
|
|
|
|
|
|
|
#include <sh_stack.h>
|
|
|
|
#include <extensions/IBinTools.h>
|
|
|
|
#include "vdecoder.h"
|
|
|
|
|
|
|
|
using namespace SourceMod;
|
|
|
|
using namespace SourceHook;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Info necessary to call a Valve function
|
|
|
|
*/
|
|
|
|
struct ValveCall
|
|
|
|
{
|
|
|
|
ICallWrapper *call; /**< From IBinTools */
|
|
|
|
ValvePassInfo *vparams; /**< Valve parameter info */
|
|
|
|
ValvePassInfo *retinfo; /**< Return buffer info */
|
|
|
|
ValvePassInfo *thisinfo; /**< Thiscall info */
|
|
|
|
size_t stackSize; /**< Stack size */
|
2007-06-20 10:03:43 +02:00
|
|
|
size_t stackEnd; /**< End of the bintools stack */
|
2007-06-16 10:36:34 +02:00
|
|
|
unsigned char *retbuf; /**< Return buffer */
|
|
|
|
CStack<unsigned char *> stk; /**< Parameter stack */
|
|
|
|
|
|
|
|
unsigned char *stk_get();
|
|
|
|
void stk_put(unsigned char *ptr);
|
2007-06-17 21:39:11 +02:00
|
|
|
ValveCall();
|
2007-06-16 10:36:34 +02:00
|
|
|
~ValveCall();
|
|
|
|
};
|
|
|
|
|
|
|
|
ValveCall *CreateValveVCall(unsigned int vtableIdx,
|
|
|
|
ValveCallType vcalltype,
|
|
|
|
const ValvePassInfo *retInfo,
|
|
|
|
const ValvePassInfo *params,
|
|
|
|
unsigned int numParams);
|
|
|
|
|
2007-06-16 17:40:22 +02:00
|
|
|
ValveCall *CreateValveCall(void *addr,
|
|
|
|
ValveCallType vcalltype,
|
|
|
|
const ValvePassInfo *retInfo,
|
|
|
|
const ValvePassInfo *params,
|
|
|
|
unsigned int numParams);
|
|
|
|
|
2007-06-16 10:36:34 +02:00
|
|
|
#endif //_INCLUDE_SOURCEMOD_VALVE_CALLER_H_
|