This is part XVIII of cmd engine rewrite.
It mainly focuses on setting the expected return code for
some builtin functions.
Includes also a fix for pipe inside a redirection (spotted by
the added tests).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6028
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v35: advapi32: Fake the SeLockMemoryPrivilege right in LsaEnumerateAccountRights.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
I was hoping that the new tests would provide evidence that RtlQueryRegistryValues uses RegGetValue to ensure that multi-strings are double-null-terminated. Instead the tests suggest that my hypothesis was wrong because RegGetValue only ensures single null termination, not double null termination. We should fix RegGetValue anyway for the sake of applications that expect it to null-terminate.
--
v9: kernelbase: Ensure null termination in RegGetValue[AW].
https://gitlab.winehq.org/wine/wine/-/merge_requests/5969
I was hoping that the new tests would provide evidence that RtlQueryRegistryValues uses RegGetValue to ensure that multi-strings are double-null-terminated. Instead the tests suggest that my hypothesis was wrong because RegGetValue only ensures single null termination, not double null termination. We should fix RegGetValue anyway for the sake of applications that expect it to null-terminate.
--
v8: kernelbase: Ensure null termination in RegGetValue[AW].
https://gitlab.winehq.org/wine/wine/-/merge_requests/5969
In my tests GetUserNameEx(NameDisplay) returns ERROR_NONE_MAPPED on Windows. It seems that the Windows machine needs to be joined to a Windows domain for this call to return something sensible. Do you have an application that depends this?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6002#note_75538