在DllMain附加和分离过程中的使用限制 [英] Usage limitations during the DllMain Attach and Detach process

查看:165
本文介绍了在DllMain附加和分离过程中的使用限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个同事在DllMain Detach过程中遇到麻烦。

One colleague of mine has troubles during the DllMain Detach process. His bug seems not to appear in all cases, but fairly often.

在尝试帮助他的时候,我还记得在DllMain的附件中有一些使用限制和分离过程,但我不确定我记得很好,因为它是2年的技术讨论,这不是我的工作的终止问题。

While trying to help him, I kind of remembered of some usage limitations during the DllMain Attach and Detach process, but I am not sure I remember well since it was 2 year old technical discussions and it was not me working on thoses termination issues.

也就是我记得我们应该:

Namely I kind of remember that we should:


  • 避免使用新的和删除操作符和喜欢HGLOBAL内存分配

  • 避免在这里处理线程终止。

如果我错了,请解释一下,

Could you correct me if I am wrong, explain me if ever, or point to a technical article that would deal with these issues.

推荐答案

避免调用LoadLibrary和相关API。

Avoid calling LoadLibrary and related APIs.

除了Steve的链接,以下是来自Raymond Chen的旧新事物

In addition to Steve's link, here are some good relevant posts from Raymond Chen's The Old New Thing:

  • http://blogs.msdn.com/b/oldnewthing/archive/2004/01/27/63401.aspx
  • http://blogs.msdn.com/b/oldnewthing/archive/2004/01/28/63880.aspx
  • http://blogs.msdn.com/b/oldnewthing/archive/2007/09/04/4731478.aspx
  • http://blogs.msdn.com/b/oldnewthing/archive/2010/01/15/9948740.aspx

这篇关于在DllMain附加和分离过程中的使用限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆