Jinoh Kang (@iamahuman) commented about dlls/win32u/class.c:
} + else + real_class_id = wnd->real_class_id;
- ret = min( name->MaximumLength / sizeof(WCHAR) - 1, lstrlenW(class->basename) ); - if (ret) memcpy( name->Buffer, class->basename, ret * sizeof(WCHAR) ); + if (real && real_class_id) + { + assert(real_class_id <= ARRAY_SIZE(real_class_id_str)); + basename = real_class_id_str[real_class_id - 1]; + } + else + { + assert(wnd); + basename = (const WCHAR *)wnd->class->basename; + }
...and deal with the atom in a centralized place. I think this is more straightforward: _real_ first, _local_ second, and _remote_ last. ```suggestion:-4+0 else if (wnd) { basename = (const WCHAR *)wnd->class->basename; } else return NtUserGetAtomName( atom, name ); ``` Of course, the `ATOM atom;` declaration has to be hoisted out of the prior `if` scope. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4092#note_49538