nagisa / rust_libloading

Bindings around the platform's dynamic library loading primitives with greatly improved memory safety.

Home Page:https://docs.rs/libloading

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested Dlls will load not found module

Richyeoh opened this issue · comments

code: 126, kind: Uncategorized, message: "找不到指定的模块。"

image

More error info:
image

Maybe you shoud change here:
image
LoadLibraryExW that dwFlags is zero will like LoadLibraryA that load dll filee.

https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters
According to the document, I think we shoud be use LOAD_LIBRARY_SEARCH_DEFAULT_DIRS(0x00001000,
This value represents the recommended maximum number of directories an application should include in its DLL search path.

Sry, It my wrong, Maybe can use SetDllDirectoryA or AddDllDirectory to resolution .

The choice to specify flags to 0 by default was a conscious decision as the behaviour better matches that of other platforms. If you’d like to customize the behaviour on Windows specifically, I believe libloading::os::windows::Library::load_with_flags and then converting with libloading::Library::from should work well.