Re: Is it possible to share a LibUSB-Win32 handle between applications?

Peter Dons Tychsen via Libusb-win32-devel <[email protected]> Thu, 16 Sep 2021 10:58:02 +0200
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <[email protected]>
Hi all,

On Wed, 2021-09-15 at 09:55 +0800, Xiaofan Chen wrote:
> I believe this is not possible based on the current codes.
> 
> What you can try is to create the first application as a Windows
> service, and then the second application uses that Windows service.

Yeah, as Xianfan states, its not possible with this or any other
similar libarary. You cannot handover handles to
resources/devices/files from one application to another. That would be
a major security hole if you could. Most O/S only allow this is very
limited form.

You can solve it using pipes or sockets. Pipes and sockets are easy to
create. This even adds the flixibity of working across networks.

Thanks,

/pedro