Comments (4)
ping @rjemanuele
from luvi.
Hi,
Yes, that is what luv_renamed.c does. It uses a Microsoft concept called Delay Loaded DLLs.
Since our extensions that are DLLs are built against the exports from luvi.exe, those DLLs look for luvi.exe for their unresolved symbols. Since luvi.exe can be renamed and packaged with an appended zip file to contain the lua code and DLLs it may not be able to find luvi.exe. Using the delay loading hooks, tell the operating system loading the DLLs what to do. In our case we catch the lookup of symbols from luvi.exe and redirect it to the current executable.
The delay loading failure hook needs to be in the DLL. In our case, we require some DLL library, that DLL loads, it has other symbols to resolve (including from our luvi.exe), the failure hook makes that redirection.
You may need to build your DLL in a certain way, without more information I cannot be sure. How we build extension DLLs is like this: https://github.com/virgo-agent-toolkit/lua-sigar/blob/master/CMakeLists.txt
from luvi.
Thank you for explaining!
I wonder there is a way to redirect dll's dependency without modify dll.
e.g. I have a foo.dll, it depends bar.dll, when I load foo.dll, I make foo.dll do not load bar.dll, but use process handler (GetModuleHandle(NULL)) to resolve symbols. Is that possible?
from luvi.
I believe you can look up each symbol you need thought GetModuleHandle(NULL), just seems like more work.
from luvi.
Related Issues (20)
- Termux/aarch64: Segfaults at 97% build progress HOT 18
- Consider using zig cc to make prebuilt binaries HOT 27
- Update to OpenSSL 1.1.1g HOT 2
- Luvi on arm HOT 4
- Error building lit with luvi HOT 4
- Install on raspbian HOT 2
- wolfssl openssl
- Build failure with custom LuaJIT (OpenResty fork) HOT 15
- Build failure on Apple Silicon HOT 8
- Example for a simple SSL-TCP-Server with luvi (not luvit) HOT 2
- CI deploy authorization failing
- travis-ci.org is dead
- "unprotected error in call to Lua API" with custom ARM binary HOT 8
- Installing on ARM64 (Ubuntu 20.04) HOT 1
- Build error (M1 mac) HOT 2
- "rex" should be "rex.pcre" HOT 1
- Build for Apple's arm64 processors HOT 2
- [string "bundle:main.lua"]:1: module 'weblit' not found: HOT 1
- Failed building in Termux with shared OpenSSL 3.0, PCRE, and Luv HOT 3
- luvi-regular-Linux_aarch64 Support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luvi.