From 7bef6dc8b997af5079ac087454fcd36a468c9d78 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 29 Mar 2010 12:26:42 +0200 Subject: [PATCH] user32: Always start the 64-bit version of explorer.exe on Wow64. --- dlls/user32/win.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 3a61fc1f78..74ea0b3589 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -1785,6 +1785,7 @@ HWND WINAPI GetDesktopWindow(void) WCHAR windir[MAX_PATH]; WCHAR app[MAX_PATH + sizeof(explorer)/sizeof(WCHAR)]; WCHAR cmdline[MAX_PATH + (sizeof(explorer) + sizeof(args))/sizeof(WCHAR)]; + void *redir; memset( &si, 0, sizeof(si) ); si.cb = sizeof(si); @@ -1793,11 +1794,13 @@ HWND WINAPI GetDesktopWindow(void) si.hStdOutput = 0; si.hStdError = GetStdHandle( STD_ERROR_HANDLE ); - GetWindowsDirectoryW( windir, MAX_PATH ); + GetSystemDirectoryW( windir, MAX_PATH ); strcpyW( app, windir ); strcatW( app, explorer ); strcpyW( cmdline, app ); strcatW( cmdline, args ); + + Wow64DisableWow64FsRedirection( &redir ); if (CreateProcessW( app, cmdline, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, windir, &si, &pi )) { @@ -1807,6 +1810,7 @@ HWND WINAPI GetDesktopWindow(void) CloseHandle( pi.hProcess ); } else WARN( "failed to start explorer, err %d\n", GetLastError() ); + Wow64RevertWow64FsRedirection( redir ); } else TRACE( "not starting explorer since winstation is not visible\n" );