Vincent Povirk : uninstaller: Re-exec as 64-bit in wow64.

Alexandre Julliard julliard at winehq.org
Tue Apr 2 16:10:00 CDT 2019


Module: wine
Branch: master
Commit: 88580a3ad6e6afea25716b8717a33d20184154e5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=88580a3ad6e6afea25716b8717a33d20184154e5

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Sat Mar 30 15:55:43 2019 -0500

uninstaller: Re-exec as 64-bit in wow64.

Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/uninstaller/main.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/programs/uninstaller/main.c b/programs/uninstaller/main.c
index 142d3d1..fa9a23c 100644
--- a/programs/uninstaller/main.c
+++ b/programs/uninstaller/main.c
@@ -165,6 +165,31 @@ int wmain(int argc, WCHAR *argv[])
     static const WCHAR listW[] = { '-','-','l','i','s','t',0 };
     static const WCHAR removeW[] = { '-','-','r','e','m','o','v','e',0 };
     int i = 1;
+    BOOL is_wow64;
+
+    if (IsWow64Process( GetCurrentProcess(), &is_wow64 ) && is_wow64)
+    {
+        STARTUPINFOW si;
+        PROCESS_INFORMATION pi;
+        WCHAR filename[MAX_PATH];
+        void *redir;
+        DWORD exit_code;
+
+        memset( &si, 0, sizeof(si) );
+        si.cb = sizeof(si);
+        GetModuleFileNameW( 0, filename, MAX_PATH );
+
+        Wow64DisableWow64FsRedirection( &redir );
+        if (CreateProcessW( filename, GetCommandLineW(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ))
+        {
+            WINE_TRACE( "restarting %s\n", wine_dbgstr_w(filename) );
+            WaitForSingleObject( pi.hProcess, INFINITE );
+            GetExitCodeProcess( pi.hProcess, &exit_code );
+            ExitProcess( exit_code );
+        }
+        else WINE_ERR( "failed to restart 64-bit %s, err %d\n", wine_dbgstr_w(filename), GetLastError() );
+        Wow64RevertWow64FsRedirection( redir );
+    }
 
     while( i<argc )
     {




More information about the wine-cvs mailing list