Ralf Habacker (@rhabacker) commented about dlls/ws2_32/socket.c:
> return -1;
> }
> params->unknown = 0;
> - memcpy( ¶ms->addr, addr, len );
> + if (addr->sa_family == AF_UNIX)
> + memset( ¶ms->addr, 0, len );
> + memcpy( ¶ms->addr, addr, bind_len );
> + if (unix_path)
Here a comment should be added, that in case of AF_UNIX sockets the unix path is appended as second string to `params->addr`.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650#note_104293
On Fri May 23 04:23:45 2025 +0000, Alexandre Julliard wrote:
> > There is probably some tiny DVD somewhere in the world that will still
> be misdetected, but I'm not sure that issuing SCSI commands to the drive
> to try to determine the disc type would be any more reliable.
> To support an app that is most likely going to issue DVD ioctls,
> checking by using a DVD ioctl seems preferable.
Linux has only three [DVD ioctls](https://docs.kernel.org/userspace-api/ioctl/cdrom.html): DVD_READ_STRUCT, DVD_WRITE_STRUCT, and DVD_AUTH. It has no blu-ray ioctls. Of the three DVD ioctls, only DVD_READ_STRUCT would be suitable for disc type detection.
DVD_READ_STRUCT can read five kinds of information: DVD_STRUCT_PHYSICAL, DVD_STRUCT_COPYRIGHT, DVD_STRUCT_DISCKEY, DVD_STRUCT_BCA, and DVD_STRUCT_MANUFACT. Of those five, only DVD_STRUCT_PHYSICAL would be suitable for disc type detection.
At least on my LG WH16NS40 drive, DVD_STRUCT_PHYSICAL succeeds when there is a DVD in the drive, but it fails when there is a CD or a blu-ray in the drive. That means that we could use DVD_STRUCT_PHYSICAL to accurately detect whether there is a DVD in the drive, but we would still need another way to detect blu-rays.
Is there another ioctl that you had in mind, or something else that I missed? Do you want to try DVD_STRUCT_PHYSICAL first and fall back to guessing based on the data size if it fails? Please let me know how to proceed.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7747#note_104292
Zhiyi Zhang (@zhiyi) commented about dlls/winex11.drv/window.c:
> return;
>
> xinerama_get_fullscreen_monitors( &data->rects.visible, monitors );
> + memcpy( data->desired_state.monitors, monitors, sizeof(monitors) );
> + if (!memcmp( old_monitors, monitors, sizeof(monitors) )) return; /* states are the same, nothing to update */
The reason why something like this didn't exist before is that after the monitor changes, the old Xinerama monitor index might be different than the new ones. For example, changing the secondary monitor from right to left and then making the secondary monitor primary using the host system's utilities. We can probably invalidate the old monitor Xinerama indices after a device change.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8123#note_104289
This consolidates the two separate `CGImage`s (`colorImage` and `shapeImage`) previously used in `WineContentView` into a single `IOSurface` that also holds the window mask information in its alpha channel now.
The alpha channel is now being updated in `macdrv_surface_flush`, whenever the shape changes (and stores that change for the next update, to also keep the front buffer in sync).
This reduces the delay from setting a `CGImage` to a layer from 50ms to about 1.5ms in the `IOSurface` case (also accounting for `vImageSelectChannels_ARGB8888` operation).
Based on a patch by @bshanks.
I am already putting it out for feedback, but I will so some more testing to see how the performance impact of this is and do more exhaustive testing with shaped windows.
Ideally the double buffer solution can be avoided as well... Also the `HBITMAP` for the windows is currently backed by a `CGDataProviderRef` and could also become an `IOSurface` I believe.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7938
1. For %fs/fsbase the patch follows the macOS logic with LDT descriptor registration and Linux with switching. One notable difference is that on 32->64 transition we set %fs to GSEL(GUFS32_SEL, SEL_UPL) before restoring fsbase, otherwise FreeBSD will just revert it by reloading the selector [at the first opportunity](https://github.com/freebsd/freebsd-src/blob/5673462af5330df207…. GSEL(GUFS32_SEL, SEL_UPL) is the default %fs value on FreeBSD and is special-cased to save/restore actual fsbase value to/from PCB.
2. I was told we could get rid of fsbase glitches in signal handlers by blocking signals with [sigfastblock(2)](https://man.freebsd.org/cgi/man.cgi?query=sigfastblock) between %fs reset to the default value and fsbase reset to pthread_teb. This is currently a part of internal API for libthr, which could be exposed as pthread_signal_block_np for Wine. I'm on the fence whether it's worth it.
3. I fully admit I have no idea what registers are worth preserving around fallback sysarch(AMD64_SET_FSBASE) syscalls and whether it's appropriate to push those registers to stack. ("Kernel" stack should be fine, I assume?) Syscalls definitely clobber r8-r11.
4. For %ss see https://lkml.org/lkml/2015/4/24/216. FreeBSD doesn't have a similar workaround in the kernel, so it goes into Wine.
--
v5: ntdll: Unbreak new wow64 mode on FreeBSD.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8073