RFC: adding fd-passing to win32
Marc-André Lureau
marcandre.lureau at gmail.com
Mon Aug 8 11:40:22 UTC 2022
Hi
On Fri, Aug 5, 2022 at 7:52 PM Thiago Macieira <thiago at kde.org> wrote:
> On Friday, 5 August 2022 00:35:54 PDT Marc-André Lureau wrote:
> > As you probably know, HANDLEs are not FD. And Windows has the 2 types,
> and
> > functions to map to/from the 2 (_get_osfhandle/_open_osfhandle).
>
> There's no way to transport file descriptors as numbers anyway because
> they're
> local to each application. And on Windows, it's entirely controlled by the
> runtime (userspace), which is why those two functions exist.
>
> That means the wire format is irrelevant. I suggest keeping 'h' because
> there's no difference. The fact that on Windows they're marshalled as
> actual
> handles and on Linux they're out-of-band is an implementation detail.
>
FDs are not HANDLEs, we shouldn't mix the two (a mistake commonly observed
and annoying to clean up).
If some day Windows sockets learn SCM_RIGHT, we should transfer FDs values.
We could eventually use 'h' for FDs or HANDLEs or SOCKETs (or other kind as
necessary), the "handle array" contains the type details. But then 'h'
implementation will be different on Windows, regardless of potentially
future same SCM_RIGHT support. I think it's a better idea to treat HANDLEs
as a different type.
--
Marc-André Lureau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20220808/17b9d081/attachment.htm>
More information about the dbus
mailing list