[Documentation for EnumSystemLocalesA/W](https://learn.microsoft.com/en-us/windows/win32/api/w… says "If [`LCID_ALTERNATE_SORTS`] is used with either `LCID_INSTALLED` or `LCID_SUPPORTED`, the installed or supported locales are retrieved, **as well as** the alternate sort locale identifiers." (emphasis mine).
Until now, Wine *only* returned alternate sorts in this case, which apparently breaks some versions of NexusDB.
This MR fixes the issue and adds some basic tests to ensure the issue isn't accidentally re-introduced at a later time.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6455
On Fri Sep 6 20:47:12 2024 +0000, Martin Storsjö wrote:
> FYI, this isn't universally the case - Linux trapping and emulating them
> hasn't been around since forever.
> Linux v4.11 added `HWCAP_CPUID`, and if this hwcap is enabled, the
> trapping is supported. (I'm not sure if there are kernels past 4.11 that
> don't have it set, though.) I do run wine on arm64 on a couple of old
> devboards that run Linux 4.4 kernels - although I haven't updated my
> version of Wine on them for quite a while...
> Anyway, ideally, we'd check `getauxval(AT_HWCAP) & HWCAP_CPUID` before
> going ahead and trying to read these registers - even if few users today
> really run older kernels.
Ah yep, realised this earlier but forgot to address, will Mr a fix
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6225#note_81553
Martin Storsjö (@mstorsjo) commented about dlls/ntdll/unix/system.c:
> + snprintf( path_buf, sizeof(path_buf), midr_el1_path, logical_thread_id );
> + if ((fp = fopen( path_buf, "r" )))
> + {
> + fscanf( fp, "%lx", &value );
> + fclose( fp );
> + regs[regidx++] = (struct smbios_wine_id_reg_value_arm64){ 0x4000, value };
> + }
> +
> +#define STR(a) #a
> +#define READ_ID_REG(reg_id) \
> + /* mrs x0, #reg_id */ \
> + __asm__ __volatile__( ".inst " STR(0xd5300000 | reg_id << 5) "\n\t" \
> + "mov %0, x0" : "=r"(value) :: "x0" ); \
> + regs[regidx++] = (struct smbios_wine_id_reg_value_arm64){ reg_id, value };
> +
> + /* Linux traps reads to these ID registers and emulates them. They do not vary across cores,
FYI, this isn't universally the case - Linux trapping and emulating them hasn't been around since forever.
Linux v4.11 added `HWCAP_CPUID`, and if this hwcap is enabled, the trapping is supported. (I'm not sure if there are kernels past 4.11 that don't have it set, though.) I do run wine on arm64 on a couple of old devboards that run Linux 4.4 kernels - although I haven't updated my version of Wine on them for quite a while...
Anyway, ideally, we'd check `getauxval(AT_HWCAP) & HWCAP_CPUID` before going ahead and trying to read these registers - even if few users today really run older kernels.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6225#note_81475