Alexandre Julliard : wineboot: Relaunch the 64-bit version of wineboot on Wow64.
Alexandre Julliard
julliard at winehq.org
Fri Dec 17 11:30:38 CST 2010
Module: wine
Branch: master
Commit: 9b3483899225a0232b6ebc22597a1d1d836ab7dd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9b3483899225a0232b6ebc22597a1d1d836ab7dd
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Dec 15 22:29:25 2010 +0100
wineboot: Relaunch the 64-bit version of wineboot on Wow64.
---
programs/wineboot/wineboot.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 804528f..28292ad 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -1133,11 +1133,36 @@ int main( int argc, char *argv[] )
int end_session = 0, force = 0, init = 0, kill = 0, restart = 0, shutdown = 0, update = 0;
HANDLE event;
SECURITY_ATTRIBUTES sa;
+ BOOL is_wow64;
GetWindowsDirectoryW( windowsdir, MAX_PATH );
if( !SetCurrentDirectoryW( windowsdir ) )
WINE_ERR("Cannot set the dir to %s (%d)\n", wine_dbgstr_w(windowsdir), GetLastError() );
+ 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 ((optc = getopt_long(argc, argv, short_options, long_options, NULL )) != -1)
{
switch(optc)
More information about the wine-cvs
mailing list