This is obviously questionable, as it requires reaching into Wine internals in
tests (beyond simply detecting whether Wine is in use).
However, we are at a point where, for d3d10 and above, the Vulkan renderer works
well enough in general to see real use [in fact, in my experience it usually
works better than the GL renderer], and at this point I think avoiding
regressions is quite important. It is currently difficult to run tests with it
when the results contain so much noise, and I think we need to solve this
problem, by actually marking which tests work on each backend.
We could in theory expose the renderer through some adapter string, but I
believe in the past applications have been sensitive about the contents of
adapter strings.
Fixing either renderer to reach and maintain parity is not feasible. The GL
renderer is not going away, but regrettably GL as an API is abandoned by
Khronos, and important features we need in order to implement some Direct3D
features will probably never be introduced into GL. Moreover, the amount of
effort that would be required to reach parity is not small, and itself would all
need to be verified manually.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3232
Required for !1857 to not break when comctl32 version 6 isn't requested by application (in particular, found this in [qapitrace](https://github.com/apitrace/apitrace)).
Manifest resource id and assembly identity name match with Windows.
For isolation purposes, activation context is disabled while emitting events.
--
v13: comdlg32: Enable visual styles when showing IFileDialog.
comdlg32: Return E_UNEXPECTED if IFileDialog is already shown.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2068
> With this implementation it should be relatively easy to present with whatever API is available, though I don't really know how the options you mention work, so maybe there is some additional complexity I'm not aware of.
Sounds great :-)
The "fullscreen window styles" problem (and one of the older d3d contributors can correct me on this) is basically that some applications use ddraw (and other versions?) to present to a fullscreen window, expecting the presented area to cover the whole screen, but wgl (and Vulkan) swapchains only present to the client rect. We currently get around this by changing the window styles to remove all the nonclient decorations, but that breaks some applications too. What we want is a way to present to the actual window, and part of the idea is that using D3DKMTPresent() is the architecturally correct way to do this.
I don't quite know what the concerns are for dcomposition either. Zhiyi was looking at that and ran into a wall, but he probably can at least describe the problem in greater detail.
There are also some thoughts about using D3DKMTPresent() to deal more efficiently with some cases where we currently have to do a GDI blit. I'm fuzzy on these details though; again Henri can explain it better.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3165#note_37677
Sub / Function can be on one line, but only if there's brackets.
```
| Storage_opt tFUNCTION Identifier ArgumentsDecl BodyStatements tEND tFUNCTION
```
This leads to sometimes to `link_statements` being called with `head` being NULL, probably because now the `:` can be parsed as `Statement` in `BodyStatements`.
Also note that this introduces another shift/reduce conflict, could be related, but I don't understand it well enough. Feedback would be appreciated, I'm still learning bison.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3206
Required for !1857 to not break when comctl32 version 6 isn't requested by application (in particular, found this in [qapitrace](https://github.com/apitrace/apitrace)).
Manifest resource id and assembly identity name match with Windows.
For isolation purposes, activation context is disabled while emitting events.
--
v12: comdlg32: Enable visual styles when showing IFileDialog.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2068
On Fri Jun 30 17:01:00 2023 +0000, Zebediah Figura wrote:
> So in isolation I think the solution proposed by this patch set is fine,
> and even looks prettiest. *But* what I remember from that discussion—and
> Henri will undoubtedly be able to express this more eloquently—is that
> the concern is
> (a) we might want to do something more complicated than just
> vkQueuePresent()—cf. the issues about fullscreen window styles /
> presenting to the client rect. I'm not sure but this might also turn out
> to be an issue for DirectComposition.
> (b) we might want to plumb presentation through D3DKMTPresent() [which
> may be necessary to achieve the above], and it will probably not be
> possible to do any vkd3d calls from the Unix side.
I pushed a new implementation incorporating the changes you're suggesting, and honestly I don't dislike it: https://gitlab.winehq.org/giomasce/wine/-/commits/chianti (only the last three commits changed in a meaningful way; or maybe at all). With this implementation it should be relatively easy to present with whatever API is available, though I don't really know how the options you mention work, so maybe there is some additional complexity I'm not aware of.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3165#note_37623
In a declaration with multiple variables, the variables must be created
before the initializer of the next variable is parsed. This is required
for initializers such as:
```
float a = 1, b = a, c = b + 1;
```
The solution is to parse the type information in the same rule as the first variable ('a' in this case) so that it can be declared before the parser reaches the initializer for the following variables.
To initialize the following variables, the type information is passed along from the first variable's struct parse_variable_def to the next and so on.
---
Solves https://bugs.winehq.org/show_bug.cgi?id=54484, pointed out by @nsivov.
--
v3: vkd3d-shader/hlsl: Declare vars individually when parsing struct declarations.
vkd3d-shader/hlsl: Declare vars individually when parsing regular declarations.
vkd3d-shader/hlsl: Split declare_vars().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/250
These replace Wine's 14 copies of debugstr_hstring.
--
v3: wintypes: Replace debugstr_hstring with debugstr_h.
windows.ui: Replace debugstr_hstring with debugstr_h.
windows.system.profile.systemmanufacturers: Replace debugstr_hstring with debugstr_h.
windows.perception.stub: Replace debugstr_hstring with debugstr_h.
windows.networking: Replace debugstr_hstring with debugstr_h.
windows.media: Replace debugstr_hstring with debugstr_h.
windows.media.speech/tests: Replace debugstr_hstring with debugstr_h.
windows.media.speech: Replace debugstr_hstring with debugstr_h.
windows.globalization: Replace debugstr_hstring with debugstr_h.
windows.devices.enumeration: Replace debugstr_hstring with debugstr_h.
threadpoolwinrt: Replace debugstr_hstring with debugstr_h.
graphicscapture: Replace debugstr_hstring with debugstr_h.
cryptowinrt: Replace debugstr_hstring with debugstr_h.
combase: Replace debugstr_hstring with debugstr_h.
include: Introduce wine_dbgstr_h and debugstr_h.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3157
On Sun Jul 2 20:51:00 2023 +0000, Alex Henrie wrote:
> atlbase.h, atlcom.h, and atlwin.h are also C++-only in Windows, but Wine
> allows them to be used in C and uses them in its own C code. I assumed
> that the same logic would apply to atlconv.h, but if that doesn't work
> then we may want to introduce a new helper in include/wine.
We have the other headers but we use them only for the ATL implementation. They are not something we'd want to use globally.
As for a new include/wine helper, there doesn't seem to be enough usage of that function to justify it.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3191#note_37561
On Sun Jul 2 20:29:53 2023 +0000, Alexandre Julliard wrote:
> A2BSTR is a C++ only macro, it's not something we'd want to use as a
> standard replacement.
atlbase.h, atlcom.h, and atlwin.h are also C++-only in Windows, but Wine allows them to be used in C and uses them in its own C code. I assumed that the same logic would apply to atlconv.h, but if that doesn't work then we may want to introduce a new helper in include/wine.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3191#note_37559
On Sun Jul 2 20:14:43 2023 +0000, Alex Henrie wrote:
> @mstefani Thanks for the feedback. Would you be willing to remove your
> downvote now that the scope of this MR has been reduced?
Sorry, forgot about that
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3191#note_37557
On Sun Jul 2 17:27:26 2023 +0000, Michael Stefaniuc wrote:
> My comment was referring to the tests where we convert ascii string literals.
> The two left commits seem fine though as those don't just convert ascii
> string literals in the code.
> But I had just a quick look at them.
@mstefani Thanks for the feedback. Would you be willing to remove your downvote now that the scope of this MR has been reduced?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3191#note_37554
On Sat Jul 1 21:08:02 2023 +0000, Alex Henrie wrote:
> I have dropped the commits that touched tests from this MR. @mstefani do
> you see any better alternative than to replace the custom helpers in
> oleaut32 and shlwapi with the helper from the Windows API?
My comment was referring to the tests where we convert ascii string literals.
The two left commits seem fine though as those don't just convert ascii string literals in the code.
But I had just a quick look at them.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3191#note_37553
```
On Margate Sands.
I can connect
Nothing with nothing.
```
--
v3: vkd3d-shader/d3dbc: Scan for the maximum temporary register index.
vkd3d-shader: Record a global temporary count per sm4 shader.
vkd3d-shader/dxbc: Remove redundant zero-initialization of the vkd3d_shader_desc structure.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/255
4.18+ Linux kernels remove support for IPX but keep SOL_IPX defined, which
causes compilation errors as wine unconditionally uses IPX structures if
this is the case. Instead check for IPX_MTU to determine IPX support as it is
defined within the ipx.h header itself.
--
v2: {server, ws2_32, ntdll}: Avoid using SOL_IPX to detect whether IPX is supported
https://gitlab.winehq.org/wine/wine/-/merge_requests/2965
On Windows, `sendto()` ignores its destination parameters when provided with a connection-based socket (currently only SOCK_STREAM), even if they contain invalid data. This patch implements this behavior.
--
v5: ws2_32/tests: Add test for sendto() and recvfrom() on TCP sockets.
ntdll/unix: Skip address conversion for SOCK_STREAM sockets in try_send().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3186
Later patches are on https://gitlab.winehq.org/giomasce/wine/-/commits/chianti, though they still require some cleanup and cosmetic changes.
Currently the D3D12 swapchain accesses the low level Vulkan queue backing a vkd3d `ID3D12CommandQueue` using the `vkd3d_acquire_vk_queue()` call in order to submit frames for presentation. This causes a number of bugs because `vkd3d_acquire_vk_queue()` lets the caller submit to the Vulkan queue even if some operations are enqueued in the vkd3d internal op queue, which can lead to a frame being presented even if drawing work on it isn't finished (and not even queued, from the viewpoint of Vulkan!).
In order to fix this, I propose to introduce to add a few calls to vkd3d (currently [in this branch](https://gitlab.winehq.org/giomasce/vkd3d/-/commits/mongibello)), to allow the caller to enqueue calls to `vkQueueSubmit()` and `vkQueuePresentKHR()` through the vkd3d internal queue. The D3D12 swapchain would then use this new API instead of directly calling `vkQueueSubmit()` and `vkQueuePresentKHR()` as it does now. Eventually a similar call for `vkQueueWaitIdle()` should be added too. [That's already implemented in vkd3d](https://gitlab.winehq.org/giomasce/vkd3d/-/commit/b5ce799dbaf8c0fc13…, but not used yet in DXGI.
These changes also require introducing a worker thread for each D3D12 swapchain. The worker thread owns the Vulkan (backend) resources associated to the swapchain. Swapchain methods `Present()` and `ResizeBuffers()` do little more than pushing operations to a queue consumed by the worker thread. In this way the swapchain can immediately return on the calling thread, and the worker thread can wait on the operations submitted to the vkd3d queue, ensuring they're executed in the right order without fearing deadlocks. Notice that both `Present()` and `ResizeBuffers()` currently wait on a number of conditions (the availability of a swapchain image, its associated fence, device idleness when destroying Vulkan resources), and even if they shouldn't deadlock there could be a performance impact on the thread calling them. Since this is not a specific design objective, I didn't do any measurement, but hopefully the effect is at least nonnegative.
I considered (and partially implement) some alternative designs, but found them ultimately less satisfying:
* Just implement a generic callback in vkd3d ([in this way](https://gitlab.winehq.org/giomasce/vkd3d/-/commit/ad51ee2ad9597f275603…), that is queued and called with a `VkQueue` argument when dequeued. This is somewhat nicer for the vkd3d public interface, because only one call must be exposed (the one that enqueues a callback); however, DXGI would have to perform waits in the callbacks, which is a great recipe for deadlocks and for making performance harder to measure and debug.
* Use an event-based synchronization, but without a worker thread. Unfortunately that means that the swapchain can only make progress when called by the client. If for some reason a call to `Present()` must wait in the vkd3d internal queue and the client doesn't call the swapchain for some time, the frame presentation could be excessively delayed.
Patches in this MR don't implement those changes yet, but prepare the ground with some tests and light refactoring.
--
v2: dxgi: Split D3D12/Vulkan resource creation and destruction.
dxgi: Pass a VkImage to d3d12_swapchain_queue_present().
dxgi: Free the frontend images memory only once.
dxgi: Consider vk_format a frontend field.
dxgi/tests: Test that the present count is updated when Present() is called.
dxgi/tests: Test that the back buffer index is updated when Present() is called.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3165
`getpeername()` is currently handled in ntdll. This merge request changes ntdll to forward `getpeername()` to wineserver. The implementation utilises new `peer_addr` and `peer_addr_len` fields in wineserver's `struct sock`.
This fixes multiple `todo_wine`s in `ws2_32/tests` and allows for more accurate peer names to be provided in case the address the socket is bound to on the Unix side does not match what `bind()` was called with on the Windows side.
*This merge request was originally intended to be included in !2786 (Add support for AF_UNIX sockets) but was split into its own merge request because this is not an insignificant change.*
--
v9: ws2_32/tests: Remove todo_wine from now-successful tests.
server: Move getpeername() implementation from ntdll/unix.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3074
gnutls now may fail signature verification for the old hash algorithms which are considered insecure (e. g., md5). The test added in the patch fails on Fedora 38 without the flag.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3203
Fixes Age of Empire 2 failing to start due to WinVerifyTrust failing to successfully verify game files' signatures which are signed with ECC key.
I added a test in patch 1 to show that ECC certificate signature raw data indeed has bytes reversed (unlike the signature in messages). The existing code appears to be correct but removing this reversal wasn't resulting in test failures.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3201
Initialize the calendars variable after checking if locale is NULL before using it to avoid NULL
pointer references. Fix a Excel 2016 crash when formatting dates with the custom format 'ddd'.
--
v4: kernelbase: Check if locale is NULL before using it in Internal_EnumDateFormats().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3190
On Windows, `sendto()` ignores its destination parameters when provided with a connection-based socket (currently only SOCK_STREAM), even if they contain invalid data. This patch implements this behavior.
--
v4: ws2_32/tests: Add test for sendto() and recvfrom() on TCP sockets.
ntdll/unix: Skip address conversion for TCP sockets in try_send().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3186
Initialize the calendars variable after checking if locale is NULL before using it to avoid NULL
pointer references. Fix a Excel 2016 crash when formatting dates with the custom format 'ddd'.
--
v3: kernelbase: Check if locale is NULL before using it in Internal_EnumDateFormats().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3190
Initialize the calendars variable after checking if locale is NULL before using it to avoid NULL
pointer references. Fix a Excel 2016 crash when formatting dates with the custom format 'ddd'.
--
v2: kernelbase: Check if locale is NULL before using it in Internal_EnumDateFormats().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3190
--
v2: vkd3d-shader/hlsl: Free the "iter" block pointer on success in create_loop().
vkd3d-shader/hlsl: Return a hlsl_block from the "expr_statement" and "expr" rules.
vkd3d-shader/hlsl: Return a hlsl_block from the "jump_statement" rule.
vkd3d-shader/hlsl: Return a hlsl_block from the "selection_statement" rule.
vkd3d-shader/hlsl: Return a hlsl_block from the "loop_statement" rule.
vkd3d-shader/hlsl: Return a hlsl_block from the "statement" rule.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/258
Required for !1857 to not break when comctl32 version 6 isn't requested by application (in particular, found this in [qapitrace](https://github.com/apitrace/apitrace)).
Manifest resource id and assembly identity name match with Windows.
For isolation purposes, activation context is disabled while emitting events.
--
v11: comdlg32: Enable visual styles when showing IFileDialog.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2068
This fixes an issue I ran into in UI Automation using an interface proxy marshaled with `MSHCTX_INPROC`. `CoUnmarshalInterface` always passes `MSHCTX_LOCAL` when the standard marshaler, regardless of what was passed to `CoMarshalInterface`.
When passing an interface that uses the free threaded marshaler as an argument to a method on the proxy retrieved from `CoUnmarshalInterface`, it passes `MSHCTX_LOCAL` when trying to marshal, which the results in the free threaded marshaler trying to create a proxy/stub which fails.
--
v2: combase: Use correct destination context in CoUnmarshalInterface when using the standard marshaler.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3198