On Thu Feb 6 12:19:19 2025 +0000, Rémi Bernon wrote:
This effectively leaks the handle? We have the fd cached, why do we care about the handle? What about something like that:
if (ret || server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL )) fd = -1; if (InterlockedCompareExchange( &device, fd, -2 ) != -2 && fd != -1 && needs_close) close( fd ); NtClose( handle );
That's not really legal unless you make assumptions about the fd cache. Generally speaking, closing a handle may also close its cached fd.
This *would* work since we don't mark the inproc sync handles cacheable, but there's not actually any reason they can't be cacheable, and making that assumption feels uncomfortable.