Previously long URI/URLs (> 1024 characters) would cause a stack corruption and crash Wine. After this MR, Wine will no longer crash but the URL is not opened either primarily due to `SHELL_Argify` limitations.
--
v3: shell32: Increase timeout for long URLs
https://gitlab.winehq.org/wine/wine/-/merge_requests/2383
Using a dedicated exit jmpbuf and removing the need for assembly
routines.
When Wine handles an exception in unix code, we return to user mode by
jumping to the last syscall frame. This can leave some pthread cancel
cleanups registered, in the pthread internal linked list, and at the
same time later overwrite the stack frame they were registered for.
In the same way, jumping to the exit frame on thread exit or abort, can
also leave some cleanup handlers registered for invalid stack frames.
Depending on the implementation, calling pthread_exit will cause all the
registered pthread cleanup handlers to be called, possibly jumping back
to now overwritten stack frames and causing segmentation faults.
Exiting a pthread normally, by returning from its procedure, or calling
exit(0) for the main thread doesn't run pthread_exit and doesn't call
cleanup handlers, avoiding that situation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52213
### Additional note:
For robustness, we should probably try to execute these cleanup handlers
when unwinding the stack frames, as we would otherwise leave pthread
objects in a potential problematic state (like a mutex locked, etc).
It is however hard to do so when the handlers are registered from some C
code: pthread C implementation is done by calling some internal pthread
functions to register the handlers, and they aren't registered as
standard unwind handlers.
Only pthread_cancel and pthread_exit can unwind and call / unregister
the C handlers, but interrupting that procedure, for instance calling
setjmp / longjmp from withing our own handler isn't supported.
From C++ code, pthread cleanup handlers are registered through C++ class
constructors / destructors, and it would then be possible to partially
unwind and call them at the same time.
--
v10: ntdll: Remove now unnecessary arch-specific exit frame.
ntdll: Avoid calling pthread_exit from abort_thread.
ntdll: Avoid calling abort_thread from the signal stack.
ntdll: Use is_inside_syscall more consistently.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1088
--
v3: cryptui: Use CertNameToStr(CERT_NAME_STR_NO_QUOTING_FLAG) to disable quoting.
crypt32: Add support for CERT_NAME_STR_NO_QUOTING_FLAG to CertNameToStr().
crypt32/tests: Add some tests for quoted RDN values.
crypt32: Avoid truncating unicode chars.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3729
Rainbow 6 Siege and some other games require this. Type is printed in the FIXME to determine which type the application requires.
--
v2: gdi32: Add stub for D3DKMTQueryAdapterInfo.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3777
I marked this a draft because it may be a somewhat orthogonal step, but IRRC @giomasce suggested it.
While a deref's data type can be computed from the variable's data type
as long as the deref is still represented as a path (as we did with
hlsl_deref_get_type()), we need the deref.data_type field for when the
deref is represented as an offset.
While we could get rid of this deref.data_type in the future, if we manage to transform
the HLSL IR instructions directly to VSIR withot requiring lowering the
derefs to their offset representation, this would take a while.
So, this patch makes the deref.data_type field available during the
whole lifetime of the deref. Which makes deref.data_type easier to
understand (since it can be used anytime now) and we no longer have
to call hlsl_deref_get_type().
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/343
In clock_change_state() when a clock is running, a timer is removed from clock->timers. The same
timer is then used to create an async result, which will eventually calls present_clock_timer_callback_Invoke()
and removes the same timer.
--
v2: mf: Avoid a double free of presentation clock timers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3955
Fixes Starfield not being able to take photos in photo mode (due to failing to creating windowscodecs' image factory due to COM apartment being initialized). Turns out on Windows RoGetActivationFactory() initializes implicit MTA apartment when called from STA thread, and so after that called once COM is implicitly uninitialized for any (new) thread until COM is uninitialized in the thread which called RoGetActivationFactory (or that thread exited). This is not the case on Win8 (where the function was first introduced) but looks consistent after that.
--
v4: combase: Ensure MTA existence in RoGetActivationFactory().
combase/tests: Add tests for implicit MTA with RoGetActivationFactory().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3806
Windows gives this content special protection from being painted over, by some means that I have not investigated yet.
Emulate this protection for the trivial case of an InvalidateRect(...); call on the parent window.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3416
- Make it present some frames
- Make it check that the frames are from the new device, instead of checking TerminateDevice count; fixes https://bugs.winehq.org/show_bug.cgi?id=55649
- Make it check for and avoid some absurd crash on Windows
I tried everything I could think of, but Windows absolutely refuses to present a frame after changing the D3D device, instead choosing to return various absurd errors (segfaults, deadlocks, out of memory, etc). I suspect the VMR9 is haunted.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3970
This series:
- fixes a couple of issues in mach-o modules support
(getting information from system modules in wow setups,
machine information...)
- stops hiding information in some fields between dbghelp
and winedbg (using an extensible solution, where more
information can be shared in the future)
- display elf/mach-o in winedbg (previously mach-o was
reported as elf)
- display PE native vs builtin module information in winedbg
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3975
Rainbow 6 Siege and some other games require this. Type is printed in the FIXME to determine which type the application requires.
--
v8: gdi32: Add stub for D3DKMTQueryAdapterInfo.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3777
A TLS index is allocated for each device object. We could use a global TLS, but that would share caches for all devices. I'm not sure if that's a problem. One index per device means freed indices must be recycled, which requires a global mutex, but a global TLS index would also need a global mutex.
This currently leaks cache memory when a device is freed. To fix this, allocations must be tracked. A global cache is more difficult to free, which is not normally an issue, but it is when using valgrind.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/384
`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.*
--
v34: server: Move getpeername() implementation from ntdll/unix.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3074
--
v3: d3d10/effect: Add 'ceil' instruction for expressions.
d3d10/effect: Add 'dot' instruction support for expressions.
d3d10/effect: Add trigonometric instructions support for expressions.
d3d10/effect: Add support for shift instructions.
d3d10/effect: Add 'or' instruction support for expressions.
d3d10/effect: Add more integer instructions for expressions.
d3d10/effect: Add signed integer compare instructions for expressions.
d3d10/effect: Implement instructions used for signed integer division.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1684
As has been pointed out a couple of times, mainly by @zfigura, hlsl_type_get_regset() is not defined for structs. So it is responsibility of the programmer to ensure that the data type in question belongs to a single regset before calling that function.
Turns out that when we call this function we either have to handle the possibility of the type spanning across multiple regsets, or we want the regset of a single component or vector, so this MR replaces the calls to hlsl_type_get_regset() with either a for loop that goes through all the pertaining regsets, hlsl_type_get_component_offset(), or hlsl_type_get_regset().
hlsl_type_get_regset() is still needed in the implementation of these functions, so it is downgraded to a static function for hlsl.c instead of being completely removed.
The tests in 3/5 (structs with multiple register reservations) are to explain why it makes sense to iterate over the regsets in 4/5 even if we don't have a proper implementation for register reservations on structs that span across mutiple regsets yet.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/342
Implements asin, acos, atan, and atan2.
Also includes some tests in a new test file.
One possible problem here is that I'm not sure how to test what Microsoft's atan and atan2 outputs are in boundary cases like atan2(1, 0). I've made the test suites adhere with the calculator program I've been using (Qalculate, which I assume is using libc's atan2).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55154
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/364
---
I came across this in my attempts to implement nooverwrite maps based on
sysmem staging buffers when buffer storage is not available. My debug
modifications broke the fast path for update_sub_resource and the
wined3d_resource_wait() didn't do its job for the push constant buffers.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3979
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
--
v3: d3d10/effect: Add support for 'dot' instruction.
d3d10/effect: Add support for 'floor' instruction.
d3d10/effect: Add support for 'ceil' instruction.
d3d10/tests: Compact returned arrays checks.
d3d10/effect: Add support for 'buge'/'bult' instructions.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3987
vkd3d-shader/tpf.c:3810:39: warning: passing argument 2 of ‘sm4_register_from_node’ from incompatible pointer type [-Wincompatible-pointer-types]
vkd3d-shader/tpf.c:4750:59: warning: passing argument 3 of ‘sm4_register_from_deref’ from incompatible pointer type [-Wincompatible-pointer-types]
The other option is to change the parameter to a DWORD but this is a larger change.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/385
--
v3: ntdll: Add support for FILE_{RENAME,LINK}_POSIX_SEMANTICS.
ntdll: Factored out get_inode_open_sharing.
ntdll/test: Add tests for FILE_LINK_POSIX_SEMANTICS.
ntdll/test: Add tests for FILE_RENAME_POSIX_SEMANTICS.
ntdll: Add support for FILE_{RENAME,LINK}_IGNORE_READONLY_ATTRIBUTE.
server: Don't allow read-only files to be replaced by File{Rename,Link}Information{,Ex}.
ntdll/test: Add tests for FILE_LINK_IGNORE_READONLY_ATTRIBUTE.
ntdll/test: Add tests for FILE_RENAME_IGNORE_READONLY_ATTRIBUTE.
ntdll/test: Use FileDispositionInformationEx to delete files and directories.
ntdll: Initial implementation of FileLinkInformationEx.
ntdll: Initial implementation of FileRenameInformationEx.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3907
Resolves https://bugs.winehq.org/show_bug.cgi?id=9127 . (Some of the named programs in that issue may require additional currently-missing functionality, I didn't check; but if so, that's separate issues.)
Tested with
- winetest on Windows 7
- winetest on Windows 10
- winetest in Wine, of course
- microkiri https://bugs.winehq.org/show_bug.cgi?id=9127#c102
- Wagamama High Spec Trial Edition https://wagahigh.com/download_trial.php#normal (ダウンロード means download)
- Ninki Seiyuu no Tsukurikata Trial https://archive.org/details/sayou_trial
(WMV files in microkiri and Wagamama don't work, but that's separate issues. Also, they need the LC_ALL=ja_JP env, or they throw various goofy errors.)
--
v6: quartz/tests: Add tests for CLSID_CMpegVideoCodec.
quartz/tests: Add tests for new CLSID_MPEG1Splitter functionality.
winegstreamer: Improve and clean up some debug logs.
winegstreamer: Implement a little more of IAMStreamSelect in CLSID_MPEG1Splitter.
winegstreamer: Handle format changes better in Quartz.
winegstreamer: Implement CLSID_CMpegVideoCodec.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3938
Zhiyi Zhang (@zhiyi) commented about dlls/uxtheme/tests/system.c:
> + /* Call ShouldSystemUseDarkMode() and check for errors */
> + SetLastError(ERROR_SUCCESS); /* Clear error buffer so that we can detect if an error occurred. */
> + function_result = pShouldSystemUseDarkMode();
> + last_error = GetLastError();
> + ok(last_error == ERROR_SUCCESS, "ShouldSystemUseDarkMode failed (?) with error %ld.\n",
> + last_error);
> +
> + /* Expect same value as key */
> + ok(function_result == !system_uses_light_theme, "Expected value %d, got %d.\n",
> + !system_uses_light_theme, function_result);
> +
> + ls = RegDeleteValueA(hk, "AppsUseLightTheme");
> + ok(ls == 0, "RegDeleteValueA failed: %ld.\n", ls);
> +
> + /* Call ShouldSystemUseDarkMode() and check for errors with deleted value */
> + SetLastError(ERROR_SUCCESS); /* Clear error buffer so that we can detect if an error occurred. */
For the last error code. You can SetLastError(0xdeadbeef) before the call and check that the last error is set to ERROR_SUCCESS after the call. And then you set the last error code in the ShouldSystemUseDarkMode() implementation.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3959#note_47274
Zhiyi Zhang (@zhiyi) commented about dlls/uxtheme/system.c:
> UnregisterUserApiHook();
> return TRUE;
> }
> +
> +/**********************************************************************
> + * ShouldSystemUseDarkMode (UXTHEME.138)
> + *
> + * RETURNS
> + * Whether or not the system/app should use dark mode.
Shouldn't `system/app` be `system`? because there is a ShouldAppsUseDarkMode() as you said previously.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3959#note_47273
Zhiyi Zhang (@zhiyi) commented about dlls/uxtheme/system.c:
> UnregisterUserApiHook();
> return TRUE;
> }
> +
> +/**********************************************************************
> + * ShouldSystemUseDarkMode (UXTHEME.138)
> + *
> + * RETURNS
> + * Whether or not the system/app should use dark mode.
> + */
> +BOOL WINAPI ShouldSystemUseDarkMode(void)
> +{
> + DWORD system_uses_light_theme_size = sizeof(DWORD);
You can remove the system_uses_ prefix. These codes are in ShouldSystemUseDarkMode() so it's already known that it's for querying system settings.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3959#note_47272
Zhiyi Zhang (@zhiyi) commented about dlls/uxtheme/system.c:
> +/**********************************************************************
> + * ShouldSystemUseDarkMode (UXTHEME.138)
> + *
> + * RETURNS
> + * Whether or not the system/app should use dark mode.
> + */
> +BOOL WINAPI ShouldSystemUseDarkMode(void)
> +{
> + DWORD system_uses_light_theme_size = sizeof(DWORD);
> + /* Persists between calls, in windows it might look up some internal table. */
> + static DWORD system_uses_light_theme = TRUE;
> +
> + /* We don't necessarily care that this might fail because it doesn't affect
> + * system_uses_light_theme if it does.
> + */
> + RegGetValueA(HKEY_CURRENT_USER,
Please use RegGetValueW() instead so that we don't have to do ASCII/Unicode conversion every time this gets called.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3959#note_47271