On Wed Jun 28 11:57:05 2023 +0000, Jacek Caban wrote:
I looked at something somewhat similar for shared user handle table. Back then, I hoped to use it also for user32/win32u separation. It ended up being too much of a side quest, but I hope to revisit that at some point. My old branch is here: https://gitlab.winehq.org/jacek/wine/-/tree/user-handles There is not much overlap between that work and this MR (or Proton patches in general), but I'm mentioning it because it could be good to reconsider separate mappings per thread. I think that we will eventually want a global per-session mapping for handle table anyway. With a global shared mapping, mapped once in a process, we could just pass desktop data offset in requests affecting active desktop to keep client thread info updated.
Having a global mapping would make it more complicated to support an arbitrary number of threads. Unless we want to use a fixed limit, which doesn't sound ideal, we'd need to support resizing the mapping somehow.