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/tests/system.c:
> DestroyWindow(hwnd);
> }
>
> +static void test_ShouldSystemUseDarkMode(void)
I think these tests might be a bit too much. I like the initial version that uses RegGetValueA() and confirms the registry value is the opposite of the ShouldSystemUseDarkMode. With some checks for the last error code and I think that's enough. These newly added tests confirm caching for ShouldSystemUseDarkMode() and that's good. However, ShouldSystemUseDarkMode() still need to query the registry key so it's not that useful.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3959#note_47270
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
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:
> 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:
> +
> +/**********************************************************************
> + * 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.
> + */
While comments are nice to have, these are pretty obvious so I think you can ignore it.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3959#note_47269
On FreeBSD, using `environ` in a shared library linked with `-Wl,-z,defs` causes an undefined reference error:
```
gcc -m64 -o dlls/msv1_0/msv1_0.so -shared -Wl,-Bsymbolic -Wl,-soname,msv1_0.so -Wl,-z,defs dlls/msv1_0/unixlib.o dlls/ntdll/ntdll.so
/usr/local/bin/ld: dlls/msv1_0/unixlib.o: in function `ntlm_fork':
/usr/home/pip/wine/build64/../dlls/msv1_0/unixlib.c:206: undefined reference to `environ'
collect2: error: ld returned 1 exit status
*** Error code 1
```
This is unfortunately a common issue on FreeBSD, see:
- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263265
- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265008
- https://reviews.freebsd.org/D30842
Reported by Gerald Pfeifer.
--
v3: configure: Don't use -Wl,-z,defs if causes link errors with 'environ'.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3984
On FreeBSD, using `environ` in a shared library linked with `-Wl,-z,defs` causes an undefined reference error:
```
gcc -m64 -o dlls/msv1_0/msv1_0.so -shared -Wl,-Bsymbolic -Wl,-soname,msv1_0.so -Wl,-z,defs dlls/msv1_0/unixlib.o dlls/ntdll/ntdll.so
/usr/local/bin/ld: dlls/msv1_0/unixlib.o: in function `ntlm_fork':
/usr/home/pip/wine/build64/../dlls/msv1_0/unixlib.c:206: undefined reference to `environ'
collect2: error: ld returned 1 exit status
*** Error code 1
```
This is unfortunately a common issue on FreeBSD, see:
- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263265
- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265008
- https://reviews.freebsd.org/D30842
Reported by Gerald Pfeifer.
--
v2: configure: Don't link with -Wl,-z,defs on FreeBSD.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3984
This avoids stalling the pipeline when upstream nodes have not given enough samples for processing. If there are multiple upstream nodes, request samples in a round-robin fashion.
This fixes an issue where the intro audio of the game Airborne Kingdom stops playing after a few seconds.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2684
--
v2: uiautomationcore/tests: Add another test for IProxyProviderWinEventHandler child HWND scope checking.
uiautomationcore: Add support for raising events passed to our IProxyProviderWinEventSink interface.
uiautomationcore: Pass WinEvent data to IProxyProviderWinEventHandler::RespondToWinEvent.
uiautomationcore: Add support for marking the root IAccessible as known on non-root IAccessibles upon proxy provider creation.
uiautomationcore: Add support for ignoring ProviderOptions_UseComThreading when creating an HUIANODE.
uiautomationcore: Create HUIANODE for WinEvents that should invoke IProxyProviderWinEventHandler::RespondToWinEvent.
uiautomationcore: Check if we should try to invoke IProxyProviderWinEventHandler::RespondToWinEvent for registered UIA events.
uiautomationcore: Introduce uia_event_for_each function for iterating through registered events.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3956
I wanted to use ._xy element access to make it shorter, but that attempt was crushed by the reality - such indexing apparently compiles but does not produce correct element access loads. I'm going to update once this is fixed.
--
v7: vkd3d-shader/hlsl: Add determinant() function.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/329
On Mon Sep 25 07:27:07 2023 +0000, Rémi Bernon wrote:
> Fwiw this is not always the location of the executable, especially if it
> is located in a subfolder of the package, but the package root folder
> path instead. Anyway, this should be good enough for now.
Yeah, you're right. Minecraft calls `IApplicationData::get_LocalFolder()`, which is supposed to return the packages directory when `IStorageItem::get_Path()` is called, i.e. `AppData\\Local\\Packages\\Microsoft.MinecraftUWP\\LocalState`.
The IApplicationData::get_ methods correspond to folders within the relative package folder.
There doesn't seem to be a simple way of retrieving these directories. Each package has a number as a suffix. What I'm doing right now is loading the appxmanifest.xml file, using the identity name, and traversing the packages directory to find the right package. This doesn't account for duplicate names, which is unlikely to happen, but a concern nonetheless.
Still, this seems best done using package APIs. Also, since Wine does not yet support installing packages, retrieving the directory this way won't work. Or rather, it doesn't create the package folder that IApplicationData::get_ points to, I don't know if simply adding in package folders would be enough for some applications to work.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3548#note_47174
Currently ShellExecuteA() doesn't work for opening very long (>1024 chars) URLs. Commit fbf9cf6ebadc7d50c8fb7a130851c3658607b343 ("shell32: Make sure wcmd has enough space to hold the string.") started fixing it, but that is not enough.
This MR fixes two other issues on the way and lets ShellExecuteA() actually started winebrowser (with default registry) with the URL correctly relayed.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3981
I wanted to use ._xy element access to make it shorter, but that attempt was crushed by the reality - such indexing apparently compiles but does not produce correct element access loads. I'm going to update once this is fixed.
--
v6: vkd3d-shader/hlsl: Add determinant() function.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/329
--
v3: msxml3/tests: Add tests of ValidateOnParse property.
msxml3: Add ValidateOnParse support for IXMLDOMDocument3_{get,set}Property().
msxml3: Store ValidateOnParse property in domdoc_properties instead.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3424
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.
--
v3: combase: Create implicit MTA in STA apartment in RoGetActivationFactory().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3806
Final Fantasy VIII does this, more or less, and needs Init to succeed.
--
v2: dmime: Return DMUS_E_AUDIOPATH_INACTIVE when audio paths are not enabled.
dmime: Return DMUS_E_AUDIOPATHS_IN_USE when audio paths are in use.
dmime: Initialize performance in Init rather than InitAudio.
dmime: Set the port direct sound before activating it.
dmime/tests: Test performance Init with a created port.
dmime/tests: Move performance tests into dmime.c.
dmime/tests: Remove some duplicated tests.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3952
Manually disable some warnings that are currently emitted. Eventually
the warnings should be solved and -Werror should remain alone.
--
v4: demos: Do not trigger -Wmissing-prototypes for wmain().
vkd3d: Use CONST_VTABLE.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/377
Manually disable some warnings that are currently emitted. Eventually
the warnings should be solved and -Werror should remain alone.
--
v3: demos: Do not trigger -Wmissing-prototypes for wmain().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/377
- Changes to allow WNetAddConnection*() and WNetCancelConnection*() to succeed
regardless of available providers (where none have been implemented yet).
Allowing for manual configuration outside of wine.
--
v5: mpr: WNetAddConnection*() and WNetCancelConnection*() always return success
https://gitlab.winehq.org/wine/wine/-/merge_requests/3966
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.
--
v64: ws2_32/tests: Add test for AF_UNIX sockets.
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
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.
--
v63: ws2_32/tests: Add test for AF_UNIX sockets.
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.
ws2_32: Add afunix.h header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786
- Changes to allow WNetAddConnection*() and WNetCancelConnection*() to succeed
regardless of available providers (where none have been implemented yet).
Allowing for manual configuration outside of wine.
--
v3: mpr: WNetAddConnection*() and WNetCancelConnection*() always return success
https://gitlab.winehq.org/wine/wine/-/merge_requests/3966
- Changes to allow WNetAddConnection*() and WNetCancelConnection*() to succeed
regardless of available providers (where none have been implemented yet).
Allowing for manual configuration outside of wine.
--
v2: winegstreamer: Also return output with 2 channels for multichannel inputs from AAC decoder.
winegstreamer: Validate maximum channel count in _SetInputType in AAC decoder.
winegstreamer: Correct output available types attrs in AAC decoder for channel count > 2.
winegstreamer: Handle missing or zero channel count in _GetOutputAvailableType in AAC decoder.
mf/tests: Add tests for AAC decoder with different input number of channels.
winewayland.drv: Fix removal of wl_seat globals.
winewayland.drv: Handle client-initiated user-driven window resize.
winewayland.drv: Handle client-initiated user-driven window move.
winewayland.drv: Handle xdg_toplevel maximized state.
winewayland.drv: Handle xdg_toplevel configure event size hint.
winewayland.drv: Handle xdg_toplevel close event.
winewayland.drv: Remove wayland_surface destruction double locking.
msado15: Update editMode in AddNew/Cancel/Update functions.
msado15: _Recordset::Open store active connection parameter.
msado15: Implement _Recordset::get_ActiveConnection.
ntdll/tests: Skip FileLinkInformationEx tests on older Windows versions.
ntdll/tests: Skip FileRenameInformationEx tests on older Windows versions.
user32/tests: Use open_clipboard helper in msg tests.
user32: Enable IsDialogMessageA() ASCII to Unicode mapping only when the user default lang ID is CJK.
user32/tests: Fix test failures in Hindi UTF-8 and mixed locales.
systeminfo: Add an implementation on top of WMI.
wbemprox: Implement Win32_OperatingSystem.InstallDate.
wbemprox: Fix Win32_OperatingSystem.TotalVirtual/VisibleMemorySize.
wbemprox: Get Win32_OperatingSystem.BuildType from the registry.
d3d10/tests: Test for correct return value.
d3dx9: Trace pointer value in D3DXValidMesh().
include: Move RTL functions that belong in ntddk.h from winternl.h to ntddk.h.
include: Add some structures in d3d12video.idl.
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3966
This corresponds to vkd3d as of commit
acd3ed97dc8e1ac192b2ec6fc19596831a6b61c6.
The cpp_quoted #include directive is fixed up to match the file
naming outside of vkd3d, renaming the reference to
vkd3d_d3d12sdklayers.h back to d3d12sdklayers.h.
This matches other renamings that are done at the start of the
file for vkd3d renamed idl files as well.
Signed-off-by: Martin Storsjö <martin(a)martin.st>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3976
Manually disable some warnings that are currently emitted. Eventually
the warnings should be solved and -Werror should remain alone.
--
v2: vkd3d: Always use CONST_VTABLE when including windows.h.
ci: Store config.log as a build artifact.
ci: Compile with -Werror.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/377
--
v2: 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