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.
--
v56: ws2_32/tests: Add test for AF_UNIX sockets fix.
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.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786
> You can't assume that the path is null-terminated.
I'm pretty sure I can assume `unix_path` is null-terminated. It's ultimately provided by `wine_nt_to_unix_file_name()` (`wine_get_unix_file_name()` doesn't modify it), with the line:
```c
if (*size > strlen(name)) strcpy( /* unix_path = */ nameA, name );
```
Multiple places across other DLLs assume `wine_get_unix_file_name()` provides a null-terminated string, passing its return value to e.g. `fprintf()` and `strstr()`.
> In fact it shouldn't be, you should use an explicit length instead.
Whether I `strlen()` here or when first getting this buffer from `wine_get_unix_file_name()` seems irrelevant to me; is there something I'm missing?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_46190
This clears up much of the todo list for mspatcha. GetFilePatchSignature* and NormalizeFileForPatchSignature have now been implemented in these changes.
These changes bring better support for things like the Adobe Acrobat installer without the need for things like the winetricks mspatcha.dll native dll override. Still needed is support for interleaved streams in the LZXD decompression logic, however this is a great start to better supporting software installers that use the Windows interface for creating and applying patches to files.
This is the beginning of the fixes required for bug 12501: https://bugs.winehq.org/show_bug.cgi?id=12501
--
v26: mspatcha: Use string comparison for section names
mspatcha: Use unaligned typedefs
mspatcha: Relocate PE/COFF image functions
mspatcha: Add support for 32-bit file image patch transforms
mspatcha: Add implementations for GetFilePatchSignature* routines
mspatcha: Add support for 32-bit file normalization
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870
--
v2: Release 1.9.
vkd3d-shader/d3dbc: Translate sm1 fragment outputs to system values.
vkd3d-shader/dxbc: Map sm4 fragment outputs to system values based on their name.
vkd3d-shader: Add definitions for more fragment output system values.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/356
On Thu Sep 21 09:50:20 2023 +0000, Petrichor Park wrote:
> Oh dear. Do I need to worry about the big scary warning at the top
> saying that my merge failed?
> I don't think I did this right.
No, you didn't. Don't stress too much over it, though, git is nice folk, but it's a well established fact that it's not one with whom it's immediately easy to make friends. Hoping to help, here is what I would do now:
```sh
git checkout master
git pull # Ensure that your master is up-to-date
git checkout impl-tangent
git reset --hard b54b3c60 # Recover your last known-good state of this branch (I got the commit hash from the MR history)
git log
git show # Check that's what you intend to submit
git rebase master # Magic is happening here! Basically your commit is replayed as if it was replayed on top of master
# Git will tell you there is a conflict: basically you added line `{"tan", ...},` in `hlsl.y` and, in the same place,
# Nikolay added line `{"tex1D", ...},` a few days ago (commit c5d680d141; how do I know? I used git blame)
# Solving this conflict is simple: both lines have to appear in the file, so edit the file and just remove
# the markers git added around the conflict; but they also have to be in alphabetic order, so perhaps you'll have to swap them
git add -u # This is probably not needed, because git will automatically detect you fixed the conflict; but if it doesn't happen that's how you add the changes to the index
git diff --cached # Check that the diff now looks correct
git rebase --continue # Tell git that the conflict is resolved and it can carry on with the rebase
git log
git show # Check again before force-pushing, one is never too sure
git push -f # The MR is now updated and the scary warning should go away
```
Please feel free to ask if I can help you further.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/321#note_46176