windows c++/cli DLL 在 Win 8.1 下失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24335787/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:37:43  来源:igfitidea点击:

c++/cli DLL fails under Win 8.1

windowswinapidllc++-climixed-mode

提问by user3600403

i have written a Win32/net DLL, it works fine under Win XP, Win7 and 8 but under Win 8.1 it fails.

我编写了一个 Win32/net DLL,它在 Win XP、Win7 和 8 下运行良好,但在 Win 8.1 下它失败了。

Dependency Walker says: API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL not found (user32.dll will call them)

Dependency Walker 说:API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL not found (user32.dll will call them)

Google means, MS changed some System-DLLs in 8.1 (and ignored compatibility), so that many programs have the same problem.

Google 的意思是,MS 在 8.1 中更改了一些 System-DLL(并忽略了兼容性),因此许多程序都有相同的问题。

Full list with "file not found":

“未找到文件”的完整列表:

API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
MSVCR120.DLL
API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL
API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
EXT-MS-WIN-NTUSER-UICONTEXT-EXT-L1-1-0.DLL
IESHIMS.DLL

Does someone have a idea how to fix this?

有人知道如何解决这个问题吗?

回答by David Heffernan

Dependency Walker's static analysis is not to be relied upon. The fact that Dependency Walker reports issues with those DLLs based on its static analysis does not mean that this is indeed your problem. It is normal for perfectly fine executables to report problems as you describe under static analysis, and yet execute perfectly well.

不能依赖 Dependency Walker 的静态分析。Dependency Walker 根据其静态分析报告这些 DLL 的问题的事实并不意味着这确实是您的问题。正如您在静态分析中所描述的那样,完美的可执行文件报告问题,并且执行得非常好,这是正常的。

Right now I'm looking at Dependency Walker's assessment of my application and I see the exact same list of supposedly problematic files as you do. But the application runs perfectly well. Simply put, you are looking at a false positive.

现在,我正在查看 Dependency Walker 对我的应用程序的评估,我看到的可能有问题的文件列表与您看到的完全相同。但该应用程序运行良好。简而言之,您正在查看误报。

Microsoft has certainly not ignored compatibility when upgrading operating systems. On the contrary, it goes to extraordinary lengths to maintain good compatibility.

微软在升级操作系统时当然没有忽视兼容性。相反,它不遗余力地保持良好的兼容性。

If you want to use Dependency Walker to debug dependency problems with native DLLs, then you really need to use it in dynamic mode, using the Profile menu. This will tell you which dependency fails to load at runtime, if indeed that is your problem. But depending on exactly where the balance is between managed and unmanaged, it may be that Dependency Walker is not the right tool for the job.

如果你想使用 Dependency Walker 来调试原生 DLL 的依赖问题,那么你真的需要在动态模式下使用它,使用 Profile 菜单。这将告诉您哪个依赖项在运行时无法加载,如果这确实是您的问题。但是,根据托管和非托管之间的平衡点,Dependency Walker 可能不是适合这项工作的工具。

And your problem may not be an issue with native dependencies. The first step is for you to diagnose exactly what the problem is. That's beyond the scope of this question because we don't have any details of the errors that you encounter.

而且您的问题可能不是本机依赖项的问题。第一步是让您准确诊断问题所在。这超出了本问题的范围,因为我们没有您遇到的错误的任何详细信息。