On Wed Jan 31 18:11:53 2024 +0000, Paul Gofman wrote:
KUSD is handled in ntdll/unix/virtual.c at process initialization, it is a "singleton" object which is created once on the server and never destroyed. So while maybe it is not exactly perfect there as well, doing such hacks in win32u is much worse, it breaks layering with win32u starting making assumptions on Nt kernel object operation and performing memory management directly. I think if saving space is needed now just avoiding Nt section is more straightforward than building Wine specific infrastructure around those, and some way of pooling of the shared memory is more straightforward than that.
How about using `NtCreateFile` instead? Mailslot responds to create_file by creating a file object backed by anonymous fd, so we can do something like that w/o abstraction layer violation. That would make `get_object_mapping` and its associated hacks unnecessary; we would just have to implement lookup_name` and perhaps `open_file` (shouldn't be needed if we're using regular/Unix file objects).