Jacek Caban (@jacek) commented about dlls/win32u/window.c:
return is_valid_entry_uniq( handle, type, ReadAcquire64( (LONG64 *)&entries[index].uniq )); }
+static BOOL read_acquire_user_entry( HANDLE handle, unsigned short type, const volatile struct user_entry *src, struct user_entry *dst ) +{ + if (!is_valid_entry_uniq( handle, type, ReadAcquire64( (LONG64 *)&src->uniq ) )) return FALSE; + dst->offset = src->offset; + dst->tid = src->tid; + dst->pid = src->pid; + dst->padding = src->padding; + __SHARED_READ_FENCE; + dst->uniq = ReadNoFence64( &src->uniq ); + return is_valid_entry_uniq( handle, type, dst->uniq );
It's very unlikely to matter, but technically, in case of short handles, we should probably make sure that both validations are against the same `uniq`. We could store the uniq used for the first validation and replace the second validation with `dst->uniq == uniq`. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7610#note_99752