Jinoh Kang (@iamahuman) commented about dlls/win32u/winstation.c:
+ int ref = InterlockedDecrement( &session->ref ); + TRACE( "session %p decrementing ref to %d\n", session, ref ); + if (!ref) + { + /* global shared_session has a strong reference, unmap when strong refcount reaches 0. */ + NtUnmapViewOfSection( GetCurrentProcess(), (void *)session->shared ); + shared_session_release_weak( session ); + } +} + +static NTSTATUS map_shared_session_section( struct shared_session *session, HANDLE handle ) +{ + NTSTATUS status; + + while (!(status = NtMapViewOfSection( handle, GetCurrentProcess(), (void **)&session->shared, 0, 0, + NULL, &session->size, ViewUnmap, 0, PAGE_READONLY ))) We don't need to store `size` into session. It's currently made redundant by `object_capacity`.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3103#note_63267