From: Myah Caron Subject: [PATCH] shell32/tests: Test IShellLink_SetPath with a relative nonexistent file. Message-Id: <2c1ImLGmUV84z88cW4KM6CZ12LDBDHQ-IyCh-Ryir1iDk9otjHTCDggtM6aSI9Gii8kPJvzuswpkDgUZ9cRbc00fFHq5bCuUk0kXk1szQb4=@protonmail.com> Date: Mon, 14 Sep 2020 15:39:22 +0000 Signed-off-by: Myah Caron --- Tested on Windows 10, discovered while writing 192566. dlls/shell32/tests/shelllink.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index e4f176237f4..e17b1f67187 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -171,6 +171,19 @@ static void test_get_set(void) ok(r == S_FALSE, "GetPath failed (0x%08x)\n", r); ok(*buffer=='\0', "GetPath returned '%s'\n", buffer); + str="nonexistent_file"; + r = IShellLinkA_SetPath(sl, str); + todo_wine ok(r == S_OK, "SetPath failed (0x%08x)\n", r); + + r = SHGetFolderPathA(NULL, CSIDL_DESKTOP, NULL, 0, mypath); + ok(r == S_OK, "SHGetFolderPath failed (0x%08x)\n", r); + strcat(mypath, "\\nonexistent_file"); + + strcpy(buffer,"garbage"); + r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); + ok(r == S_OK, "GetPath failed (0x%08x)\n", r); + todo_wine ok(lstrcmpiA(buffer, mypath)==0, "GetPath returned '%s'\n", buffer); + /* Win98 returns S_FALSE, but WinXP returns S_OK */ str="c:\\nonexistent\\file"; r = IShellLinkA_SetPath(sl, str); -- 2.28.0