服务崩溃加载DLL(Service Crash loading dll)

编程入门 行业动态 更新时间:2024-10-22 15:27:28
服务崩溃加载DLL(Service Crash loading dll)

我已经做了一个新的Windows服务,它使用准系统代码(只是一个服务的基本框架)工作得很好,但是,当我将它链接到我的dll时,lib文件使用dll中的功能崩溃时启动一个0xc0000034错误。

有没有特别的地方可以把dll作为服务或特殊的方式来做到这一点?

编辑:我有所需的DLL在与exe文件相同的文件夹中,但我会尝试将它们移动到system32文件夹。 我认为这可能是由我的内存泄漏检测器(vld)和服务引起的冲突,将不得不做更多的调试和试错。

编辑2:

找出是什么原因造成的。 它缺少dbghelp.dll(使用dependency walker来解决)。 感谢您的意见。

I have made a new windows service which works fine using barebone code (just the basic framework for a service), however, when i link it against my dlls, lib file to use the functionality in the dll it crashes on start up with a 0xc0000034 error.

Is there a special place to put the dlls for a service or a special way to do this?

.

Edit: i have all dlls it needs in the same folder as the exe but i will try moving them to the system32 folder. I think it might be a conflict caused by my memory leak detector (vld) and the service, will have to do some more debugging and trial and error.

.

Edit 2:

Found out what was causing it. It was missing dbghelp.dll (used dependency walker to work it out). Thanks for the input.

最满意答案

0xc0000034代表STATUS_OBJECT_NAME_NOT_FOUND,表示缺少文件。 你把dll放在正确的路径上吗?

编辑:我认为,因为它是win服务,它加载的dll路径应该是绝对路径,或者它应该在PATH环境变量中(COM服务器就像那样)

只需将dll复制到System32目录并检查它是否修复了问题。

0xc0000034 stands for STATUS_OBJECT_NAME_NOT_FOUND, which suggests a missing file. Are you placing the dlls in correct path?

EDIT: I think, as it is win service, path to the dll that it loads should be absolute path or it should be in PATH environmental variable(COM servers works like that)

Just copy the dlls to the System32 directory and check whether it fixes the problem.

更多推荐

本文发布于:2023-08-07 19:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465589.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   DLL   Service   dll   loading

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!