Module: wine
Branch: master
Commit: a2548c8db3096963012939c82e340f6b867f3efd
URL: https://gitlab.winehq.org/wine/wine/-/commit/a2548c8db3096963012939c82e340f…
Author: Yuxuan Shui <yshui(a)codeweavers.com>
Date: Mon Mar 25 13:39:17 2024 +0000
shell32: Restore the ability of running native unix programs with ShellExecute.
For ShellExecute, if the specified file is found, we will try running it anyway, even if it doesn't
have a "program" extension.
Windows associations will take precedence over this.
---
dlls/shell32/shlexec.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 9704f9d8f06..d2fe3caed88 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -579,6 +579,7 @@ static UINT SHELL_FindExecutableByVerb(LPCWSTR lpVerb, LPWSTR key, LPWSTR classn
*
* Utility for code sharing between FindExecutable and ShellExecute
* in:
+ * lpPath the path to search for the file
* lpFile the name of a file
* lpVerb the operation on it (open)
* out:
@@ -639,6 +640,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
{
TRACE("PathResolveAW returned non-zero\n");
lpFile = xlpFile;
+ lstrcpyW(lpResult, xlpFile);
/* The file was found in lpPath or one of the directories in the system-wide search path */
}
else
@@ -696,7 +698,6 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
if (wcsicmp(tok, &extension[1]) == 0) /* have to skip the leading "." */
{
- lstrcpyW(lpResult, xlpFile);
/* Need to perhaps check that the file has a path
* attached */
TRACE("found %s\n", debugstr_w(lpResult));
@@ -781,7 +782,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
}
}
- TRACE("returning %s\n", debugstr_w(lpResult));
+ TRACE("returning path %s, retval %d\n", debugstr_w(lpResult), retval);
return retval;
}
@@ -1817,7 +1818,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
buf = malloc(len * sizeof(WCHAR));
GetFullPathNameW(sei_tmp.lpDirectory, len, buf, NULL);
if (wszDir != dirBuffer)
- free(wszDir);
+ free(wszDir);
wszDir = buf;
sei_tmp.lpDirectory = wszDir;
}
@@ -1885,6 +1886,22 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
lstrcatW(lpstrTmpFile, lpFile);
retval = (UINT_PTR)ShellExecuteW(sei_tmp.hwnd, sei_tmp.lpVerb, lpstrTmpFile, NULL, NULL, 0);
}
+ else if (retval == SE_ERR_NOASSOC && SHGetFileInfoW(wcmd, 0, NULL, 0, SHGFI_EXETYPE) == 0)
+ {
+ /* File found, but no association. And no other cases fit, this could be a
+ unix programs, try running it. We have to do this in a "catch-all" fashion because
+ unix program can have any extensions. However, things get more complicated because
+ the file we find could be a Windows executable without the proper extensions, it could
+ be seen as unexpected if we start it, so we special case it here. */
+ UINT exec_retval;
+ TRACE("No association found, trying as Unix binary %s\n", debugstr_w(wcmd));
+ exec_retval = SHELL_quote_and_execute( wcmd, wszParameters, wszKeyname,
+ wszApplicationName, env, &sei_tmp,
+ sei, execfunc );
+ TRACE("Unix binary returned %u\n", exec_retval);
+ if (exec_retval > 32)
+ retval = exec_retval;
+ }
end:
TRACE("retval %Iu\n", retval);
Module: wine
Branch: master
Commit: b918ce9e7694da29231b73dcb228074d36d15761
URL: https://gitlab.winehq.org/wine/wine/-/commit/b918ce9e7694da29231b73dcb22807…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com>
Date: Tue Apr 30 18:43:03 2024 +0800
win32u: Set the virtual desktop display frequency to 60Hz.
Fix a regression from ee0aad5c, which changes the virtual desktop display frequency to that of
the host display while adding modes of 60Hz. So when the host display is not 60Hz, we might get
ChangeDisplaySettings() failures when virtual desktop is on because the target mode is not found
because of the frequency difference.
---
dlls/win32u/sysparams.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c
index d2ac6d5bfb2..cc6bd8e7628 100644
--- a/dlls/win32u/sysparams.c
+++ b/dlls/win32u/sysparams.c
@@ -1900,6 +1900,7 @@ static BOOL desktop_update_display_devices( BOOL force, struct device_manager_ct
if (!read_source_mode( ctx->source_key, ENUM_CURRENT_SETTINGS, ¤t ))
{
current = desktop_ctx.primary;
+ current.dmDisplayFrequency = 60;
current.dmPelsWidth = screen_width;
current.dmPelsHeight = screen_height;
}