On Mon Nov 20 14:13:21 2023 +0000, Jinoh Kang wrote:
The output handle is marked inheritable, but child processes won't know about the handle. Making it inheritable will thus lead to "handle leak."
wine_server_fd_to_handle(1, GENERIC_WRITE | SYNCHRONIZE, 0, &output_handle);
Contrast this with other uses of `wine_server_fd_to_handle( {0,1,2}, ..., OBJ_INHERIT, &... )`[^1][^2], which explicitly uses the allocated handle for std handles in process parameters. Note that wineserver assumes that std handles are inheritable[^3]. [^1]: https://gitlab.winehq.org/wine/wine/-/blob/7c45c7c5ebb59237d568a4e5b38626422e670b63/dlls/ntdll/unix/env.c#L1382-1384 [^2]: https://gitlab.winehq.org/wine/wine/-/blob/7c45c7c5ebb59237d568a4e5b38626422e670b63/dlls/ntdll/unix/env.c#L1619 [^3]: https://gitlab.winehq.org/wine/wine/-/blob/7c45c7c5ebb59237d568a4e5b38626422e670b63/server/process.c#L1336-1347
The inheritance was intentional. Nevermind, sorry.