直接从Go-bindata字节片加载DLL

发布于 2025-02-06 07:31:13 字数 723 浏览 2 评论 0原文

我正在构建使用第三方DLL的Windows应用程序。为了将所有内容捆绑到一个可执行文件中,我将DLL嵌入为go-bindata资产中的dll中。

当前,当应用程序首次运行时,我将嵌入式DLL放到本地文件系统中,然后加载syscall.newlazydll()。到目前为止的工作正常!

不过,我想知道,如果有人知道一个解决方案,可以让我直接从内存字节板中加载dll,而go-bindata资产提供了,而无需先将DLL作为一个文件到本地文件系统。

我目前正在查看syscall_windows.go syscall.syscall.newlazydll newlazydll 在某个时候打电话,但在某个时候并没有真正并不是真的没有有一个想法从这里去哪里...

我找到了这个问题 and github储存库这似乎涉及一个类似的问题,但都与C/C ++/C ++/有关C#。

想法?

I'm building a windows application that uses a third-party DLL. In order to bundle everything into one executable, I have embedded said DLL as a go-bindata asset into my binary.

Currently I drop the embedded DLL to the local file system when the application runs for the first time and then load it with syscall.NewLazyDLL(). That works fine so far!

I was wondering, though, if anyone knows a solution that would allow me to load the DLL directly from the in-memory byte-slice that the go-bindata asset provides, without first dropping the DLL as a file to the local filesystem.

I am currently looking at Go's runtime.syscall_loadlibrary() method in syscall_windows.go that syscall.NewLazyDLL calls at some point but don't really have an idea where to go from here...

I found this question and this github repository that seem to deal with a similar issue, but all related to C/C++/C#.

Thoughts?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文