CreateProcess STATUS_DLL_NOT_FOUND-哪个dll? [英] CreateProcess STATUS_DLL_NOT_FOUND - which dll?

查看:158
本文介绍了CreateProcess STATUS_DLL_NOT_FOUND-哪个dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个调用 CreateProcess 的进程。似乎 CreateProcess 返回非零表示成功。但是,然后立即设置该过程的 HANDLE,表明该过程已退出。当我调用 GetExitCodeProcess 时,然后返回 STATUS_DLL_NOT_FOUND

I have a process which calls CreateProcess. It appears that CreateProcess returns nonzero indicating success. However, the HANDLE to the process then gets immediately set, indicating the process has exited. When I call GetExitCodeProcess, STATUS_DLL_NOT_FOUND is then returned.

我知道DLL丢失了。我什至确切地知道哪一个。但是,我不明白的是如何以编程方式解决该问题。

I understand that a DLL is missing. I even know exactly which one. However, what I don't understand is how to figure that out programmatically.

我注意到Windows将显示一个对话框,指出该进程无法启动,因为它无法启动。找不到指定的DLL(屏幕截图: http://www.mediafire.com/view/?kd9ddq0e2dlvlb9)。 Windows在对话框中指定缺少的DLL。但是,我找不到以编程方式自己获取该信息的方法。

I noticed that Windows will present a dialog saying that the process failed to start because it couldn't find the specified DLL (screenshot: http://www.mediafire.com/view/?kd9ddq0e2dlvlb9 ). In the dialog, Windows specifies which DLL is missing. However, I find no way to get that information myself programmatically.

如果进程无法启动,并且将返回 STATUS_DLL_NOT_FOUND ,如何以编程方式检索找不到目标进程的库名称?这样,我可以在错误报告中自动记录在给定安装中似乎缺少或损坏的DLL。

If a process fails to start and would return STATUS_DLL_NOT_FOUND, how do I programmatically retrieve the library name to which the target process was linked which couldn't be found? That way I can automatically record in an error report what DLL appears to be missing or corrupt in a given installation.

推荐答案


CreateProcess返回0表示成功。

CreateProcess returns 0 indicating success.

CreateProcess()返回 BOOL ,其中0是 FALSE ,也就是失败不成功。

CreateProcess() returns a BOOL, where 0 is FALSE, aka failure not success.


如果某个进程无法启动并返回STATUS_DLL_NOT_FOUND,该如何以编程方式检索找不到该目标进程的库名称?

If a process fails to start and would return STATUS_DLL_NOT_FOUND, how do I programmatically retrieve the library name to which the target process was linked which couldn't be found?

不幸的是,没有用于此的API。您唯一的选择是手动访问并枚举可执行文件的 IMPORTS 表以查找其使用的DLL,然后递归访问并枚举其 IMPORTS 表,手动检查找到的每个DLL引用,以查看该DLL文件是否在操作系统的搜索路径中。

Unfortunately, there is no API for that. Your only option would be to manually access and enumerate the executable's IMPORTS table to find out what DLLs it uses, and then recursively access and enumerate their IMPORTS tables, manually checking every DLL reference you find to see whether that DLL file exists on the OS's search path or not.

这篇关于CreateProcess STATUS_DLL_NOT_FOUND-哪个dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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