Calling native library functions from "windows" application

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
firk
Newbie
Newbie
Posts: 4
Joined: Fri Jun 26, 2015 1:15 pm

Calling native library functions from "windows" application

Post by firk »

Is there a (simple) way to call native OS/libc/other libs functions from windows-compiled binaries under wine?

For example, something like this:

Code: Select all

typedef int (* fn_recv)(int fd, void * buf, unsigned int bufsize, int flags);
fn_recv p_recv;

h = GetModuleHandle("libc.so");
p_recv = (fn_recv)GetProcAddress(h, "recv");
and use p_recv() after that.

It is enough to just get memory address of required native library function.

Of course, windows-compiled binary should be aware of wine environment to do this. I cannot recompile entire application with winelib, but can do some patches to it or load any DLL from it.
firk
Newbie
Newbie
Posts: 4
Joined: Fri Jun 26, 2015 1:15 pm

Re: Calling native library functions from "windows" applicat

Post by firk »

seems i found solution https://www.winehq.org/docs/winelib-guide/bindlls
Since google shows this thread in 1st place and doesn't show the solution page in its search results, it will be good to keep this link here.
Locked