Why isn't this using an atom like the normal class name?
We certainly can. Pros:
1. `NtUserGetClassName` can be slightly simplified in other-process-window case. 2. `NtUserGetClassName` will no longer need fallback-to-non-real-class behavior. We can simply set the real-class-atom to the normal-class-atom. 3. We'll no longer need `enum wine_real_class_id` as well as `real_class_id_str`.
However, there are a few questions that I couldn't find an optimal answer that you'll certainly like.
1. **Name-to-atom** mapping: a real-class-name (e.g. `Static`) has to be mapped *at some point* to an atom for use in `struct class`. When should the atoms be created?
1. Reserve (and possibly pin) the atoms on initialization[^init-by-whom]. If we go this route, we probably want to keep `wine_real_class_id` in some form, which means this is merely swapping one indirection for another.
2. Look up the atoms when `set_real_window_class_id` is called. This allows us to avoid reserving atoms at startup, but slows down initialization of certain user32 controls.
3. Other solutions: I don't believe there are any; please correct me if this is not the case.
2. **Atom-to-name** mapping: the set of possible "real class names" is fixed; the user cannot add more. On the other hand, the real-class-atom is an *indirection* that allows arbitrary "real class names." This is arguably a bloat[^that-can-be-justified]. Where should we introduce it?
1. Add a field (e.g. `WCHAR[9] real_class_name;`[^why-nine], +18 bytes[^mem] of memory use) to `WND` structure in `ntuser_private.h` for the cached real-class-name.
2. Add a server call (process context switch) in `NtUserGetClassName()` to fetch the real-class-name from the atom. This can slow down oleacc and/or UIAutomation APIs, although @cmcadams has a better insight.
3. Other solutions: I don't believe there are any; please correct me if this is not the case.
I'm okay with any of the choices above. I was merely raising this issue because the approaches above may end up adding more complexity.
[^init-by-whom]: This can happen in the server, `win32u.dll`, or `win32u.so`. [^that-can-be-justified]: I said "bloat" because we're allocating unnecessary resources, but this is not necessarily a bad thing if it makes code readable. [^why-nine]: The longest known real-class-names in the test are `ScrollBar` (9 characters) and `MDIClient` (9 characters). [^mem]: +6.25% for 64-bit. +9% for 32-bit.