#define HOOKDEF(return_value, calling_convention, apiname, ...) \
return_value (calling_convention *Old_##apiname)(__VA_ARGS__); \
return_value calling_convention New_##apiname(__VA_ARGS__)
HOOKDEF(BOOL, WINAPI, CopyFileA,
__in LPCTSTR lpExistingFileName,
__in LPCTSTR lpNewFileName,
__in BOOL bFailIfExists
)
{
BOOL bOk = FALSE;
printf("CopyFileA 被调用\r\n");
bOk = Old_CopyFileA(lpExistingFileName, lpNewFileName, bFailIfExists);
if(bOk)
{
printf("文件:%s被复制为:%s\r\n", lpExistingFileName, lpNewFileName);
}
return bOk;
}
上面是这个宏的定义和声明
下面是使用
extern
HOOKDEF(BOOL, WINAPI, CopyFileA,
__in LPCTSTR lpExistingFileName,
__in LPCTSTR lpNewFileName,
__in BOOL bFailIfExists
);
这个宏是什么意思呢???