From ced8869cef520ee67183fdaecdd5a8d02f9a583f Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 24 Jan 2011 13:46:29 -0600 Subject: [PATCH] shell32: Test links to executable filenames lacking the extension. --- dlls/shell32/tests/shelllink.c | 63 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+), 0 deletions(-) diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index f754efd..29b0dda 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -681,6 +681,24 @@ static void test_load_save(void) create_lnk(lnkfile, &desc, 0); check_lnk(lnkfile, &desc, 0x0); + /* Test omitting .exe from an absolute path */ + p=strrchr(mypath, '.'); + if (p) + *p='\0'; + + desc.description="absolute path without .exe"; + desc.workdir=mydir; + desc.path=mypath; + desc.pidl=NULL; + desc.arguments="/option1 /option2 \"Some string\""; + 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, 0x4); + /* Overwrite the existing lnk file and test link to a command on the path */ desc.description="command on path"; desc.workdir=mypath; @@ -697,6 +715,22 @@ static void test_load_save(void) desc.path=realpath; check_lnk(lnkfile, &desc, 0x0); + /* Test omitting .exe from a command on the path */ + desc.description="command on path without .exe"; + desc.workdir=mypath; + desc.path="rundll32"; + desc.pidl=NULL; + desc.arguments="/option1 /option2 \"Some string\""; + desc.showcmd=SW_SHOWNORMAL; + desc.icon=mypath; + desc.icon_id=0; + desc.hotkey=0x1234; + create_lnk(lnkfile, &desc, 0); + /* Check that link is created to proper location */ + SearchPathA( NULL, "rundll32", NULL, MAX_PATH, realpath, NULL); + desc.path=realpath; + check_lnk(lnkfile, &desc, 0x4); + /* Create a temporary non-executable file */ r=GetTempPath(sizeof(mypath), mypath); ok(r