如何检查dllmain函数返回false [英] How to check dllmain function is returning false

查看:264
本文介绍了如何检查dllmain函数返回false的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以在从exe加载cpp dll时找到该dll是否从DllMain方法重新调整为false



假设我有一个cpp exe和内部它试图加载一个cpp dll,然后如果cpp dll从DllMain方法返回false



我试过的:



我已经在互联网上查了但没有运气

Is there a way to find while loading a cpp dll from an exe whether that dll is retuning false from DllMain method

Suppose I have an cpp exe and internally it is trying to load a cpp dll ,then if the cpp dll return false from DllMain method

What I have tried:

I have checked on the internet but no luck

推荐答案

你检查过这个显而易见的地方了吗? DllMain入口点 - Windows应用程序| Microsoft Docs [ ^ ]。
Did you check the obvious place? DllMain entry point - Windows applications | Microsoft Docs[^].


dll的问题通常导致与其他dll的依赖关系,这被称为dll hell。所以欢迎;-)



我建议使用 dependency walker 工具。这个伟大的工具帮助我在很多疯狂的场景中解决了我的头痛。注意x32和x64风格的这个工具(和你的dll)



profi-tip:尽可能经常使用静态链接并检查dll是否在搜索路径或在正确的目录中也应该是进程的起始目录。



咒语是:用户dll在应用程序的安装目录中,但是系统或第三方dll ware随供应商的安装软件一起安装。
Problems with dll are often resulting with dependencies to other dlls, This is known as "dll hell". So welcome ;-)

I would recommand using the tool dependency walker. This great tool helped me in a lot of crazy scenarios and solved my headaches. Pay attention to x32 and x64 flavor of this tools (and your dlls)

profi-tip: using static linking as often as possible and check that the dlls are in the search path or in the correct directory which also should be starting directory of the process.

The mantra is: user dlls are in the installation-directory of the app, but system or third party dlls ware installed with the installation software of the vendor.


这篇关于如何检查dllmain函数返回false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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