Unix FD to Windows File Handles mapping.

Damjan Jovanovic damjan.jov at gmail.com
Fri Dec 20 21:49:20 CST 2019


Try wine_server_fd_to_handle()

Once you register a fd with Wine that way, it lives inside wineserver, and
during API calls, you just get back temporary copies of it, usually with
different fd numbers.



On Sat, Dec 21, 2019 at 1:57 AM Bruno Albuquerque <bga at gmail.com> wrote:

> Is the way that wine maps file handles from Unix (Linux, more
> specifically) to Windows predictable?
>
> I have this Linux program that forks Wine to run a Windows program. The
> Windows program can easily access stdin/stdout/stderr the way one would
> expect in a forked Unix program but I am trying to pass one extra file
> descriptor to the windows program but I am not sure how to do that.
>
> In the Unix program, the FD will be, say, 3. As I am forking then exec'ing
> Wine, wine itself will have access to this FD and, from Wine's point of
> view, it should also be 3. The problem is that it seems file handles in
> Windows are not like in Unix (for example, stdin is not 0, stdout is not 1
> and stderr is not 2) so I am assuming that to make this FD available to the
> WIndows program, it is somehow mapped to a file handle with a
> different number too. I need to know which one it si to be able to use it.
> Any pointers on how to do that?
>
> If I compile a C program with winegcc/winelib and fork/exec it, it looks
> like file handles and file descriptors match so one option is to use it.
> But I prefer to create the program in a different language so winelib is
> not ideal.
>
> Any help would be much appreciated.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20191221/b7852920/attachment.htm>


More information about the wine-devel mailing list