Alexandre Julliard : shell32: Add implementation of WOWShellExecute.

Alexandre Julliard julliard at winehq.org
Thu Apr 2 10:42:40 CDT 2009


Module: wine
Branch: master
Commit: b1d96f6ffade16017a751f806b0c4345093458f9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b1d96f6ffade16017a751f806b0c4345093458f9

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Apr  1 18:19:42 2009 +0200

shell32: Add implementation of WOWShellExecute.

The callback is probably not fully compatible, but apps are not
supposed to use that function anyway.

---

 dlls/shell32/shell.c      |   32 +++++---------------------------
 dlls/shell32/shell32.spec |    2 +-
 dlls/shell32/shlexec.c    |   36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 28 deletions(-)

diff --git a/dlls/shell32/shell.c b/dlls/shell32/shell.c
index 67bdc01..db49c29 100644
--- a/dlls/shell32/shell.c
+++ b/dlls/shell32/shell.c
@@ -48,6 +48,9 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
+extern HINSTANCE WINAPI WOWShellExecute(HWND hWnd, LPCSTR lpOperation,LPCSTR lpFile,
+                                        LPCSTR lpParameters,LPCSTR lpDirectory,
+                                        INT iShowCmd, void *callback);
 
 typedef struct {     /* structure for dropped files */
  WORD     wSize;
@@ -600,31 +603,6 @@ HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
                                    LPCSTR lpFile, LPCSTR lpParameters,
                                    LPCSTR lpDirectory, INT16 iShowCmd )
 {
-    SHELLEXECUTEINFOW seiW;
-    WCHAR *wVerb = NULL, *wFile = NULL, *wParameters = NULL, *wDirectory = NULL;
-    HANDLE hProcess = 0;
-
-    seiW.lpVerb = lpOperation ? __SHCloneStrAtoW(&wVerb, lpOperation) : NULL;
-    seiW.lpFile = lpFile ? __SHCloneStrAtoW(&wFile, lpFile) : NULL;
-    seiW.lpParameters = lpParameters ? __SHCloneStrAtoW(&wParameters, lpParameters) : NULL;
-    seiW.lpDirectory = lpDirectory ? __SHCloneStrAtoW(&wDirectory, lpDirectory) : NULL;
-
-    seiW.cbSize = sizeof(seiW);
-    seiW.fMask = 0;
-    seiW.hwnd = HWND_32(hWnd);
-    seiW.nShow = iShowCmd;
-    seiW.lpIDList = 0;
-    seiW.lpClass = 0;
-    seiW.hkeyClass = 0;
-    seiW.dwHotKey = 0;
-    seiW.hProcess = hProcess;
-
-    SHELL_execute( &seiW, SHELL_Execute16 );
-
-    SHFree(wVerb);
-    SHFree(wFile);
-    SHFree(wParameters);
-    SHFree(wDirectory);
-
-    return HINSTANCE_16(seiW.hInstApp);
+    return HINSTANCE_16( WOWShellExecute( HWND_32(hWnd), lpOperation, lpFile, lpParameters,
+                                          lpDirectory, iShowCmd, SHELL_Execute16 ));
 }
diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec
index b64d8ef..5713c49 100644
--- a/dlls/shell32/shell32.spec
+++ b/dlls/shell32/shell32.spec
@@ -438,4 +438,4 @@
 @ stdcall StrStrIA(str str) shlwapi.StrStrIA
 @ stdcall StrStrIW(wstr wstr) shlwapi.StrStrIW
 @ stdcall StrStrW(wstr wstr) shlwapi.StrStrW
-@ stub WOWShellExecute
+@ stdcall WOWShellExecute(long str str str str long ptr)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 67815ca..3be5962 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -1956,6 +1956,42 @@ HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile,
 }
 
 /*************************************************************************
+ * WOWShellExecute			[SHELL32.@]
+ *
+ * FIXME: the callback function most likely doesn't work the same way on Windows.
+ */
+HINSTANCE WINAPI WOWShellExecute(HWND hWnd, LPCSTR lpOperation,LPCSTR lpFile,
+                                 LPCSTR lpParameters,LPCSTR lpDirectory, INT iShowCmd, void *callback)
+{
+    SHELLEXECUTEINFOW seiW;
+    WCHAR *wVerb = NULL, *wFile = NULL, *wParameters = NULL, *wDirectory = NULL;
+    HANDLE hProcess = 0;
+
+    seiW.lpVerb = lpOperation ? __SHCloneStrAtoW(&wVerb, lpOperation) : NULL;
+    seiW.lpFile = lpFile ? __SHCloneStrAtoW(&wFile, lpFile) : NULL;
+    seiW.lpParameters = lpParameters ? __SHCloneStrAtoW(&wParameters, lpParameters) : NULL;
+    seiW.lpDirectory = lpDirectory ? __SHCloneStrAtoW(&wDirectory, lpDirectory) : NULL;
+
+    seiW.cbSize = sizeof(seiW);
+    seiW.fMask = 0;
+    seiW.hwnd = hWnd;
+    seiW.nShow = iShowCmd;
+    seiW.lpIDList = 0;
+    seiW.lpClass = 0;
+    seiW.hkeyClass = 0;
+    seiW.dwHotKey = 0;
+    seiW.hProcess = hProcess;
+
+    SHELL_execute( &seiW, callback );
+
+    SHFree(wVerb);
+    SHFree(wFile);
+    SHFree(wParameters);
+    SHFree(wDirectory);
+    return seiW.hInstApp;
+}
+
+/*************************************************************************
  * OpenAs_RunDLLA          [SHELL32.@]
  */
 void WINAPI OpenAs_RunDLLA(HWND hwnd, HINSTANCE hinst, LPCSTR cmdline, int cmdshow)




More information about the wine-cvs mailing list