On Fri Aug 8 18:09:57 2025 +0000, Bernhard Übelacker wrote:
Above was directly after the big SP1 update. Now after having installed all updates from a wsus-offline folder from 2016 it still shows `Windows 7 Version 6.1 (Build 7601: Service pack 1)`. But now the output is much shorter and especially we enter the `Old structure layout.` path. (Below is the added trace line and below the output.)
win_skip("Old structure layout.\n"); + trace("XState xs_old->EnabledFeatures %#I64x.\n", xs_old->EnabledFeatures); return;
C:\temp> ntdll_test.exe virtual virtual.c:3318: system page size 0x1000 virtual.c:313: Tests skipped: NtAllocateVirtualMemoryEx() is missing virtual.c:722: Tests skipped: NtAllocateVirtualMemoryEx() is missing virtual.c:1692: Tests skipped: NtMapViewOfSectionEx() is not supported. virtual.c:2517: Tests skipped: no NtSetInformationVirtualMemory in ntdll virtual.c:2029: Tests skipped: Old structure layout. virtual.c:2030: XState xs_old->EnabledFeatures 0x3. virtual.c:2166: Tests skipped: RtlFindExportedRoutineByName not supported virtual.c:2749: Tests skipped: MemoryImageInformation not supported 0884:virtual: 1 tests executed (0 marked as todo, 0 as flaky, 0 failures), 0 skipped. 06f4:virtual: 2049 tests executed (0 marked as todo, 0 as flaky, 0 failures), 7 skipped.
So that means my output in the comment from two weeks ago is invalid as it used the wrong layout for Windows 7? And I guess this proves EnabledFeatures should have a value of 3 at this machine? Are we confident enough to say the patch of this merge request is right?
The offset (and I think format) of `XState` in `USER_SHARED_DATA` is different between Windows 7 SP1 and Win 8+ (see [Geoff Chappell](https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/ntexapi_x/...)), the "old structure layout" is the Win7SP1 offset. I'm not sure how to explain your SP1 pre-update results, maybe the check in the tests is not reliable (IMO it should really be checking the Windows version, not expecting 0 at the new offset).
I think the patch is partially correct (EnabledFeatures should be 3), but the rest of the XState structure needs to be populated. Those tests don't run on the old structure layout but if you run a newer Windows version I suspect they will fail (like the results I posted).
This is getting complicated, but I think the right path is to install a newer Windows version, fix the tests so they correctly handle the non-AVX case, then have Wine populate XState correctly for that case as well.