[PATCH v2] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread Takashi Yano
Non-cygwin app may call ReadFile() for empty pipe, which makes NtQueryObject() for ObjectNameInformation block in fhandler_pipe:: get_query_hdl_per_process. Therefore, stop to try to get query_hdl for non-cygwin apps. Addresses: https://github.com/msys2/msys2-runtime/issues/202 Fixes:

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread Takashi Yano
On Sun, 03 Mar 2024 11:39:40 +0100 ASSI wrote: > Takashi Yano writes: > >> After noticing that we enumerate all the processes (which is an expensive > >> operation) just to skip all of the non-Cygwin ones anyway, I wonder if it > >> wouldn't be smarter to go through the internal list of cygpids

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread ASSI
Takashi Yano writes: >> After noticing that we enumerate all the processes (which is an expensive >> operation) just to skip all of the non-Cygwin ones anyway, I wonder if it >> wouldn't be smarter to go through the internal list of cygpids and take it >> from there, skipping the

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread Takashi Yano
On Sun, 3 Mar 2024 10:34:44 +0100 (CET) Johannes Schindelin wrote: > Hi Takashi, > > thank you for the fix! I can confirm that it addresses the problem > demonstrated by the reproducer in that MSYS2-runtime ticket. Thanks for testing! > After noticing that we enumerate all the processes (which

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread Johannes Schindelin
Hi Takashi, thank you for the fix! I can confirm that it addresses the problem demonstrated by the reproducer in that MSYS2-runtime ticket. After noticing that we enumerate all the processes (which is an expensive operation) just to skip all of the non-Cygwin ones anyway, I wonder if it wouldn't