RFC: adding fd-passing to win32

Thiago Macieira thiago at kde.org
Tue Aug 23 18:35:06 UTC 2022


On Monday, 22 August 2022 22:46:11 -03 Lawrence D'Oliveiro wrote:
> On Mon, 22 Aug 2022 21:38:03 -0300, Thiago Macieira wrote:
> > On Monday, 22 August 2022 19:39:21 -03 Lawrence D'Oliveiro wrote:
> >> So why not use high-level IPC APIs that are already Windows native,
> >> if you want a “nicer and more rounded” product? So why bother
> >> trying to add some oddball mutation of D-Bus, with its
> >> POSIX-centricity, to the mix?
> > 
> > Because there's nothing in D-Bus that is inherent Unix-only for the
> > session bus.
> 
> But there is: passing file descriptors between processes doesn’t
> work--at least, not in a straightforward POSIXy fashion. Hence all the
> discussion over trying to hack the protocol to adapt it to Windows
> limitations.

Do note that's not a Unix feature, but a Linux one. Other Unix systems don't 
always support it and applications meant to be portable must have a means of 
sharing data other than passing file descriptors. It's probably not a problem 
if the file descriptor you're trying to pass is a memfd in the first place, 
because that is also Linux-specific.

Maybe FreeBSD has got those features now, though. I think I've read about it 
having file sealing, which is something Linux added first for memfd (because 
Wayland uses them, and passes file descriptors).

> If it worked properly, there would be no need for any of this long
> discussion!

Fair enough. It's not been proven yet that passing Windows handles can be done 
in a way that won't horribly break libdbus-1. If it is possible to simply 
_open_osfhandle() for all received handles, we may not even need a new API.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering





More information about the dbus mailing list