shell32/tests: Test creating shell links for commands on path. [PATCH 1/2, updated]

Misha Koshelev mk144210 at
Fri Feb 9 10:51:01 CST 2007

Updated: Took out an unnecesssary ".exe" parameter to SearchPath because
what we are searching for already ends in ".exe".
This is a conformance test for bug 7359, where the Vector NTI installer
incorrectly creates a shell link to rundll32.exe in the current
directory instead of the current path. This conformance test shows that
when creating a shell link to a command on the path Windows XP will
properly create the shell link to point to the executable, whereas wine
will just create a shell link to the (nonexistent) executable in the
current/working directory.


	* shell32/tests: Test creating shell links for commands on path.
-------------- next part --------------
From f00af4ff87e3deb61f99f98cc0f68d20e28424ef Mon Sep 17 00:00:00 2001
From: Misha Koshelev <mk144210 at>
Date: Fri, 9 Feb 2007 10:47:58 -0600
Subject: shell32/tests: Test creating shell links for commands on path.
 dlls/shell32/tests/shelllink.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index 62bd3b0..473aae7 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -487,6 +487,7 @@ static void test_load_save(void)
     lnk_desc_t desc;
     char mypath[MAX_PATH];
     char mydir[MAX_PATH];
+    char realpath[MAX_PATH];
     char* p;
     DWORD r;
@@ -535,6 +536,22 @@ static void test_load_save(void)
     create_lnk(lnkfile, &desc, 0);
     check_lnk(lnkfile, &desc);
+    /* Overwrite the existing lnk file and test link to a command on the path */
+    desc.description="command on path";
+    desc.workdir=mypath;
+    desc.path="rundll32.exe";
+    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, desc.path, NULL, MAX_PATH, realpath, NULL);
+    desc.path=realpath;
+    check_lnk(lnkfile, &desc);
     /* FIXME: Also test saving a .lnk pointing to a pidl that cannot be
      * represented as a path.

More information about the wine-patches mailing list