From 46fceb19f394a77e142d9d053f401880bf418a4b Mon Sep 17 00:00:00 2001
From: Martin Fuchs <martin-fuchs@gmx.net>
Date: Mon, 1 Mar 2004 21:22:25 +0000
Subject: [PATCH] Set error code ERROR_DDE_FAIL if the DDE connection failed in
 ShellExecute().

---
 dlls/shell32/shlexec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 3175cfa1f08..94e6691130d 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -540,8 +540,9 @@ static unsigned dde_connect(WCHAR* key, WCHAR* start, WCHAR* ddeexec,
         if (!hConv)
         {
             TRACE("Couldn't connect. ret=%d\n", ret);
-            ret = 30; /* whatever */
-            goto error;
+            DdeUninitialize(ddeInst);
+            SetLastError(ERROR_DDE_FAIL);
+            return 30; /* whatever */
         }
         strcpyW(endkey, wIfexec);
         ifexeclen = sizeof(ifexec)/sizeof(WCHAR);
-- 
GitLab