Detours Express 分发dll时去掉detoured.dll这个库

1.X版本的Detours源码中是没有Detoured.dll这个库的,

在所以在2.1版本中加入这个库,我查看了源码,发现是在DetourGetDetouredMarker()是进行调用的,而文档上说是为了作标记。我觉得这里作法不是太好,所幸我们也很少用它。

 

Detours是可以多次挂钩的,因此我们可以放心去除Detoured.dll的调用。(若使用,必须将Detoured.dll放到系统目录下)
编辑 src/detours.cpp这个文件

注释掉以下3处:
1,
//#include "detoured.h"


2,
//#ifdef DETOURS_INTERNAL_USAGE
//#error Feature not supported in this release.
//
//#else
//    Detoured();
//#endif

3,
//#ifdef DETOURS_INTERNAL_USAGE
//#error Feature not supported in this release.
//
//
//#else
//    return Detoured();
//#endif


把3这里改成:return ::GetModuleHandle(NULL); 


这样重新编译后,在编dll时就不用引用detoured.lib
分发dll时也不用detoured.dll了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值