On Fri Aug 4 16:25:15 2023 +0000, Jinoh Kang wrote:
which is more risky
It may be less risky since intra-object namespace does not have to be enumerable (it can only implement `lookup_name`), in contrast to directory object which has to be *always* enumerable by contract.
than having a wine-specific directory in the WindowsStations directory.
I think it's more likely for an app to mistake `__wine_desktop_mappings` for an actual window station. Currently `user32!EnumWindowStationsW` is implemented as a direct server call in Wine. Windows might as well implement it with `NtQueryDirectoryObject` instead.
It also suggests that desktop is supposed to contain other objects on Windows
I think it's okay since the distinction between leaf objects and directories are blurry on NT. Previously leaf objects can always become a namespace without breaking the ABI.
whereas it would only be a Wine-specific thing.
As long as we keep returning `STATUS_OBJECT_TYPE_MISMATCH` other than for `__wine_desktop_mapping`, we should be fine.
I did that, and I think it ends up being actually nice as it introduces a generic way to have a shared mapping for every server object.
It could perhaps be made even more generic than what's currently done in this MR, by having the shared mapping stored in the object structure, but I didn't want to do that yet. Then, because of this every "mappable" object need to implement a custom `lookup_name` / `link_name` for now, to handle the object mapping, but I think it's not too bad and it could be factored out later if that seem useful.