Nicolas Le Cam : shell32/tests: Add test for shell links to short path containing double backslashes.
Alexandre Julliard
julliard at winehq.org
Mon Aug 3 11:16:01 CDT 2009
Module: wine
Branch: master
Commit: 41b2296ac0d125cc9e0966976c019aaecbf44bb7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=41b2296ac0d125cc9e0966976c019aaecbf44bb7
Author: Nicolas Le Cam <niko.lecam at gmail.com>
Date: Sun Jul 26 22:35:34 2009 +0200
shell32/tests: Add test for shell links to short path containing double backslashes.
---
dlls/shell32/tests/shelllink.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index 3ab3766..15a93db 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -48,6 +48,7 @@ static fnSHILCreateFromPath pSHILCreateFromPath;
static fnSHDefExtractIconA pSHDefExtractIconA;
static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR, LPSTR, DWORD);
+static DWORD (WINAPI *pGetShortPathNameA)(LPCSTR, LPSTR, DWORD);
static const GUID _IID_IShellLinkDataList = {
0x45e2b4ae, 0xb1c3, 0x11d0,
@@ -223,6 +224,7 @@ static void test_get_set(void)
r = IShellLinkA_SetPath(sl, "\"c:\\nonexistent\\file\"");
ok(r==S_FALSE || r == S_OK, "SetPath failed (0x%08x)\n", r);
+ strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
ok(r==S_OK, "GetPath failed (0x%08x)\n", r);
ok(!lstrcmp(buffer, "C:\\nonexistent\\file") ||
@@ -615,6 +617,25 @@ static void test_load_save(void)
create_lnk(lnkfile, &desc, 0);
check_lnk(lnkfile, &desc, 0x0);
+ r=pGetShortPathNameA(mydir, mypath, sizeof(mypath));
+ strcpy(realpath, mypath);
+ strcat(realpath, "\\test.txt");
+ strcat(mypath, "\\\\test.txt");
+
+ /* Overwrite the existing lnk file and test link to a short path with double backslashes */
+ desc.description="non-executable file";
+ desc.workdir=mydir;
+ desc.path=mypath;
+ desc.pidl=NULL;
+ desc.arguments="";
+ desc.showcmd=SW_SHOWNORMAL;
+ desc.icon=mypath;
+ desc.icon_id=0;
+ desc.hotkey=0x1234;
+ create_lnk(lnkfile, &desc, 0);
+ desc.path=realpath;
+ check_lnk(lnkfile, &desc, 0x0);
+
r = DeleteFileA(mypath);
ok(r, "failed to delete file %s (%d)\n", mypath, GetLastError());
@@ -750,6 +771,7 @@ START_TEST(shelllink)
pSHDefExtractIconA = (fnSHDefExtractIconA) GetProcAddress(hmod, "SHDefExtractIconA");
pGetLongPathNameA = (void *)GetProcAddress(hkernel32, "GetLongPathNameA");
+ pGetShortPathNameA = (void *)GetProcAddress(hkernel32, "GetShortPathNameA");
r = CoInitialize(NULL);
ok(SUCCEEDED(r), "CoInitialize failed (0x%08x)\n", r);
More information about the wine-cvs
mailing list