Yes, right now Wine implements both using global atoms. Implementing NtUserRegisterWindowMessage is necessary to test it, but we cannot split the user/global atoms namespace yet as it would break many other things.
Okay, I see that it's duplicating the existing implementation. I guess it would be less confusing to say "move RegisterWindowMessage to win32u", and do so—why isn't that done here?
Atoms are just numbers within 0xc000-0xffff but global vs user atoms have different values for the same numbers. So it's possible that one user atom also exists as a global atom, but with a different string value (or even the same value if really unlucky). The test checks both and status only checks if the number exists (another test checks the atom value).
Ah, that makes sense. It may be helpful to note that in a comment, otherwise it's easy to miss the wcscmp() lacking a !.