Power comes with responsibility

      记得前一段时间看一篇老外写的关于Hook的文章时遇到了一句话:Power comes with responsibility.当时还没有太多的感觉,直到今天我自己写一些全局HOOK的东西时才真正理解这句话的含义.

    是的,责任随权利而来.权利通常是把双刃剑.你能做的事情越多,你出错的机会就越多,你的责任也就越多.比如全局钩子给了你控制整个desktop中所有线程的权利,这的确挺爽,但是,如果你"滥用职权"(很多情况下是"错用职权"),就很容易导致系统Down掉(相比之下,线程钩子要安全一些,最多一个线程over),我在调试我写的HOOK时,十几分钟内就Reboot了五六次.其中最普遍的是我在HOOK的Callback函数中设了BreakPoint,VC一遇到CallBack中的断点,立即Down掉了,然后整个系统都没有相应了,只有重新启动.其实这也不能全怪VC,毕竟是系统级的钩子,callback被中断了,所有此类型(比如鼠标)的消息都无法正常到达Target窗口,所有的窗口都不相应鼠标消息了,不死就怪了.虽然我最后用TRACE宏代替了断点,并顺利完成调试,但是我写的这个东西是要给别人用的,callback要由用户提供!天知道他会在callback里做什么操作??我所做的也许只有给他一些warnnings,告诉他不要在callback里做一些会BLOCK的操作.

    想来想去,我这么做也就够了,其实我只要告诉他们,Power comes with responsibility!也许就足够了.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
最新版: Understanding your company’s data has never been easier than with Microsoft’s new Power BI package for Excel Consisting of four powerful tools—Power Pivot, Power View, Power Query and Power Maps—Power BI makes self-service business intelligence a reality for a wide range of users, bridging the traditional gap between Excel users, business analysts and IT experts and making it easier for everyone to work together to build the data models that can give you game-changing insights into your business. Beginning Power BI with Excel 2013 guides you step by step through the process of analyzing and visualizing your data. Daniel R. Clark, an expert in BI training and a regular speaker on these topics, takes you through each tool in turn, using hands-on activities to consolidate what you’ve learned in each chapter. Starting with Power Pivot, you will create robust scalable data models which will serve as the foundation of your data analysis. Once you have mastered creating suitable data models, you will use them to build compelling interactive visualizations in Power View. It’s often necessary to combine data from disparate sources into a data model. Power Query allows you to easily discover, combine, and refine data from a variety of sources, so you can make accurate judgments with all the available information. Geographical awareness is another common requirement of data analysis. Using Power Maps you will create captivating visualizations that map your data in space and time.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值