Here are 5 more patches on top of !4624, mostly along the same lines. I realize it's super late, no need to rush reviewing :slight_smile:
--
v2: d3d9/tests: Test creating a texture on a NULL HWND device.
d3d9/tests: Don't create a vertex shader in test_desktop_window() when unsupported.
wined3d: Conditionally allow sRGB writes with the 'none' shader backend.
wined3d: Conditionally support WINED3D_FRAGMENT_CAP_SRGB_WRITE on the ffp fragment pipe.
d3d9/tests: Skip test_sample_attached_rendertarget() without pixel shaders support.
wined3d: Don't override texture parameters for COND_NP2 on multisample textures.
wined3d: Don't skip FFP projection transform update.
d3d9: Don't do instanced draws in DrawPrimitive() and DrawPrimitiveUP().
wined3d: Rename WINED3DUSAGE_PRIVATE to WINED3DUSAGE_CS.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4652
--
v6: win32u: Introduce a new add_virtual_modes helper.
winex11: Let win32u decide when to force update the display cache.
win32u: Don't force refresh the display cache on thread desktop change.
winex11: Report all sources as detached in virtual desktop mode.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5422
Growtopia shows a popup when this function call fails, faking success gets rid of it. Unreal Editor also prints a warning message that is silenced through this change.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5530
Previously, `SetupDiGetINFClassW()` read INF files
with `GetPrivateProfileString()`, which does not substitute %strkey%
tokens.
This caused device installation to fail for devices which had driver
INF files using %strkey% tokens in Version section.
An example of such device is Vernier LabQuest Mini (08f7:0008) for
which Vernier's LoggerPro application includes a driver.
The INF file in question adds a new device setup class and has
following entries in Version section:
```
Class = %ClassName%
ClassGuid = %DeviceClassGUID%
```
Strings section includes following entries:
```
DeviceClassGUID = "{6B8429BF-10AD-4b66-9FBA-2FE72B891721}"
ClassName = "VST_WinUSB"
```
Previously, when LoggerPro was installed and LabQuest Mini was
hotplugged, device installation failed with the following error:
```
fixme:setupapi:SetupDiGetINFClassW failed to convert "L"%DeviceClassGUID"" into a guid
```
This caused GUID_NULL to be used and Class was not set to the registry
for the device.
With this commit, correct class GUID and names are set to the device
registry entry.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56579
--
v4: setupapi: use INF parser to read class GUID and class name
setupapi/tests: add tests for reading INF class with %strkey% tokens
https://gitlab.winehq.org/wine/wine/-/merge_requests/5519
--
v11: explorer: Restore display settings on process exit.
winex11.drv: Process RRNotify events in xrandr14_get_id.
user32/tests: Test that display settings are restored on process exit.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5060
--
v3: win32u: Move host surface destruction out of the drivers.
win32u: Pass HWND directly to vulkan surface creation driver callback.
win32u: Rename vulkan surface creation/destroy driver callbacks.
winevulkan: Pass win32u surface wrappers for each vkQueuePresent swapchain.
win32u: Introduce a new VkSurfaceKHR wrapping structure.
win32u: Introduce a distinct vulkan interface between win32u and the user drivers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5491
Windows 10 [received support](https://devblogs.microsoft.com/commandline/af_unix-comes-to-window… for AF_UNIX sockets in Insider Build 17063. This merge request adds basic support for AF_UNIX sockets to ws2_32 and wineserver.
Of particular note is the difficulty in handling `sun_path`. Most of the functions that allow for translating Windows paths to Unix paths are not accessible from ws2_32. I considered the following options:
* Pass the Windows path to wineserver and do the conversion there.
* This is, as far as I can tell, not possible without major rearchitecting. wineserver does not have functions to translate Windows paths to Unix paths, for obvious reasons.
* Obtain the current working directory of the requesting process and temporarily change directories to there.
* This only handles relative paths and fails for absolute paths, UNC paths, etc.
* Conditionally change directories based on whether the path is relative or not.
* This is error-prone and wineserver does not have the requisite functions to do this cleanly.
I ultimately decided to pass the translated Unix path to wineserver, which changes directories to `dirname(path)`. It then provides `bind` and `connect` with `basename(path)`. This is not threadsafe, but wineserver is not (currently) multithreaded.
Abstract sockets are not fully supported by this patch, matching the behavior of Windows.
--
v66: ws2_32/tests: Add test for AF_UNIX sockets.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
ws2_32: Add support for AF_UNIX sockets.
ws2_32: Add afunix.h header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786
--
v2: winex11: Remove now unnecessary surface wrapper struct.
win32u: Move thread detach from winex11.
win32u: Introduce a per-window vulkan surface list.
winewayland: Get rid of the now unnecessary surface wrapper.
win32u: Return the host surface directly from vulkan_surface_create.
win32u: Move host surface destruction out of the drivers.
win32u: Pass HWND directly to vulkan surface creation driver callback.
win32u: Rename vulkan surface creation/destroy driver callbacks.
winevulkan: Pass win32u surface wrappers for each vkQueuePresent swapchain.
win32u: Introduce a new VkSurfaceKHR wrapping structure.
win32u: Introduce a distinct vulkan interface between win32u and the user drivers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5491
Previously, `SetupDiGetINFClassW()` read INF files
with `GetPrivateProfileString()`, which does not substitute %strkey%
tokens.
This caused device installation to fail for devices which had driver
INF files using %strkey% tokens in Version section.
An example of such device is Vernier LabQuest Mini (08f7:0008) for
which Vernier's LoggerPro application includes a driver.
The INF file in question adds a new device setup class and has
following entries in Version section:
```
Class = %ClassName%
ClassGuid = %DeviceClassGUID%
```
Strings section includes following entries:
```
DeviceClassGUID = "{6B8429BF-10AD-4b66-9FBA-2FE72B891721}"
ClassName = "VST_WinUSB"
```
Previously, when LoggerPro was installed and LabQuest Mini was
hotplugged, device installation failed with the following error:
```
fixme:setupapi:SetupDiGetINFClassW failed to convert "L"%DeviceClassGUID"" into a guid
```
This caused GUID_NULL to be used and Class was not set to the registry
for the device.
With this commit, correct class GUID and names are set to the device
registry entry.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56579
--
v3: setupapi: use INF parser to read class GUID and class name
setupapi/tests: add tests for reading INF class with %strkey% tokens
https://gitlab.winehq.org/wine/wine/-/merge_requests/5519
--
v4: mfreadwrite/reader: Pass the device manager to the stream transforms.
winegstreamer/video_processor: Implement D3D awareness.
mf/tests: Test video processor D3D11 awareness.
mfreadwrite/tests: Add some source reader D3D11 awareness tests.
mfreadwrite/reader: Avoid leaking the stream transform service MFT.
mfreadwrite/tests: Shutdown the test stream event queues on source shutdown.
mfreadwrite/tests: Avoid using MFCreateMediaBufferFromMediaType.
mfreadwrite/tests: Do not accept MFVideoFormat_RGB32 in the test transform.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5459
On Wed Apr 24 15:30:39 2024 +0000, Hans Leidekker wrote:
> The entry itself must skipped. The hash should be the same whether the
> image is signed or not.
right, but this means that you never include in the hash what's after the content of the security directory?
(and another nitpick, not sure it does matter so much for real images, but it should be checked against nth->OptionalHeader.NumberOfRvaAndSizes that security header in present)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5516#note_68711
As an intermediate step on the way to !5388, I wanted to focus on the infrastructure that will allow us to pass pixel format information from the driver to the PE side. This MR introduces the mechanism to perform this information exchange and uses it to implement `wglDescribePixelFormat` on the PE side. In the current RFC state this MR:
1. Introduces `p_get_pixel_format` driver API to allow drivers to provide pixel format information.
2. Implements `wglDescribePixelFormat` on the PE side using the pixel format information. If the driver doesn't implement `p_get_pixel_format` we fall back to the `wglDescribePixelFormat` driver implementation (temporary measure until all drivers are updated).
3. Caches pixel format information in `NtCurrentTeb()->glReserved1[]`.
4. Implements `p_get_pixel_format` API and removes the custom `wglDescribePixelFormat` for winewayland.
At this point would like to get some more feedback about this approach and the technical details. If the direction seems promising, here are the next steps to get to a final MR:
1. Implement `p_get_pixel_format` for winex11, winemac and dibdrv and remove their custom `wglDescribePixelFormat` implementations.
2. Remove the `wglDescribePixelFormat` driver API.
Thanks!
--
v3: winex11.drv: Remove unnecessary parameter from describe_pixel_format.
winex11.drv: Enable wglDescribePixelFormat through p_get_pixel_formats.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5517
This avoids one case of spurious wakeup of WaitOnAddress (which could be triggered by prior race on consequent WakeAddressAll and a thread trying to wake on that, leaving the waking thread in an alerted state). And fixes Resident Evil games randomly crashing due to unhandled spurious SleepConditionVariableCS wakeups.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3929
Valgrind support requires a fork, which I've published to https://gitlab.winehq.org/rbernon/valgrind. The fork implements loading DWARF debug info from PE files, instead of the old and broken upstream PDB support. I've tried to upstream these changes a long time ago but didn't receive any feedback.
I think we could maybe consider keeping a fork, which I'm happy to maintain, as the changes aren't too large. We may want to investigate adding 32-on-64 support, which may require a bit more changes (to VEX specifically, because its amd64 guest doesn't support segment register manipulation).
The changes here are not all related to Valgrind, and I'll create separate MR for those which may make sense independently from Valgrind / GDB.
Also included is a suppression file to silent some annoying false positives, many of which are coming from the cross-stack accesses during syscalls, which are confusing Valgrind's stack heuristics. One can try this out with something like:
`WINELOADERNOEXEC=1 valgrind --suppressions=tools/valgrind.supp wine64/loader/wine64 wine64/programs/winecfg/winecfg.exe`
--
v14: ntdll: Avoid marking freed block header as undefined for valgrind.
ntdll: Force HEAP_TAIL_CHECKING_ENABLED flag with valgrind.
ntdll: Fix valgrind notifications from ntdll.so.
ntdll: Import valgrind headers for PE side ntdll.
DEBUG: ntdll: Don't use preloader when running on valgrind.
tools: Add gdbunwind.py script with a syscall unwinder.
ntdll: Maintain a PE module link map and expose it to GDB.
loader: Expose the standard debugging symbols for GDB.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1074