winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2024
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
775 discussions
Start a n
N
ew thread
Yuxuan Shui : shell32: Fix FindExecutable search path.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 1bc7db2e7d2c50a42c8340aa875893df970d4a8f URL:
https://gitlab.winehq.org/wine/wine/-/commit/1bc7db2e7d2c50a42c8340aa875893…
Author: Yuxuan Shui <yshui(a)codeweavers.com> Date: Mon Mar 18 18:24:52 2024 +0000 shell32: Fix FindExecutable search path. It should look in the currect working directory, instead of the directory where the current executable is in. --- dlls/shell32/shlexec.c | 20 ++++++++++++++------ dlls/shell32/tests/shlexec.c | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index abb519e260d..9aa7963b71c 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -48,6 +48,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(exec); typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait, const SHELLEXECUTEINFOW *sei, LPSHELLEXECUTEINFOW sei_out); +extern BOOL WINAPI PathResolveAW(void *path, const void **paths, DWORD flags); static inline BOOL isSpace(WCHAR c) { @@ -599,6 +600,8 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, WCHAR *tok; /* token pointer */ WCHAR xlpFile[256]; /* result of SearchPath */ DWORD attribs; /* file attributes */ + WCHAR curdir[MAX_PATH]; + const WCHAR *search_paths[3] = {0}; TRACE("%s\n", debugstr_w(lpFile)); @@ -623,18 +626,23 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, return 33; } - if (SearchPathW(lpPath, lpFile, L".exe", ARRAY_SIZE(xlpFile), xlpFile, NULL)) + if (lpPath && *lpPath) { - TRACE("SearchPathW returned non-zero\n"); - lpFile = xlpFile; - /* The file was found in the application-supplied default directory (or the system search path) */ + search_paths[0] = lpPath; + search_paths[1] = curdir; } - else if (lpPath && SearchPathW(NULL, lpFile, L".exe", ARRAY_SIZE(xlpFile), xlpFile, NULL)) + else + search_paths[0] = curdir; + GetCurrentDirectoryW(MAX_PATH, curdir); + lstrcpyW(xlpFile, lpFile); + if (PathResolveAW(xlpFile, (const void **)search_paths, PRF_TRYPROGRAMEXTENSIONS | PRF_VERIFYEXISTS)) { TRACE("SearchPathW returned non-zero\n"); lpFile = xlpFile; - /* The file was found in one of the directories in the system-wide search path */ + /* The file was found in lpPath or one of the directories in the system-wide search path */ } + else + xlpFile[0] = '\0'; attribs = GetFileAttributesW(lpFile); if (attribs!=INVALID_FILE_ATTRIBUTES && (attribs&FILE_ATTRIBUTE_DIRECTORY)) diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index c9e23c7062e..2f95ff2e15d 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -2063,7 +2063,7 @@ static void test_find_executable(void) GetCurrentDirectoryA(MAX_PATH, curdir); SetCurrentDirectoryA(tmpdir); rc=(INT_PTR)FindExecutableA(basename, NULL, command); - todo_wine ok(rc == SE_ERR_FNF, "FindExecutable(%s) returned %Id\n", basename, rc); + ok(rc == SE_ERR_FNF, "FindExecutable(%s) returned %Id\n", basename, rc); SetCurrentDirectoryA(curdir); sprintf(filename, "%s\\test file.sfe", tmpdir);
1
0
0
0
Yuxuan Shui : shell32: PathResolve should remove trailing dot.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: a1d0e21b0add05fc1a37a4abe2a3beeea6abc497 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a1d0e21b0add05fc1a37a4abe2a3be…
Author: Yuxuan Shui <yshui(a)codeweavers.com> Date: Mon Mar 18 17:53:18 2024 +0000 shell32: PathResolve should remove trailing dot. --- dlls/shell32/shellpath.c | 24 ++++++++++++++++++------ dlls/shell32/tests/shellpath.c | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 5d7f9d48ebd..e32bf5a50dc 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -694,10 +694,16 @@ static BOOL PathResolveA(char *path, const char **dirs, DWORD flags) if (flags & PRF_VERIFYEXISTS) { if (PathFindOnPathExA(path, dirs, dwWhich)) + { + if (!PathIsFileSpecA(path)) GetFullPathNameA(path, MAX_PATH, path, NULL); return TRUE; - if (!is_file_spec && PathFileExistsDefExtA(path, dwWhich)) - return TRUE; - if (!is_file_spec) GetFullPathNameA(path, MAX_PATH, path, NULL); + } + if (!is_file_spec) + { + GetFullPathNameA(path, MAX_PATH, path, NULL); + if (PathFileExistsDefExtA(path, dwWhich)) + return TRUE; + } SetLastError(ERROR_FILE_NOT_FOUND); return FALSE; } @@ -723,10 +729,16 @@ static BOOL PathResolveW(WCHAR *path, const WCHAR **dirs, DWORD flags) if (flags & PRF_VERIFYEXISTS) { if (PathFindOnPathExW(path, dirs, dwWhich)) + { + if (!PathIsFileSpecW(path)) GetFullPathNameW(path, MAX_PATH, path, NULL); return TRUE; - if (!is_file_spec && PathFileExistsDefExtW(path, dwWhich)) - return TRUE; - if (!is_file_spec) GetFullPathNameW(path, MAX_PATH, path, NULL); + } + if (!is_file_spec) + { + GetFullPathNameW(path, MAX_PATH, path, NULL); + if (PathFileExistsDefExtW(path, dwWhich)) + return TRUE; + } SetLastError(ERROR_FILE_NOT_FOUND); return FALSE; } diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index 75bcf6bf4fe..ef3d2a78256 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -2963,6 +2963,7 @@ static void test_PathResolve(void) /* PRF_VERIFYEXISTS */ { L"shellpath", PRF_VERIFYEXISTS, TRUE, testfile_lnk }, { L"shellpath.lnk", PRF_VERIFYEXISTS, TRUE, testfile_lnk }, + { L"shellpath.lnk.", PRF_VERIFYEXISTS, TRUE, testfile_lnk }, { L"C:\\shellpath", PRF_VERIFYEXISTS, FALSE, L"C:\\shellpath" }, /* common extensions are tried even if PRF_TRYPROGRAMEXTENSIONS isn't passed */ /* directories in dirs parameter are always searched first even if PRF_FIRSTDIRDEF isn't passed */
1
0
0
0
Yuxuan Shui : shell32: PathResolve should be able to find files that already have extensions.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: f59947bc10a85ac39945f7513d15b6c893243beb URL:
https://gitlab.winehq.org/wine/wine/-/commit/f59947bc10a85ac39945f7513d15b6…
Author: Yuxuan Shui <yshui(a)codeweavers.com> Date: Mon Mar 18 17:02:01 2024 +0000 shell32: PathResolve should be able to find files that already have extensions. Setting dwWhich to 0xff forces extensions to be appended, even when the file name already includes an extension. This causes PathResolve to fail in some cases where the file does exist. --- dlls/shell32/shellpath.c | 4 ++-- dlls/shell32/tests/shellpath.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 9b527b35ac4..5d7f9d48ebd 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -687,7 +687,7 @@ BOOL WINAPI PathFileExistsDefExtW(LPWSTR,DWORD); static BOOL PathResolveA(char *path, const char **dirs, DWORD flags) { BOOL is_file_spec = PathIsFileSpecA(path); - DWORD dwWhich = flags & PRF_DONTFINDLNK ? 0xf : 0xff; + DWORD dwWhich = flags & PRF_DONTFINDLNK ? 0xf : 0xbf; TRACE("(%s,%p,0x%08lx)\n", debugstr_a(path), dirs, flags); @@ -716,7 +716,7 @@ static BOOL PathResolveA(char *path, const char **dirs, DWORD flags) static BOOL PathResolveW(WCHAR *path, const WCHAR **dirs, DWORD flags) { BOOL is_file_spec = PathIsFileSpecW(path); - DWORD dwWhich = flags & PRF_DONTFINDLNK ? 0xf : 0xff; + DWORD dwWhich = flags & PRF_DONTFINDLNK ? 0xf : 0xbf; TRACE("(%s,%p,0x%08lx)\n", debugstr_w(path), dirs, flags); diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index c49528c2cee..75bcf6bf4fe 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -2962,6 +2962,7 @@ static void test_PathResolve(void) /* PRF_VERIFYEXISTS */ { L"shellpath", PRF_VERIFYEXISTS, TRUE, testfile_lnk }, + { L"shellpath.lnk", PRF_VERIFYEXISTS, TRUE, testfile_lnk }, { L"C:\\shellpath", PRF_VERIFYEXISTS, FALSE, L"C:\\shellpath" }, /* common extensions are tried even if PRF_TRYPROGRAMEXTENSIONS isn't passed */ /* directories in dirs parameter are always searched first even if PRF_FIRSTDIRDEF isn't passed */ @@ -3071,6 +3072,10 @@ static void test_PathResolve(void) } /* show that PathResolve will check specified search path, even if it's the current directory */ + lstrcpyW(argv0_base, argv0_basep); + ret = pPathResolve(argv0_base, search_path, PRF_VERIFYEXISTS | PRF_TRYPROGRAMEXTENSIONS); + ok(ret, "resolving argv0 with search path failed unexpectedly, result: %s\n", wine_dbgstr_w(argv0_base)); + lstrcpyW(argv0_base, argv0_basep); if ((ext = wcsrchr(argv0_base, '.'))) {
1
0
0
0
Yuxuan Shui : shell32: Make sure PathResolve can find files in the current directory.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 5426e597bbbeabc74dbb39d2379e055dee82eca8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5426e597bbbeabc74dbb39d2379e05…
Author: Yuxuan Shui <yshui(a)codeweavers.com> Date: Mon Mar 18 16:52:45 2024 +0000 shell32: Make sure PathResolve can find files in the current directory. Previously looking for file that does exist in current directory will fail because of the early `!PathFileExists(path)` check, even when the current directory is specified in `dirs`. --- dlls/shell32/shellpath.c | 4 ++-- dlls/shell32/tests/shellpath.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index e7d4e181682..9b527b35ac4 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -691,7 +691,7 @@ static BOOL PathResolveA(char *path, const char **dirs, DWORD flags) TRACE("(%s,%p,0x%08lx)\n", debugstr_a(path), dirs, flags); - if (flags & PRF_VERIFYEXISTS && !PathFileExistsA(path)) + if (flags & PRF_VERIFYEXISTS) { if (PathFindOnPathExA(path, dirs, dwWhich)) return TRUE; @@ -720,7 +720,7 @@ static BOOL PathResolveW(WCHAR *path, const WCHAR **dirs, DWORD flags) TRACE("(%s,%p,0x%08lx)\n", debugstr_w(path), dirs, flags); - if (flags & PRF_VERIFYEXISTS && !PathFileExistsW(path)) + if (flags & PRF_VERIFYEXISTS) { if (PathFindOnPathExW(path, dirs, dwWhich)) return TRUE; diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index c493f6882ee..c49528c2cee 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -3048,10 +3048,14 @@ static void test_PathResolve(void) ok(!lstrcmpiW(path, L"C:\\windows\\regedit.exe") || !lstrcmpiW(path, L"C:\\windows\\system32\\regedit.exe"), "unexpected path %s\n", wine_dbgstr_w(path)); - /* show that PathResolve doesn't check current directory */ if (argv0_basep) { WCHAR *ext; + const WCHAR *search_path[] = { + argv0_dir, + NULL + }; + /* show that PathResolve doesn't check current directory */ lstrcpyW(argv0_base, argv0_basep); GetCurrentDirectoryW(MAX_PATH, curdir); SetCurrentDirectoryW(argv0_dir); @@ -3065,6 +3069,16 @@ static void test_PathResolve(void) ret = pPathResolve(argv0_base, NULL, PRF_VERIFYEXISTS | PRF_TRYPROGRAMEXTENSIONS); ok(!ret, "resolving argv0 without extension succeeded unexpectedly, result: %s\n", wine_dbgstr_w(argv0_base)); } + + /* show that PathResolve will check specified search path, even if it's the current directory */ + lstrcpyW(argv0_base, argv0_basep); + if ((ext = wcsrchr(argv0_base, '.'))) + { + *ext = 0; + ret = pPathResolve(argv0_base, search_path, PRF_VERIFYEXISTS | PRF_TRYPROGRAMEXTENSIONS); + ok(ret, "resolving argv0 without extension with search path failed unexpectedly, result: %s\n", wine_dbgstr_w(argv0_base)); + } + SetCurrentDirectoryW(curdir); } else
1
0
0
0
Yuxuan Shui : shell32: PathResolve(file, NULL, ...) should not look in the current directory.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 520b7c6d83f4d50b4ee9577a6d36c431cf7040ec URL:
https://gitlab.winehq.org/wine/wine/-/commit/520b7c6d83f4d50b4ee9577a6d36c4…
Author: Yuxuan Shui <yshui(a)codeweavers.com> Date: Mon Mar 18 15:45:57 2024 +0000 shell32: PathResolve(file, NULL, ...) should not look in the current directory. Unless it's explicitly specified. --- dlls/shell32/shellpath.c | 4 ++-- dlls/shell32/tests/shellpath.c | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 015d7cdd4e2..e7d4e181682 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -695,7 +695,7 @@ static BOOL PathResolveA(char *path, const char **dirs, DWORD flags) { if (PathFindOnPathExA(path, dirs, dwWhich)) return TRUE; - if (PathFileExistsDefExtA(path, dwWhich)) + if (!is_file_spec && PathFileExistsDefExtA(path, dwWhich)) return TRUE; if (!is_file_spec) GetFullPathNameA(path, MAX_PATH, path, NULL); SetLastError(ERROR_FILE_NOT_FOUND); @@ -724,7 +724,7 @@ static BOOL PathResolveW(WCHAR *path, const WCHAR **dirs, DWORD flags) { if (PathFindOnPathExW(path, dirs, dwWhich)) return TRUE; - if (PathFileExistsDefExtW(path, dwWhich)) + if (!is_file_spec && PathFileExistsDefExtW(path, dwWhich)) return TRUE; if (!is_file_spec) GetFullPathNameW(path, MAX_PATH, path, NULL); SetLastError(ERROR_FILE_NOT_FOUND); diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index 29b47ac8706..c493f6882ee 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -2942,7 +2942,8 @@ if (0) { /* crashes on native */ static void test_PathResolve(void) { WCHAR testfile[MAX_PATH], testfile_lnk[MAX_PATH], regedit_in_testdir[MAX_PATH], regedit_cmd[MAX_PATH]; - WCHAR tempdir[MAX_PATH], path[MAX_PATH]; + WCHAR tempdir[MAX_PATH], path[MAX_PATH], curdir[MAX_PATH]; + WCHAR argv0_dir[MAX_PATH] = {0}, argv0_base[MAX_PATH] = {0}, *argv0_basep = NULL; const WCHAR *dirs[2] = { tempdir, NULL }; HANDLE file, file2; BOOL ret; @@ -3013,6 +3014,15 @@ static void test_PathResolve(void) return; } + ret = GetModuleFileNameW(NULL, argv0_dir, sizeof(argv0_dir)); + ok(ret != 0 && ret < sizeof(argv0_dir), "GetModuleFileName failed\n"); + if (ret != 0 && ret < sizeof(argv0_dir)) + { + argv0_basep = wcsrchr(argv0_dir, '\\'); + *argv0_basep = 0; + argv0_basep++; + } + GetTempPathW(MAX_PATH, tempdir); lstrcpyW(testfile, tempdir); @@ -3038,6 +3048,28 @@ static void test_PathResolve(void) ok(!lstrcmpiW(path, L"C:\\windows\\regedit.exe") || !lstrcmpiW(path, L"C:\\windows\\system32\\regedit.exe"), "unexpected path %s\n", wine_dbgstr_w(path)); + /* show that PathResolve doesn't check current directory */ + if (argv0_basep) + { + WCHAR *ext; + lstrcpyW(argv0_base, argv0_basep); + GetCurrentDirectoryW(MAX_PATH, curdir); + SetCurrentDirectoryW(argv0_dir); + ret = pPathResolve(argv0_base, NULL, PRF_VERIFYEXISTS | PRF_TRYPROGRAMEXTENSIONS); + ok(!ret, "resolving argv0 succeeded unexpectedly, result: %s\n", wine_dbgstr_w(argv0_base)); + + lstrcpyW(argv0_base, argv0_basep); + if ((ext = wcsrchr(argv0_base, '.'))) + { + *ext = 0; + ret = pPathResolve(argv0_base, NULL, PRF_VERIFYEXISTS | PRF_TRYPROGRAMEXTENSIONS); + ok(!ret, "resolving argv0 without extension succeeded unexpectedly, result: %s\n", wine_dbgstr_w(argv0_base)); + } + SetCurrentDirectoryW(curdir); + } + else + win_skip("couldn't get module filename\n"); + for (i = 0; i < ARRAY_SIZE(tests); i++) { winetest_push_context("test %d", i);
1
0
0
0
Yuxuan Shui : shell32/tests: Check ShellExecute is looking in the correct current directory.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: c6fa51a9491ac92759eeb5f4fe62c2c92662c016 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c6fa51a9491ac92759eeb5f4fe62c2…
Author: Yuxuan Shui <yshui(a)codeweavers.com> Date: Mon Mar 18 15:09:41 2024 +0000 shell32/tests: Check ShellExecute is looking in the correct current directory. --- dlls/shell32/tests/shlexec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index ba28bbc83d2..c9e23c7062e 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -2266,6 +2266,8 @@ static void test_exes(void) { char filename[2 * MAX_PATH + 17]; char params[1024]; + char curdir[MAX_PATH]; + char *basename = strrchr(argv0, '\\') + 1; INT_PTR rc; sprintf(params, "shlexec \"%s\" Exec", child_file); @@ -2353,6 +2355,13 @@ static void test_exes(void) "notaverb", argv0, NULL, NULL, NULL); todo_wine okShell(rc == SE_ERR_NOASSOC, "returned %Iu\n", rc); + /* Check the correct search path is used */ + GetCurrentDirectoryA(MAX_PATH, curdir); + SetCurrentDirectoryA(tmpdir); + rc = shell_execute(NULL, basename, params, NULL); + todo_wine okShell(rc == SE_ERR_FNF, "returned %Iu\n", rc); + SetCurrentDirectoryA(curdir); + if (!skip_shlexec_tests) { /* A class overrides the normal handling of executables too */
1
0
0
0
Yuxuan Shui : shell32/tests: Check FindExecutable is looking in the correct current directory.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: ae70b66dce4ed7dfaf45bfa7b6f3bd7d3f9576a4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ae70b66dce4ed7dfaf45bfa7b6f3bd…
Author: Yuxuan Shui <yshui(a)codeweavers.com> Date: Mon Mar 18 14:22:02 2024 +0000 shell32/tests: Check FindExecutable is looking in the correct current directory. FindExecutable should look in the current working directory, not relative to the current executable image (which is what SearchPathW(NULL, ...) does). --- dlls/shell32/tests/shlexec.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 11332484800..ba28bbc83d2 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -2009,9 +2009,11 @@ static void test_urls(void) static void test_find_executable(void) { + char curdir[MAX_PATH]; char notepad_path[MAX_PATH]; char filename[MAX_PATH + 17]; char command[MAX_PATH]; + char *basename = strrchr(argv0, '\\') + 1; const filename_tests_t* test; INT_PTR rc; @@ -2052,6 +2054,18 @@ static void test_find_executable(void) ok(rc == SE_ERR_NOASSOC /* >= win2000 */ || rc > 32 /* win98, nt4 */, "FindExecutable(NULL) returned %Id\n", rc); ok(strcmp(command, "your word") != 0, "FindExecutable(NULL) returned command=[%s]\n", command); + /* Search for the current executabe itself */ + strcpy(command, "your word"); + rc=(INT_PTR)FindExecutableA(argv0, NULL, command); + ok(rc > 32, "FindExecutable(%s) returned %Id\n", argv0, rc); + + /* Make sure FindExecutable uses the correct current directory */ + GetCurrentDirectoryA(MAX_PATH, curdir); + SetCurrentDirectoryA(tmpdir); + rc=(INT_PTR)FindExecutableA(basename, NULL, command); + todo_wine ok(rc == SE_ERR_FNF, "FindExecutable(%s) returned %Id\n", basename, rc); + SetCurrentDirectoryA(curdir); + sprintf(filename, "%s\\test file.sfe", tmpdir); rc=(INT_PTR)FindExecutableA(filename, NULL, command); ok(rc > 32, "FindExecutable(%s) returned %Id\n", filename, rc);
1
0
0
0
Rémi Bernon : winegstreamer: Append an optional parser before decoders.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 7c7e55892e51bb9e351e7512ceeddac0b9d1b325 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7c7e55892e51bb9e351e7512ceedda…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Mar 7 12:32:32 2024 +0100 winegstreamer: Append an optional parser before decoders. --- dlls/quartz/tests/mpegaudio.c | 4 ++++ dlls/quartz/tests/mpegvideo.c | 28 +++++++++------------------- dlls/winegstreamer/wg_transform.c | 20 ++++++++++++++++++-- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c index 804cbbcc3d1..9fa6796e096 100644 --- a/dlls/quartz/tests/mpegaudio.c +++ b/dlls/quartz/tests/mpegaudio.c @@ -905,6 +905,7 @@ struct testfilter unsigned int got_sample, got_new_segment, got_eos, got_begin_flush, got_end_flush; REFERENCE_TIME expected_start_time; REFERENCE_TIME expected_stop_time; + BOOL todo_time; }; static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) @@ -1012,7 +1013,9 @@ static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample ok(hr == S_OK, "Got hr %#lx.\n", hr); if (filter->got_sample == 1) { + todo_wine_if(filter->todo_time) ok(start == filter->expected_start_time, "Got start time %s.\n", wine_dbgstr_longlong(start)); + todo_wine_if(filter->todo_time) ok(stop == filter->expected_stop_time, "Got stop time %s.\n", wine_dbgstr_longlong(stop)); } @@ -1510,6 +1513,7 @@ static void test_streaming_events(IMediaControl *control, IPin *sink, testsink->expected_start_time = 0; testsink->expected_stop_time = 120000; + testsink->todo_time = TRUE; hr = IMemInputPin_Receive(input, sample); ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IMemInputPin_Receive(input, sample); diff --git a/dlls/quartz/tests/mpegvideo.c b/dlls/quartz/tests/mpegvideo.c index 1f17ddbe636..08c59e169fb 100644 --- a/dlls/quartz/tests/mpegvideo.c +++ b/dlls/quartz/tests/mpegvideo.c @@ -834,7 +834,6 @@ struct testfilter unsigned int got_sample, got_new_segment, got_eos, got_begin_flush, got_end_flush; REFERENCE_TIME expected_start_time; REFERENCE_TIME expected_stop_time; - BOOL todo_stop_time; }; static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) @@ -942,7 +941,7 @@ static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample { ok(start == filter->expected_start_time, "Got start time %s, expected %s.\n", wine_dbgstr_longlong(start), wine_dbgstr_longlong(filter->expected_start_time)); - todo_wine_if(filter->todo_stop_time) + todo_wine ok(stop == filter->expected_stop_time, "Got stop time %s, expected %s.\n", wine_dbgstr_longlong(stop), wine_dbgstr_longlong(filter->expected_stop_time)); } @@ -1226,7 +1225,7 @@ static void test_send_video(IMemInputPin *input, IMediaSample *sample) /* gst-launch-1.0 -v videotestsrc pattern=black num-buffers=10 ! video/x-raw,width=32,height=24 ! mpeg2enc ! filesink location=empty-es2.mpg */ /* then truncate to taste */ /* each 00 00 01 b3 or 00 00 01 00 starts a new frame, except the first 00 00 01 00 after a 00 00 01 b3 */ - static const BYTE empty_mpg_frame1[] = { + static const BYTE empty_mpg_frames[] = { 0x00, 0x00, 0x01, 0xb3, 0x02, 0x00, 0x18, 0x15, 0x02, 0xbf, 0x60, 0x9c, 0x00, 0x00, 0x01, 0xb8, 0x00, 0x08, 0x00, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0f, 0xff, 0xf8, @@ -1235,27 +1234,22 @@ static void test_send_video(IMemInputPin *input, IMediaSample *sample) 0x41, 0x28, 0x88, 0x13, 0xb9, 0x6f, 0xcf, 0xc1, 0x04, 0x03, 0xa0, 0x11, 0xb1, 0x41, 0x28, 0x88, 0x13, 0xb9, 0x6f, 0xa1, 0x4b, 0x9f, 0x48, 0x04, 0x10, 0x0e, 0x80, 0x46, 0xc5, 0x04, 0xa2, 0x20, 0x4e, 0xe5, 0x80, 0x41, 0x00, 0xe8, 0x04, 0x6c, 0x50, 0x4a, 0x22, 0x04, 0xee, 0x58, - }; - static const BYTE empty_mpg_frame2[] = { 0x00, 0x00, 0x01, 0x00, 0x00, 0x57, 0xff, 0xf9, 0x80, 0x00, 0x00, 0x01, 0x01, 0x0a, 0x79, 0xc0, 0x00, 0x00, 0x01, 0x02, 0x0a, 0x79, 0xc0, - }; - static const BYTE empty_mpg_frame3[] = { 0x00, 0x00, 0x01, 0x00, 0x00, 0x97, 0xff, 0xf9, 0x80, 0x00, 0x00, 0x01, 0x01, 0x0a, 0x79, 0xc0, - 0x00, 0x00, 0x01, 0x02, 0x0a, 0x79, 0xc0, 0x00, 0x00, 0x01, 0xb7, + 0x00, 0x00, 0x01, 0x02, 0x0a, 0x79, 0xc0, + }; + static const BYTE empty_mpg_eos[] = { + 0x00, 0x00, 0x01, 0xb7, }; HRESULT hr; IPin *pin; - /* frame 1 - it's a complete frame, but due to how MPEG framing works, the decoder doesn't know that */ - /* frame 2 - new frame starts, frame 1 can be emitted - but Wine gets confused by colorimetry and returns an error */ - /* frame 3 - Wine emits frames 1 and 2 */ - /* meanwhile, native won't emit anything until an unknown-sized internal buffer is filled, or EOS is announced */ - test_send_sample(input, sample, empty_mpg_frame1, ARRAY_SIZE(empty_mpg_frame1), FALSE); - test_send_sample(input, sample, empty_mpg_frame2, ARRAY_SIZE(empty_mpg_frame2), TRUE); - test_send_sample(input, sample, empty_mpg_frame3, ARRAY_SIZE(empty_mpg_frame3), FALSE); + /* native won't emit anything until an unknown-sized internal buffer is filled, or EOS is announced */ + test_send_sample(input, sample, empty_mpg_frames, ARRAY_SIZE(empty_mpg_frames), TRUE); + test_send_sample(input, sample, empty_mpg_eos, ARRAY_SIZE(empty_mpg_eos), FALSE); hr = IMemInputPin_QueryInterface(input, &IID_IPin, (void **)&pin); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -1304,7 +1298,6 @@ static void test_sample_processing(IMediaControl *control, IMemInputPin *input, sink->expected_start_time = 0; sink->expected_stop_time = 0; - sink->todo_stop_time = FALSE; hr = IMediaSample_SetTime(sample, &sink->expected_start_time, &sink->expected_stop_time); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -1342,7 +1335,6 @@ static void test_sample_processing(IMediaControl *control, IMemInputPin *input, sink->expected_start_time = 22222; sink->expected_stop_time = 22222; - sink->todo_stop_time = TRUE; test_send_video(input, sample); ok(sink->got_sample >= 1, "Got %u calls to Receive().\n", sink->got_sample); ok(sink->got_eos == 1, "Got %u calls to EndOfStream().\n", sink->got_eos); @@ -1412,7 +1404,6 @@ static void test_streaming_events(IMediaControl *control, IPin *sink, testsink->expected_start_time = 0; testsink->expected_stop_time = 0; - testsink->todo_stop_time = TRUE; test_send_video(input, sample); ok(testsink->got_sample >= 1, "Got %u calls to Receive().\n", testsink->got_sample); testsink->got_sample = 0; @@ -1440,7 +1431,6 @@ static void test_streaming_events(IMediaControl *control, IPin *sink, testsink->expected_start_time = 0; testsink->expected_stop_time = 0; - testsink->todo_stop_time = TRUE; test_send_video(input, sample); ok(testsink->got_sample >= 1, "Got %u calls to Receive().\n", testsink->got_sample); testsink->got_sample = 0; diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index c252142d13d..71ea8cd263c 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -338,7 +338,7 @@ NTSTATUS wg_transform_create(void *args) struct wg_format output_format = *params->output_format; struct wg_format input_format = *params->input_format; GstElement *first = NULL, *last = NULL, *element; - GstCaps *sink_caps = NULL, *src_caps = NULL; + GstCaps *sink_caps = NULL, *src_caps = NULL, *parsed_caps = NULL; NTSTATUS status = STATUS_UNSUCCESSFUL; GstPadTemplate *template = NULL; struct wg_transform *transform; @@ -390,6 +390,10 @@ NTSTATUS wg_transform_create(void *args) gst_pad_set_query_function(transform->my_sink, transform_sink_query_cb); gst_pad_set_chain_function(transform->my_sink, transform_sink_chain_cb); + media_type = gst_structure_get_name(gst_caps_get_structure(src_caps, 0)); + if (!(parsed_caps = gst_caps_new_empty_simple(media_type))) + goto out; + /* Since we append conversion elements, we don't want to filter decoders * based on the actual output caps now. Matching decoders with the * raw output media type should be enough. @@ -408,7 +412,16 @@ NTSTATUS wg_transform_create(void *args) case WG_MAJOR_TYPE_VIDEO_INDEO: case WG_MAJOR_TYPE_VIDEO_WMV: case WG_MAJOR_TYPE_VIDEO_MPEG1: - if (!(element = find_element(GST_ELEMENT_FACTORY_TYPE_DECODER, src_caps, sink_caps)) + if ((element = find_element(GST_ELEMENT_FACTORY_TYPE_PARSER, src_caps, parsed_caps)) + && !append_element(transform->container, element, &first, &last)) + goto out; + else + { + gst_caps_unref(parsed_caps); + parsed_caps = gst_caps_ref(src_caps); + } + + if (!(element = find_element(GST_ELEMENT_FACTORY_TYPE_DECODER, parsed_caps, sink_caps)) || !append_element(transform->container, element, &first, &last)) goto out; break; @@ -500,6 +513,7 @@ NTSTATUS wg_transform_create(void *args) || !push_event(transform->my_src, event)) goto out; + gst_caps_unref(parsed_caps); gst_caps_unref(src_caps); gst_caps_unref(sink_caps); @@ -516,6 +530,8 @@ out: gst_object_unref(transform->my_src); if (src_caps) gst_caps_unref(src_caps); + if (parsed_caps) + gst_caps_unref(parsed_caps); if (sink_caps) gst_caps_unref(sink_caps); if (transform->allocator)
1
0
0
0
Rémi Bernon : winegstreamer: Release sink caps in the error path.
by Alexandre Julliard
21 Mar '24
21 Mar '24
Module: wine Branch: master Commit: 8ae8063743398e2a179f7171a3c86169cc7cdbb2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8ae8063743398e2a179f7171a3c861…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Feb 16 09:33:01 2024 +0100 winegstreamer: Release sink caps in the error path. --- dlls/winegstreamer/wg_transform.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 516b28e82e2..c252142d13d 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -338,7 +338,7 @@ NTSTATUS wg_transform_create(void *args) struct wg_format output_format = *params->output_format; struct wg_format input_format = *params->input_format; GstElement *first = NULL, *last = NULL, *element; - GstCaps *raw_caps = NULL, *src_caps = NULL; + GstCaps *sink_caps = NULL, *src_caps = NULL; NTSTATUS status = STATUS_UNSUCCESSFUL; GstPadTemplate *template = NULL; struct wg_transform *transform; @@ -395,7 +395,7 @@ NTSTATUS wg_transform_create(void *args) * raw output media type should be enough. */ media_type = gst_structure_get_name(gst_caps_get_structure(transform->output_caps, 0)); - if (!(raw_caps = gst_caps_new_empty_simple(media_type))) + if (!(sink_caps = gst_caps_new_empty_simple(media_type))) goto out; switch (input_format.major_type) @@ -408,12 +408,9 @@ NTSTATUS wg_transform_create(void *args) case WG_MAJOR_TYPE_VIDEO_INDEO: case WG_MAJOR_TYPE_VIDEO_WMV: case WG_MAJOR_TYPE_VIDEO_MPEG1: - if (!(element = find_element(GST_ELEMENT_FACTORY_TYPE_DECODER, src_caps, raw_caps)) + if (!(element = find_element(GST_ELEMENT_FACTORY_TYPE_DECODER, src_caps, sink_caps)) || !append_element(transform->container, element, &first, &last)) - { - gst_caps_unref(raw_caps); goto out; - } break; case WG_MAJOR_TYPE_AUDIO: @@ -421,12 +418,9 @@ NTSTATUS wg_transform_create(void *args) break; case WG_MAJOR_TYPE_UNKNOWN: GST_FIXME("Format %u not implemented!", input_format.major_type); - gst_caps_unref(raw_caps); goto out; } - gst_caps_unref(raw_caps); - switch (output_format.major_type) { case WG_MAJOR_TYPE_AUDIO: @@ -507,6 +501,7 @@ NTSTATUS wg_transform_create(void *args) goto out; gst_caps_unref(src_caps); + gst_caps_unref(sink_caps); GST_INFO("Created winegstreamer transform %p.", transform); params->transform = (wg_transform_t)(ULONG_PTR)transform; @@ -521,6 +516,8 @@ out: gst_object_unref(transform->my_src); if (src_caps) gst_caps_unref(src_caps); + if (sink_caps) + gst_caps_unref(sink_caps); if (transform->allocator) wg_allocator_destroy(transform->allocator); if (transform->drain_query)
1
0
0
0
Jinoh Kang : server: Check for DELETE access in NtMakeTemporaryObject().
by Alexandre Julliard
20 Mar '24
20 Mar '24
Module: wine Branch: master Commit: a4ef56e1d9a3f185f788d798851c9c961defc4e3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a4ef56e1d9a3f185f788d798851c9c…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Mon Mar 11 21:48:19 2024 +0900 server: Check for DELETE access in NtMakeTemporaryObject(). --- dlls/ntdll/tests/om.c | 1 - server/handle.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c index 3f416f75f0f..4b166441295 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c @@ -3321,7 +3321,6 @@ static void test_object_permanence(void) ok( !!(obi.GrantedAccess & DELETE), "expected DELETE access in %08lx\n", obi.GrantedAccess ); status = NtMakeTemporaryObject( handle ); - todo_wine_if(test->make_temp_status == STATUS_ACCESS_DENIED) ok( status == test->make_temp_status, "NtMakeTemporaryObject returned %08lx\n", status ); if (!NT_ERROR(status)) is_permanent = FALSE; } diff --git a/server/handle.c b/server/handle.c index 02a5a22edd1..ef243e06e0b 100644 --- a/server/handle.c +++ b/server/handle.c @@ -887,9 +887,10 @@ DECL_HANDLER(get_system_handles) DECL_HANDLER(set_object_permanence) { + const unsigned int access = req->permanent ? 0 : DELETE; struct object *obj; - if (!(obj = get_handle_obj( current->process, req->handle, 0, NULL ))) return; + if (!(obj = get_handle_obj( current->process, req->handle, access, NULL ))) return; if (req->permanent && !obj->is_permanent) {
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
78
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Results per page:
10
25
50
100
200