#ifndef __TBB_function_replacement_H
#define __TBB_function_replacement_H
#include <stddef.h>
typedef enum {
FRR_OK,
FRR_NODLL,
FRR_NOFUNC,
FRR_FAILED,
} FRR_TYPE;
typedef enum {
FRR_FAIL,
FRR_IGNORE,
} FRR_ON_ERROR;
typedef void (*FUNCPTR)();
#ifndef UNICODE
#define ReplaceFunction ReplaceFunctionA
#else
#define ReplaceFunction ReplaceFunctionW
#endif
FRR_TYPE ReplaceFunctionA(const char *dllName, const char *funcName, FUNCPTR newFunc, const char ** opcodes, FUNCPTR* origFunc=NULL);
FRR_TYPE ReplaceFunctionW(const wchar_t *dllName, const char *funcName, FUNCPTR newFunc, const char ** opcodes, FUNCPTR* origFunc=NULL);
bool IsPrologueKnown(const char* dllName, const char *funcName, const char **opcodes, HMODULE module);
union Int2Ptr {
UINT_PTR uip;
LPVOID lpv;
};
inline UINT_PTR Ptr2Addrint(LPVOID ptr);
inline LPVOID Addrint2Ptr(UINT_PTR ptr);
const unsigned MAX_PROBE_SIZE = 32;
const unsigned SIZE_OF_RELJUMP = 5;
const unsigned SIZE_OF_INDJUMP = 6;
const unsigned SIZE_OF_ADDRESS = 8;
const unsigned MAX_PATTERN_SIZE = MAX_PROBE_SIZE - SIZE_OF_RELJUMP + 1;
const __int64 MAX_DISTANCE = (((__int64)1 << 31) - 1) - MAX_PROBE_SIZE;
const ptrdiff_t MAX_NUM_BUFFERS = 256;
#endif