Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dladdr() on Windows #2032

Closed
q82419 opened this issue Oct 31, 2022 · 5 comments · Fixed by #3412
Closed

dladdr() on Windows #2032

q82419 opened this issue Oct 31, 2022 · 5 comments · Fixed by #3412
Labels
enhancement New feature or request good first issue Good for newcomers platform-windows

Comments

@q82419
Copy link
Collaborator

q82419 commented Oct 31, 2022

Motivation

WasmEdge will use dladdr() on MacOS and Linux to search the plug-in default load path.
But the same function on Windows is not implemented.

Details

Implement the same function on Windows. (lib/plugin/plugin.cpp)

@q82419 q82419 added the good first issue Good for newcomers label Oct 31, 2022
@q82419 q82419 added this to To do in Release for 0.12.0 via automation Oct 31, 2022
@hydai hydai added enhancement New feature or request platform-windows labels Nov 4, 2022
@Its-Maniaco
Copy link

Hello @q82419 @hydai
Would the implementation be the same as Linux? We will have to change UsrStr & LibStr along with the results pushed into Result. Can you kindly confirm?

@q82419
Copy link
Collaborator Author

q82419 commented Feb 23, 2023

Hi @Its-Maniaco ,

Can you take some examples on Windows or create a PR to explain? Thanks!

@dracoooooo
Copy link
Contributor

Hi, I want to know if the issue is about using the result of dladdr() to replace kGlobalPluginDir? I found a function similar to dladdr() on Windows called GetModuleFileNameA().

@q82419
Copy link
Collaborator Author

q82419 commented Mar 3, 2023

Yes, you're right.
Maybe this API helps? But the hModule argument should not be NULL, because we need the path of wasmedge.dll, not the current executable.

@ho-229
Copy link

ho-229 commented Mar 8, 2023

How about GetModuleHandleExA with GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS flag.

@q82419 q82419 removed this from To do in Release for 0.12.0 Apr 26, 2023
@q82419 q82419 added this to To do in Release for 0.13.0 via automation Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers platform-windows
Projects
Development

Successfully merging a pull request may close this issue.

5 participants