wine/dlls/shell32 shlexec.c shell32_main.h shell.c

Alexandre Julliard julliard at wine.codeweavers.com
Fri Nov 11 04:54:08 CST 2005


ChangeSet ID:	21222
CVSROOT:	/opt/cvs-commit
Module name:	wine
Changes by:	julliard at winehq.org	2005/11/11 04:54:08

Modified files:
	dlls/shell32   : shlexec.c shell32_main.h shell.c 

Log message:
	Dmitry Timoshkov <dmitry at codeweavers.com>
	Unconditionally fall back to ANSI DDE APIs in ShellExecute if current
	emulated Windows version is Win9x, Excel refuses to communicate with a
	unicode client in win9x mode.

Patch: http://cvs.winehq.org/patch.py?id=21222

Old revision  New revision  Changes     Path
 1.75          1.76          +10 -11     wine/dlls/shell32/shlexec.c
 1.107         1.108         +1 -1       wine/dlls/shell32/shell32_main.h
 1.68          1.69          +1 -1       wine/dlls/shell32/shell.c

Index: wine/dlls/shell32/shlexec.c
diff -u -p wine/dlls/shell32/shlexec.c:1.75 wine/dlls/shell32/shlexec.c:1.76
--- wine/dlls/shell32/shlexec.c:1.75	11 Nov 2005 10:54: 8 -0000
+++ wine/dlls/shell32/shlexec.c	11 Nov 2005 10:54: 8 -0000
@@ -708,8 +708,7 @@ static HDDEDATA CALLBACK dde_cb(UINT uTy
 static unsigned dde_connect(WCHAR* key, WCHAR* start, WCHAR* ddeexec,
                             const WCHAR* lpFile, WCHAR *env,
 			    LPCWSTR szCommandline, LPITEMIDLIST pidl, SHELL_ExecuteW32 execfunc,
-                            LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out,
-                            BOOL unicode)
+                            LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out)
 {
     static const WCHAR wApplication[] = {'\\','a','p','p','l','i','c','a','t','i','o','n',0};
     static const WCHAR wTopic[] = {'\\','t','o','p','i','c',0};
@@ -723,6 +722,7 @@ static unsigned dde_connect(WCHAR* key, 
     HCONV       hConv;
     HDDEDATA    hDdeData;
     unsigned    ret = 31;
+    BOOL unicode = !(GetVersion() & 0x80000000);
 
     strcpyW(endkey, wApplication);
     applen = sizeof(app);
@@ -819,8 +819,7 @@ static unsigned dde_connect(WCHAR* key, 
  */
 static UINT_PTR execute_from_key(LPWSTR key, LPCWSTR lpFile, WCHAR *env, LPCWSTR szCommandline,
 			     SHELL_ExecuteW32 execfunc,
-                             LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out,
-                             BOOL unicode)
+                             LPSHELLEXECUTEINFOW psei, LPSHELLEXECUTEINFOW psei_out)
 {
     WCHAR cmd[1024];
     LONG cmdlen = sizeof(cmd);
@@ -848,7 +847,7 @@ static UINT_PTR execute_from_key(LPWSTR 
         if (RegQueryValueW(HKEY_CLASSES_ROOT, key, param, &paramlen) == ERROR_SUCCESS)
         {
             TRACE("Got ddeexec %s => %s\n", debugstr_w(key), debugstr_w(param));
-            retval = dde_connect(key, cmd, param, lpFile, env, szCommandline, psei->lpIDList, execfunc, psei, psei_out, unicode);
+            retval = dde_connect(key, cmd, param, lpFile, env, szCommandline, psei->lpIDList, execfunc, psei, psei_out);
         }
         else
         {
@@ -1178,7 +1177,7 @@ static LONG ShellExecute_FromContextMenu
 /*************************************************************************
  *	SHELL_execute [Internal]
  */
-BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc, BOOL unicode )
+BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
 {
     static const WCHAR wQuote[] = {'"',0};
     static const WCHAR wSpace[] = {' ',0};
@@ -1438,7 +1437,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW 
         }
         TRACE("%s/%s => %s/%s\n", debugstr_w(wszApplicationName), debugstr_w(sei_tmp.lpVerb), debugstr_w(wszQuotedCmd), debugstr_w(lpstrProtocol));
         if (*lpstrProtocol)
-            retval = execute_from_key(lpstrProtocol, wszApplicationName, env, sei_tmp.lpParameters, execfunc, &sei_tmp, sei, unicode);
+            retval = execute_from_key(lpstrProtocol, wszApplicationName, env, sei_tmp.lpParameters, execfunc, &sei_tmp, sei);
         else
             retval = execfunc(wszQuotedCmd, env, FALSE, &sei_tmp, sei);
         HeapFree( GetProcessHeap(), 0, env );
@@ -1471,7 +1470,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW 
             lpFile += iSize;
             while (*lpFile == ':') lpFile++;
         }
-        retval = execute_from_key(lpstrProtocol, lpFile, NULL, sei_tmp.lpParameters, execfunc, &sei_tmp, sei, unicode);
+        retval = execute_from_key(lpstrProtocol, lpFile, NULL, sei_tmp.lpParameters, execfunc, &sei_tmp, sei);
     }
     /* Check if file specified is in the form www.??????.*** */
     else if (!strncmpiW(lpFile, wWww, 3))
@@ -1556,7 +1555,7 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXEC
     else
         seiW.lpClass = NULL;
 
-    ret = SHELL_execute( &seiW, SHELL_ExecuteW, FALSE );
+    ret = SHELL_execute( &seiW, SHELL_ExecuteW );
 
     sei->hInstApp = seiW.hInstApp;
 
@@ -1578,7 +1577,7 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXEC
  */
 BOOL WINAPI ShellExecuteExW (LPSHELLEXECUTEINFOW sei)
 {
-    return  SHELL_execute( sei, SHELL_ExecuteW, TRUE );
+    return SHELL_execute( sei, SHELL_ExecuteW );
 }
 
 /*************************************************************************
@@ -1607,6 +1606,6 @@ HINSTANCE WINAPI ShellExecuteW(HWND hwnd
     sei.dwHotKey = 0;
     sei.hProcess = 0;
 
-    SHELL_execute( &sei, SHELL_ExecuteW, TRUE );
+    SHELL_execute( &sei, SHELL_ExecuteW );
     return sei.hInstApp;
 }
Index: wine/dlls/shell32/shell32_main.h
diff -u -p wine/dlls/shell32/shell32_main.h:1.107 wine/dlls/shell32/shell32_main.h:1.108
--- wine/dlls/shell32/shell32_main.h:1.107	11 Nov 2005 10:54: 8 -0000
+++ wine/dlls/shell32/shell32_main.h	11 Nov 2005 10:54: 8 -0000
@@ -217,7 +217,7 @@ inline static WCHAR * __SHCloneStrAtoW(W
 typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
 			    LPSHELLEXECUTEINFOW sei, LPSHELLEXECUTEINFOW sei_out);
 
-BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc, BOOL unicode);
+BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc);
 
 UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
                           LPWSTR lpResult, int resultLen, LPWSTR key, WCHAR **env, LPITEMIDLIST pidl, LPCWSTR args);
Index: wine/dlls/shell32/shell.c
diff -u -p wine/dlls/shell32/shell.c:1.68 wine/dlls/shell32/shell.c:1.69
--- wine/dlls/shell32/shell.c:1.68	11 Nov 2005 10:54: 8 -0000
+++ wine/dlls/shell32/shell.c	11 Nov 2005 10:54: 8 -0000
@@ -626,7 +626,7 @@ HINSTANCE16 WINAPI ShellExecute16( HWND1
     seiW.dwHotKey = 0;
     seiW.hProcess = hProcess;
 
-    SHELL_execute( &seiW, SHELL_Execute16, FALSE );
+    SHELL_execute( &seiW, SHELL_Execute16 );
 
     if (wVerb) SHFree(wVerb);
     if (wFile) SHFree(wFile);



More information about the wine-cvs mailing list