On Thu Jul 11 10:51:43 2024 +0000, Elizabeth Figura wrote:
> Sorry for the late approval; I missed that I had been assigned.
> As far as I can tell from the documentation this is correct and matches
> the semantics we need.
> There are a couple trailing whitespace errors in the last patch though.
No worries, and thanks the review!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5237#note_75894
On Thu Jul 11 10:08:54 2024 +0000, Dmitry Timoshkov wrote:
> I'd suggest to add a test. That test most likely will show that
> GetUserNameEx(NameDisplay) returns an error ERROR_NONE_MAPPED on every
> VM in the Testbot. That means that your assumptions about
> GetUserNameEx() behaviour are incorrect, and the code in your plugin
> software won't work on at least some (I'd guess on most) of the Windows
> computers. Therefore your implementation is incorrect as well.
I will. Also, take a look at this:

--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6002#note_75893
On Thu Jul 11 09:52:04 2024 +0000, Egor Poleshko wrote:
> Nevermind, I apologise. I misunderstood how do the username values work
> on local accounts.
> From your and my observations, GetUserNameExW(3) performs several checks
> before returning a result:
> - If the user is connected to an Active Directory domain, return the
> `displayName` value from the domain LDAP database.
> - If the local user is linked to a Microsoft account, return the name
> specified in it.
> - Else, return `ERROR_NONE_MAPPED`.
> The Microsoft Account part is tricky, because, as far as I know, Wine
> doesn't provide a way to link the local user to a Microsoft account...
> Maybe, my implementation will suffice?
I'd suggest to add a test. That test most likely will show that GetUserNameEx(NameDisplay) returns an error ERROR_NONE_MAPPED on every VM in the Testbot. That means that your assumptions about GetUserNameEx() behaviour are incorrect, and the code in your plugin software won't work on at least some (I'd guess on most) of the Windows computers. Therefore your implementation is incorrect as well.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6002#note_75890
On Thu Jul 11 09:01:15 2024 +0000, Dmitry Timoshkov wrote:
> What do you mean?
Nevermind, I apologise. I misunderstood how do the username values work on local accounts.
From your and my observations, GetUserNameExW(3) performs several checks before returning a result:
- If the user is connected to an Active Directory domain, return the `displayName` value from the domain LDAP database.
- If the local user is linked to a Microsoft account, return the name specified in it.
- Else, return `ERROR_NONE_MAPPED`.
The Microsoft Account part is tricky, because, as far as I know, Wine doesn't provide a way to link the local user to a Microsoft account... Maybe, my implementation will suffice?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6002#note_75889