On Fri Aug 8 20:55:07 2025 +0000, Brendan Shanks wrote:
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.
I feared this would lead to installing another Windows ...
Following output is from this Intel T4500 equipped laptop running now "bare metal" `Windows 8.1 Version 6.3 (Build 9600)`: ``` C:\temp> ntdll_test.exe virtual virtual.c:3317: 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:2033: XState EnabledFeatures 0x3, EnabledSupervisorFeatures 0, EnabledVolatileFeatures 3. virtual.c:2043: Test failed: Got unexpected EnabledFeatures 3. virtual.c:2047: Test failed: Got unexpected Size 576. virtual.c:2062: Test failed: Got unexpected Features[2].Size 0, expected 256. virtual.c:2064: Test failed: Got unexpected Features[2].Offset 0, expected 576. virtual.c:2165: Tests skipped: RtlFindExportedRoutineByName not supported virtual.c:2748: Tests skipped: MemoryImageInformation not supported 0aa4:virtual: 1 tests executed (0 marked as todo, 0 as flaky, 0 failures), 0 skipped. 0804:virtual: 2433 tests executed (0 marked as todo, 0 as flaky, 4 failures), 5 skipped. ```