2016-08-12 10:14:45 +08:00
|
|
|
#include "common.h"
|
|
|
|
#include <VersionHelpers.h>
|
|
|
|
|
|
|
|
#pragma once
|
2016-08-30 15:54:05 +08:00
|
|
|
|
2023-08-21 15:59:22 +08:00
|
|
|
#ifdef EASYHOOK
|
|
|
|
|
|
|
|
#include "easyhook.h"
|
2016-08-12 10:14:45 +08:00
|
|
|
#define HOOK_MANUALLY HOOK_DEFINE
|
2023-08-22 17:48:13 +08:00
|
|
|
#define HOOK_DEFINE(rettype, name, argtype, arglist) \
|
2016-08-15 10:53:41 +08:00
|
|
|
extern rettype(WINAPI * ORIG_##name) argtype; \
|
|
|
|
extern HOOK_TRACE_INFO HOOK_##name;
|
2016-08-12 10:14:45 +08:00
|
|
|
#include "hooklist.h"
|
|
|
|
#undef HOOK_DEFINE
|
|
|
|
#undef HOOK_MANUALLY
|
|
|
|
|
2023-08-22 17:48:13 +08:00
|
|
|
#define HOOK_MANUALLY(rettype, name, argtype, arglist) \
|
2016-08-12 10:14:45 +08:00
|
|
|
extern LONG hook_demand_##name(bool bForce = false);
|
2023-08-22 17:48:13 +08:00
|
|
|
#define HOOK_DEFINE(rettype, name, argtype, arglist) ;
|
2016-08-12 10:14:45 +08:00
|
|
|
#include "hooklist.h"
|
|
|
|
#undef HOOK_DEFINE
|
2020-12-06 17:00:05 +08:00
|
|
|
#undef HOOK_MANUALLY
|
2023-08-21 15:59:22 +08:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define HOOK_MANUALLY HOOK_DEFINE
|
2023-08-22 17:48:13 +08:00
|
|
|
#define HOOK_DEFINE(rettype, name, argtype, arglist) \
|
2023-08-21 15:59:22 +08:00
|
|
|
extern rettype(WINAPI * ORIG_##name) argtype; \
|
|
|
|
extern BOOL IsHooked_##name;
|
|
|
|
#include "hooklist.h"
|
|
|
|
#undef HOOK_DEFINE
|
|
|
|
#undef HOOK_MANUALLY
|
|
|
|
|
2023-08-22 17:48:13 +08:00
|
|
|
#define HOOK_MANUALLY(rettype, name, argtype, arglist) \
|
2023-08-21 15:59:22 +08:00
|
|
|
extern LONG hook_demand_##name(bool bForce = false);
|
2023-08-22 17:48:13 +08:00
|
|
|
#define HOOK_DEFINE(rettype, name, argtype, arglist) ;
|
2023-08-21 15:59:22 +08:00
|
|
|
#include "hooklist.h"
|
|
|
|
#undef HOOK_DEFINE
|
|
|
|
#undef HOOK_MANUALLY
|
|
|
|
|
|
|
|
#endif
|