Jeffrey Smith (@whydoubt) commented about dlls/secur32/secur32.c:
> + "NameGivenName",
> + "NameSurname"
> +};
> +
> +static LPCSTR debugstr_NameFormat(IN EXTENDED_NAME_FORMAT NameFormat)
> +{
> + if (NameFormat >= sizeof(string_NameFormat)/sizeof(string_NameFormat[0]))
> + return "(unknown)";
> + return string_NameFormat[NameFormat];
> +}
> +
> BOOLEAN WINAPI GetUserNameExW(
> EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG nSize)
> {
> - TRACE("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize);
> + TRACE("(%d %s %p %p)\n", NameFormat, debugstr_NameFormat(NameFormat), lpNameBuffer, nSize);
Written this way, it would make it appear that the function takes 4 parameters. I would suggest revising to make it clear that this is two representations of the same parameter.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3301#note_38855
Jeffrey Smith (@whydoubt) commented about dlls/secur32/secur32.c:
> }
>
> +static LPCSTR string_NameFormat[] =
> +{
> + "NameUnknown",
> + "NameFullyQualifiedDN",
> + "NameSamCompatible",
> + "NameDisplay",
> + "NameUniqueId",
> + "NameCanonical",
> + "NameUserPrincipal",
> + "NameCanonicalEx",
> + "NameServicePrincipal",
> + "NameDnsDomain",
> + "NameGivenName",
> + "NameSurname"
The values in the EXTENDED_NAME_FORMAT enumeration are not contiguous, so you need to fill in some gaps.
For instance, NameUniqueId is 6.
If passed in, this method would return "NameUserPrincipal".
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3301#note_38852