mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:54:13 +00:00
regedit: Always start the GUI as 64-bit when on a 64-bit prefix.
Same as we do with winecfg. This should help to eliminate some confusion with users who may want to edit keys with WOW64 redirection (e.g. Software\\Wine\\Drives). Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0b393119bb
commit
25c78b61de
1 changed files with 28 additions and 0 deletions
|
@ -24,10 +24,13 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
#define REGEDIT_DECLARE_FUNCTIONS
|
#define REGEDIT_DECLARE_FUNCTIONS
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(regedit);
|
||||||
|
|
||||||
WCHAR g_pszDefaultValueName[64];
|
WCHAR g_pszDefaultValueName[64];
|
||||||
|
|
||||||
BOOL ProcessCmdLine(WCHAR *cmdline);
|
BOOL ProcessCmdLine(WCHAR *cmdline);
|
||||||
|
@ -138,11 +141,36 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
|
||||||
{
|
{
|
||||||
MSG msg;
|
MSG msg;
|
||||||
HACCEL hAccel;
|
HACCEL hAccel;
|
||||||
|
BOOL is_wow64;
|
||||||
|
|
||||||
if (ProcessCmdLine(GetCommandLineW())) {
|
if (ProcessCmdLine(GetCommandLineW())) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 );
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize global strings */
|
/* Initialize global strings */
|
||||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
|
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
|
||||||
LoadStringW(hInstance, IDS_REGISTRY_DEFAULT_VALUE, g_pszDefaultValueName, COUNT_OF(g_pszDefaultValueName));
|
LoadStringW(hInstance, IDS_REGISTRY_DEFAULT_VALUE, g_pszDefaultValueName, COUNT_OF(g_pszDefaultValueName));
|
||||||
|
|
Loading…
Reference in a new issue