While the order that arguments are loaded by the kernel will never
change, some emulators may push argument data in a different
order which would cause a very large memset. The sys-v ABI doesn't
define a specific order for the information itself, it only does
so for the pointers.
This assertion ensures the order of the arguments is the same as
we expect from the Linux kernel.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8396
There seem to be a few special cases here, of which the main one is `DEVPKEY_DeviceInterface_Enabled`. This property key does not have an actual registry entry, but the value read by `SetupDiGetDeviceInterfacePropertyW` corresponds to whether the interface is enabled/linked or not. Likewise, the key cannot be written to either, with `SetupDiSetDeviceInterfacePropertyW` returning `ERROR_ACCESS DENIED`.
--
v6: ntoskrnl.exe/test: Add tests for SetupDiGetDeviceInterfacePropertyW with enabled interfaces.
setupapi: Implement SetupDiGetDeviceInterfacePropertyW.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8379
There seem to be a few special cases here, of which the main one is `DEVPKEY_DeviceInterface_Enabled`. This property key does not have an actual registry entry, but the value read by `SetupDiGetDeviceInterfacePropertyW` corresponds to whether the interface is enabled/linked or not. Likewise, the key cannot be written to either, with `SetupDiSetDeviceInterfacePropertyW` returning `ERROR_ACCESS DENIED`.
--
v5: ntoskrnl.exe/test: Add tests for SetupDiGetDeviceInterfacePropertyW with enabled interfaces.
setupapi: Implement SetupDiGetDeviceInterfacePropertyW.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8379
Improves behavior under Valgrind. Before:
```
==221683== Memcheck, a memory error detector
==221683== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==221683== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==221683== Command: /games/wine/wine cmd /c dir
==221683==
==221683== Memcheck, a memory error detector
==221683== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==221683== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==221683== Command: /games/wine/loader/wine-preloader /games/wine/loader/wine cmd /c dir
==221683==
==221683== Jump to the invalid address stated on the next line
==221683== at 0x109108: wld_mmap (in /games/wine/loader/wine-preloader)
==221683== by 0x109E43: wld_start (preloader.c:1445)
==221683== by 0x10902D: (below main) (in /games/wine/loader/wine-preloader)
==221683== Address 0x109108 is in the Text segment of /games/wine/loader/wine-preloader
==221683== at 0x109108: wld_mmap (in /games/wine/loader/wine-preloader)
==221683==
==221683==
==221683== Process terminating with default action of signal 11 (SIGSEGV)
==221683== Bad permissions for mapped region at address 0x109108
==221683== at 0x109108: wld_mmap (in /games/wine/loader/wine-preloader)
==221683== by 0x109E43: wld_start (preloader.c:1445)
==221683== by 0x10902D: (below main) (in /games/wine/loader/wine-preloader)
==221683==
==221683== HEAP SUMMARY:
==221683== in use at exit: 0 bytes in 0 blocks
==221683== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==221683==
==221683== All heap blocks were freed -- no leaks are possible
==221683==
==221683== For lists of detected and suppressed errors, rerun with: -s
==221683== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
```
After:
```
==221585== Memcheck, a memory error detector
==221585== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==221585== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==221585== Command: /games/wine/wine cmd /c dir
==221585==
==221585== Memcheck, a memory error detector
==221585== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==221585== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==221585== Command: /games/wine/loader/wine-preloader /games/wine/loader/wine cmd /c dir
==221585==
preloader: Warning: we got loaded into reserved range 0000000000010000-0000000000110000, ignoring reservation
preloader: Warning: failed to reserve range 0000000000110000-0000000068000000
==221585==
==221585== LOAD_PDB_DEBUGINFO: clreq: fd=7, avma=0x140000000, total_size=172032, bias=0x0
==221585== LOAD_PDB_DEBUGINFO: objname: /games/wine/programs/start/x86_64-windows/start.exe
==221585== LOAD_PDB_DEBUGINFO: Find PDB file: /tmp/valgrind_petmp221585_237cbd3c is empty
==221585== Warning: Missing or un-stat-able /games/wine/programs/start/x86_64-windows/start.pdb
==221585== LOAD_PDB_DEBUGINFO: missing: /games/wine/programs/start/x86_64-windows/start.pdb
==221585==
==221585== LOAD_PDB_DEBUGINFO: clreq: fd=7, avma=0x6fffffc00000, total_size=4083712, bias=0x6ffe8fc00000
==221585== LOAD_PDB_DEBUGINFO: objname: /games/wine/dlls/ntdll/x86_64-windows/ntdll.dll
==221585== LOAD_PDB_DEBUGINFO: Find PDB file: /tmp/valgrind_petmp221585_237cbd3c is empty
==221585== Warning: Missing or un-stat-able /games/wine/dlls/ntdll/x86_64-windows/ntdll.pdb
==221585== LOAD_PDB_DEBUGINFO: missing: /games/wine/dlls/ntdll/x86_64-windows/ntdll.pdb
0138:err:seh:segv_handler Got unexpected trap 0
vex amd64->IR: unhandled instruction bytes: 0x8E 0xD8 0x8E 0xC0 0x5B 0x5D 0x41 0x5C 0x41 0x5D
vex amd64->IR: REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR: VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=NONE
vex amd64->IR: PFX.66=0 PFX.F2=0 PFX.F3=0
==221585== valgrind: Unrecognised instruction at address 0x4e99e07.
==221585== at 0x4E99E07: leave_handler (signal_x86_64.c:876)
==221585== by 0x4E99E07: setup_raise_exception (signal_x86_64.c:1520)
==221585== by 0x4E99FD6: segv_handler (signal_x86_64.c:2101)
==221585== by 0x48B304F: ??? (in /usr/lib/x86_64-linux-gnu/libc.so.6)
==221585== by 0x6FFFFFC0FAAB: ??? (in /games/wine/dlls/ntdll/x86_64-windows/ntdll.dll)
==221585== Your program just tried to execute an instruction that Valgrind
==221585== did not recognise. There are two possible reasons for this.
==221585== 1. Your program has a bug and erroneously jumped to a non-code
==221585== location. If you are running Memcheck and you just saw a
==221585== warning about a bad jump, it's probably your program's fault.
==221585== 2. The instruction is legitimate but Valgrind doesn't handle it,
==221585== i.e. it's Valgrind's fault. If you think this is the case or
==221585== you are not sure, please let us know and we'll try to fix it.
==221585== Either way, Valgrind will now raise a SIGILL signal which will
==221585== probably kill your program.
0138:err:seh:segv_handler Got unexpected trap 0
0138:err:virtual:virtual_setup_exception nested exception on signal stack addr 0x4e99e07 stack 0x7ffceb30
==221585==
==221585== HEAP SUMMARY:
==221585== in use at exit: 11,149 bytes in 30 blocks
==221585== total heap usage: 161 allocs, 131 frees, 856,134 bytes allocated
==221585==
==221585== LEAK SUMMARY:
==221585== definitely lost: 25 bytes in 1 blocks
==221585== indirectly lost: 0 bytes in 0 blocks
==221585== possibly lost: 5,582 bytes in 1 blocks
==221585== still reachable: 5,542 bytes in 28 blocks
==221585== suppressed: 0 bytes in 0 blocks
==221585== Rerun with --leak-check=full to see details of leaked memory
==221585==
==221585== For lists of detected and suppressed errors, rerun with: -s
==221585== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
```
...honestly not much of an improvement, but at least it gets a little further. And it makes abundantly clear the current blocker is not on Wine's side. (Valgrind having Opinions on the address space is [a well](https://bugs.kde.org/show_bug.cgi?id=374963) known [issue](https://bugs.winehq.org/show_bug.cgi?id=47125).)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8393
This is an alternative location to filter out this environment variables, see merge request !8292 for details.
Doing this in winetest would have the advantage to protect all tests run by it, not just kernel32:process.
--
v3: gitlab: Remove name containing CI environment variables in windows tests.
gitlab: Derive the windows tests from a common .wine-test-windows.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8299
This is an alternative location to filter out this environment variables, see merge request !8292 for details.
Doing this in winetest would have the advantage to protect all tests run by it, not just kernel32:process.
--
v2: gitlab: Remove name containing CI environment variables in windows tests.
gitlab: Derive the windows tests from a common .wine-test-windows.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8299
Attached windows demo code and results run on windows as follows:
[main.cpp](/uploads/35cda6fb47c99ee464e6638653f052eb/main.cpp)
[ConsoleApplication1.exe](/uploads/8dd927ed1723a8483998ccdb990916fe/ConsoleApplication1.exe)

and after add implementation , the running results in Wine are consistent with those in Windows
Signed-off-by: chenjiangyi <chenjiangyi(a)uniontech.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8386