In wined3d_swapchain_cleanup, before decrementing the reference counts of each of the back/front
buffers, we first set their swapchain to NULL, presumably to stop the current under-destruction
swapchain from being used through them. But there is an oversight.
When we call wined3d_texture_decref on the front_buffer, the back_buffers still have their
swapchains pointing to the swapchain being destroyed. In texture_resource_unload, we call
context_acquire(device, NULL, 0), note the NULL texture parameter here. When the texture parameter
is NULL, wined3d_context_gl_acquire (in turn called by context_acquire) will default to using the
first back buffer from the implicit swapchain of "device", which, as previously stated, has not had
their swapchain set to NULL yet. From here, we reach wined3d_context_gl_activate with a texture
whose swapchain is currently being destroyed. This swapchain is then assigned to "context_gl" here
before being freed, leaving a dangling pointer.
When this context_gl is acquired again later, we will try to access
context_gl->c.swapchain->win_handle, thus complete the use-after-free cycle.
This commit makes sure the swapchain pointer of ALL front and back buffers are set to NULL before
decrementing their reference counts.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58325
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8406
WaitCompletionPacket is a kernel object that, when associated with a target object and a completion object and when the target object is signaled, adds the completion information stored in itself to the completion object.
For React Native.
--
v3: ntdll: Implement NtCancelWaitCompletionPacket().
ntdll: Implement NtAssociateWaitCompletionPacket().
ntdll: Implement NtCreateWaitCompletionPacket().
ntdll/tests: Add NtCancelWaitCompletionPacket() tests.
ntdll/tests: Add NtAssociateWaitCompletionPacket() tests.
ntdll/tests: Add NtCreateWaitCompletionPacket() tests.
ntdll/tests: Add WaitCompletionPacket object tests.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6911
These patches make a test case attached to the bug https://bugs.winehq.org/show_bug.cgi?id=33190 work.
--
v8: win32u: NtGdiExtTextOutW() should translate x,y from logical to device units at the last step.
win32u: Fix device<->world width/height converters.
win32u: Use slightly more readable names for DP/LP converters.
win32u: Use correct helper for converting width to device units.
gdi32/tests: Add some tests for rotated font metrics.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5068
This format is used for video output with a depth of 10 bits per channel. Decoding at 10-bit quality is not currently supported, but this patch makes video playable.
--
v4: mfmediaengine: Support video output in format R10G10B10A2.
mfmediaengine: Rename media_engine_transfer_to_d3d11_texture() helper function.
mfmediaengine/tests: Test output to format R10G10B10A2 from H.264.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8531
A Wine user has requested the ability to interact with Unix symlinks from Win32
code.
While the generic functionality of NT reparse points is still not implemented
upstream, it will probably involve a completely different code path than this,
so there does not seem to me to be any point in waiting for that to be done
before submitting these patches.
This does not implement all the relevant functionality. FILE_OPEN_REPARSE_POINT
is now respected, but returns an fd with no fd->unix_fd. Thus far only file
disposition (i.e. deletion), renaming and hardlinking are implemented, and all
other operations return the no_fd_status, for which
STATUS_REPARSE_POINT_NOT_RESOLVED is arbitrarily chosen.
This is probably going to be controversial. As controversial patches tend to get
deferred forever, I'm going to at least try to pose some questions related to
concept and implementation which may be easier to answer.
* Do we want to expose Unix symlinks at all? This was requested by a Wine user,
and it does seem a strong argument that Wine, in general, supports some
measure of integration with the host, including exposing custom interfaces for
programs written to take advantage of it.
We also, currently, already expose Unix *directory* symlinks via
NtQueryAttributesFile(). We don't currently expose such file symlinks (and
this series does not change that particular point, but it would be done by
follow-up patches). In a sense we are expanding existing partial support.
On the other hand, Unix symlinks which are completely opaque can be useful,
and some downstream distributions (CrossOver and Proton) currently rely on
them to reduce disk space usage while keeping the application unaware of a
symlink (even if it were to use FILE_OPEN_REPARSE_POINT. Not that any
applications are currently known that would break if this were to change, and
in any case they could simply revert these patches.)
* Implementation-wise, is having unix_fd == -1 a non-starter? This can be true
of other real fds in some specific cases...
* It's also true that this current implementation suffers from some degree of
TOCTOU problems: because we only store the name and not the FD anymore, the
actual underlying object at that path can change. This would not be true on
Windows. Is this a problem?
* One alternate approach would be to use O_PATH (Linux, FreeBSD) and
O_SYMLINK (Mac). I don't see any equivalent flag for NetBSD or Solaris, so
we would probably just not be able to expose this functionality there.
Note that while the documentation seems to imply that O_PATH only stores the
path, manual testing shows that (at least on Linux) a fd opened with O_PATH
will remain pointing at the same *inode* even if it is moved or deleted. So
this would avoid the aforementioned TOCTOU problem.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8688