我需要调用一个 dll,该 dll 在一个应用程序中重复调用 5 个其他 dll

发布于 2024-09-18 01:59:00 字数 661 浏览 7 评论 0原文

我目前正在 C++ 应用程序中使用 SQLitening (www.sqlitening.com),我在其中调用 SQLitening.dll。 SQLitening.dll 随后调用 SQLiteningClient.dll、Zlib.dll 和 SQLite3.dll。我显式挂接 SQLitening.dll,执行一些函数,然后关闭连接并使用 FreeLibrary 取消引用 dll。

但是,后续 dll(SQLiteningClient.dll 等)仍然挂接到调用进程。每当我尝试再次挂钩 SQLitening.dll 时,它都可以正常挂钩,但某些函数行为不正常,例如查询远程数据库的函数。我不禁认为这是因为这些 dll 没有被正确释放。每当我隐式挂钩 dll(全局挂钩每个函数)时,只要我一直将其保留在内存中,一切都会正常工作。但是,我需要明确地这样做。

注意:SQLitening 的 Fred Meier 表示,显式链接在 PowerBasic 应用程序中工作得很好。我还应该注意到 SQLitening 是用 PowerBasic 编写的。

有没有办法为 SQLitening.dll 生成一个单独的进程或线程来挂钩所有内容,以便当我取消引用 SQLitening 时我可以杀死该进程?或者是否有一种特殊的方法来确保 SQLitening 调用的所有内容都被正确取消引用?谢谢。

-马特·菲尔普斯

-解析系统

I'm currently using SQLitening (www.sqlitening.com) in a C++ application where I'm calling SQLitening.dll. SQLitening.dll makes subsequent calls to SQLiteningClient.dll, Zlib.dll and SQLite3.dll. I am hooking SQLitening.dll explicitly, executing a few functions, and then I am closing the connection and dereferencing the dll with FreeLibrary.

However, the subsequent dlls (SQLiteningClient.dll, etc) are remaining hooked to the calling process. Whenever I try to hook SQLitening.dll again, it hooks fine, but some of the functions misbehave, such as the function to query the remote database. I can't help but think this is because those dlls aren't being free'd properly. Whenever I had hooked the dll implicitly (hooking each function globally), everything worked fine as long as I kept it in memory the whole time. However, I need to do this explicitly.

Note: Fred Meier of SQLitening said that explicit linking worked fine in a PowerBasic application. I should also note that SQLitening was written in PowerBasic.

Is there any way to spawn a separate process or thread for SQLitening.dll to hook everything to, so that when I dereference SQLitening I can just kill that process? Or is there a special way to make sure that everything that SQLitening calls is being dereferenced properly? Thanks.

-Matt Phelps

-Resolution Systems

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

败给现实 2024-09-25 01:59:00

我通过使用显式加载 dll 的 COM exe 解决了这个问题。

I solved the issue by just using a COM exe that loads the dll explicitly.

银河中√捞星星 2024-09-25 01:59:00

只需取消钩子或在钩子之前检查函数是否已被钩子即可。

Just unhook your hooks or check if function is already hooked before hook it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文