Zebediah Figura (@zfigura) commented about dlls/ws2_32/tests/sock.c:
> + ok(client != INVALID_SOCKET, "Failed to create second Unix socket: %lu\n",
> + GetLastError());
> +
> + clientThread = CreateThread(NULL, 0, test_afunix_client_connect_thread,
> + &(struct afunix_thread_param){ client, addr }, 0, NULL);
> + ok(clientThread != NULL, "CreateThread failed unexpectedly: %ld\n", GetLastError());
> + conn = accept(server, NULL, NULL);
> + ok(conn != INVALID_SOCKET, "Could not accept Unix socket connection: %lu\n",
> + GetLastError());
> +
> + ret = send(conn, serverMsg, sizeof(serverMsg), 0);
> + ok(ret == sizeof(serverMsg),
> + ret >= 0
> + ? "Incorrect amount of bytes written to Unix socket: %lu\n"
> + : "Could not send data over Unix socket: %lu\n",
> + ret >= 0 ? ret : GetLastError());
This is more complex than it needs to be; just write "Got return value %d", and either leave out the GetLastError() or add a second unconditional ok() for it.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_33113
Zebediah Figura (@zfigura) commented about dlls/ws2_32/tests/sock.c:
> +{
> + SOCKET server, client, conn;
> + const SOCKADDR_UN addr = { AF_UNIX, "test_afunix.sock" };
> + HANDLE clientThread;
> + const char serverMsg[] = "ws2_32/AF_UNIX socket test";
> + char clientBuf[sizeof(serverMsg)] = { 0 };
> + int ret;
> +
> + server = socket(AF_UNIX, SOCK_STREAM, 0);
> + ok(server != INVALID_SOCKET, "Could not create Unix socket: %lu\n",
> + GetLastError());
> +
> + ok(!bind(server, (SOCKADDR *)&addr, sizeof(SOCKADDR_UN)), "Could not bind Unix socket: %lu\n",
> + GetLastError());
> + ok(!listen(server, 1), "Could not listen on Unix socket: %lu\n",
> + GetLastError());
This kind of thing should generally be avoided, because GetLastError() won't necessarily run after the bind call. Just use two separate lines.
(There may be precedent for the bad code earlier in the file, but this file is pretty much full of bad code.)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_33112
Zebediah Figura (@zfigura) commented about dlls/ws2_32/tests/sock.c:
> + server = socket(AF_UNIX, SOCK_STREAM, 0);
> + ok(server != INVALID_SOCKET, "Could not create Unix socket: %lu\n",
> + GetLastError());
> +
> + ok(!bind(server, (SOCKADDR *)&addr, sizeof(SOCKADDR_UN)), "Could not bind Unix socket: %lu\n",
> + GetLastError());
> + ok(!listen(server, 1), "Could not listen on Unix socket: %lu\n",
> + GetLastError());
> +
> + client = socket(AF_UNIX, SOCK_STREAM, 0);
> + ok(client != INVALID_SOCKET, "Failed to create second Unix socket: %lu\n",
> + GetLastError());
> +
> + clientThread = CreateThread(NULL, 0, test_afunix_client_connect_thread,
> + &(struct afunix_thread_param){ client, addr }, 0, NULL);
> + ok(clientThread != NULL, "CreateThread failed unexpectedly: %ld\n", GetLastError());
The thread should be unnecessary, you can just use nonblocking I/O. It doesn't make a big difference, but it's probably easier to read without the thread.
If you do use the thread, you need to clean it up.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_33111
Adds the tray icons implementation based on org.kde.StatusNotifierItem interface usage. Does allow restarting StatusNotifierWatcher object, but will fallback to XEMBED or internal tray, if wine gets initialized when there is no StatusNotifierWatcher object registered.
--
v8: configure: fix winesni.drv not getting disabled
https://gitlab.winehq.org/wine/wine/-/merge_requests/2808
> Yes, Windows 10 v1803 ("April 2018 Update") was the first stable release of Windows to include this feature. `w1064v1507` fails, while `w1064v1809` passes.
We'll need to account for that in the tests, by failing with win_skip() when we can't create an AF_UNIX socket.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_33107
> @zfigura Can you elaborate on this? I don't see a clean way of doing this in ntdll without modifying `struct afd_bind_params`, `struct afd_connect_params`, etc. to add a field for the Unix path, since none of the other `sock_ioctl` cases add on varargs.
afd_bind_params et al. should already take a variable sized sockaddr, and the struct definitions in include/wine/afd.h mention that specifically. Am I missing something?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_33106
Stefan Dösinger (@stefan) commented about dlls/d3d8/tests/device.c:
> + BOOL has_texture;
> + DWORD filters[7];
> + }
> + tests[] =
> + {
> + {
> + TRUE,
> + {
> + D3DTEXF_NONE,
> + D3DTEXF_POINT,
> + D3DTEXF_LINEAR,
> + D3DTEXF_ANISOTROPIC,
> + D3DTEXF_FLATCUBIC,
> + D3DTEXF_GAUSSIANCUBIC,
> + 0xdeadbeef,
> + },
This feels awkward, the filter enum is the same in both cases.
I think the test[] array can be removed entirely, or one filter[] array be used for both. (At which point tests[] becomes a relatively pointless array with TRUE and FALSE in it).
I am not married to testing the value 0xdeadbeef, D3DTEXF_GAUSSIANCUBIC + 1 (6) would work just as well imo. That'd allow you to do for (mip = 0; mip <= D3DTEXF_GAUSSIANCUBIC + 1; ++mip).
To answer your question re texture formats that can't be filtered: To my knowledge that doesn't exist in d3d8, and there is no equivalent to D3DUSAGE_QUERY_FILTER in d3d8 - this value is used to check for filtering capability in IDirect3D9::CheckDeviceFormat.
Hypothetically, a volume texture could have different filter capabilities than a 2D texture. This seems to be the case even on my r200 - it supports mip filters (D3DPTFILTERCAPS_MIPFPOINT, D3DPTFILTERCAPS_MIPFLINEAR) for 2D, but not cube or 3D textures. I highly doubt that it complains about this in ValidateTexture though. I'll give it a try just in case.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2821#note_33093