From: Jason Overland Subject: winecfg: add all Windows versions and accompanying error message (try 4) Message-Id: <552B8B39.5090607@gmail.com> Date: Mon, 13 Apr 2015 02:24:09 -0700 This patch supersedes "winecfg: add all Windows versions and accompanying error message (try 3)". Changes since try 3: A function only used in a 64 bit #ifdef is now itself guarded by an #ifdef, so no more compiler warning under 32 bit. Error message shortened to refer to the Wine FAQ, but not the specific section as those may change in the future. From acb638a80d88ed15e64f5d9953d88d3a8650f249 Mon Sep 17 00:00:00 2001 From: Jason Overland Date: Mon, 13 Apr 2015 02:09:11 -0700 Subject: winecfg: add all Windows versions and accompanying error message (try 4) --- programs/winecfg/appdefaults.c | 80 ++++++++++++++++++++++++++++++++---------- programs/winecfg/resource.h | 2 ++ programs/winecfg/winecfg.rc | 15 ++++++++ 3 files changed, 79 insertions(+), 18 deletions(-) diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c index fad9e5c..9fbfd8f 100644 --- a/programs/winecfg/appdefaults.c +++ b/programs/winecfg/appdefaults.c @@ -31,6 +31,7 @@ #include "wine/unicode.h" #include "winecfg.h" #include "resource.h" +#include "shellapi.h" WINE_DEFAULT_DEBUG_CHANNEL(winecfg); @@ -46,29 +47,30 @@ static const struct WORD wServicePackMajor; WORD wServicePackMinor; const char *szProductType; + BOOL bRequires32BitPrefix; } win_versions[] = { - { "win81", "Windows 8.1", 6, 3, 0x2580,VER_PLATFORM_WIN32_NT, " ", 0, 0, "WinNT"}, - { "win8", "Windows 8", 6, 2, 0x23F0,VER_PLATFORM_WIN32_NT, " ", 0, 0, "WinNT"}, - { "win2008r2", "Windows 2008 R2", 6, 1, 0x1DB1,VER_PLATFORM_WIN32_NT, "Service Pack 1", 1, 0, "ServerNT"}, - { "win7", "Windows 7", 6, 1, 0x1DB1,VER_PLATFORM_WIN32_NT, "Service Pack 1", 1, 0, "WinNT"}, - { "win2008", "Windows 2008", 6, 0, 0x1772,VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "ServerNT"}, - { "vista", "Windows Vista", 6, 0, 0x1772,VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "WinNT"}, - { "win2003", "Windows 2003", 5, 2, 0xECE, VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "ServerNT"}, + { "win81", "Windows 8.1", 6, 3, 0x2580,VER_PLATFORM_WIN32_NT, " ", 0, 0, "WinNT", FALSE}, + { "win8", "Windows 8", 6, 2, 0x23F0,VER_PLATFORM_WIN32_NT, " ", 0, 0, "WinNT", FALSE}, + { "win2008r2", "Windows 2008 R2", 6, 1, 0x1DB1,VER_PLATFORM_WIN32_NT, "Service Pack 1", 1, 0, "ServerNT", FALSE}, + { "win7", "Windows 7", 6, 1, 0x1DB1,VER_PLATFORM_WIN32_NT, "Service Pack 1", 1, 0, "WinNT", FALSE}, + { "win2008", "Windows 2008", 6, 0, 0x1772,VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "ServerNT", FALSE}, + { "vista", "Windows Vista", 6, 0, 0x1772,VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "WinNT", FALSE}, + { "win2003", "Windows 2003", 5, 2, 0xECE, VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "ServerNT", FALSE}, #ifdef _WIN64 - { "winxp64", "Windows XP", 5, 2, 0xECE, VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "WinNT"}, + { "winxp64", "Windows XP", 5, 2, 0xECE, VER_PLATFORM_WIN32_NT, "Service Pack 2", 2, 0, "WinNT", FALSE}, #else - { "winxp", "Windows XP", 5, 1, 0xA28, VER_PLATFORM_WIN32_NT, "Service Pack 3", 3, 0, "WinNT"}, - { "win2k", "Windows 2000", 5, 0, 0x893, VER_PLATFORM_WIN32_NT, "Service Pack 4", 4, 0, "WinNT"}, - { "winme", "Windows ME", 4, 90, 0xBB8, VER_PLATFORM_WIN32_WINDOWS, " ", 0, 0, ""}, - { "win98", "Windows 98", 4, 10, 0x8AE, VER_PLATFORM_WIN32_WINDOWS, " A ", 0, 0, ""}, - { "win95", "Windows 95", 4, 0, 0x3B6, VER_PLATFORM_WIN32_WINDOWS, "", 0, 0, ""}, - { "nt40", "Windows NT 4.0", 4, 0, 0x565, VER_PLATFORM_WIN32_NT, "Service Pack 6a", 6, 0, "WinNT"}, - { "nt351", "Windows NT 3.51", 3, 51, 0x421, VER_PLATFORM_WIN32_NT, "Service Pack 5", 5, 0, "WinNT"}, - { "win31", "Windows 3.1", 3, 10, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, ""}, - { "win30", "Windows 3.0", 3, 0, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, ""}, - { "win20", "Windows 2.0", 2, 0, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, ""} + { "winxp", "Windows XP", 5, 1, 0xA28, VER_PLATFORM_WIN32_NT, "Service Pack 3", 3, 0, "WinNT", TRUE}, #endif + { "win2k", "Windows 2000", 5, 0, 0x893, VER_PLATFORM_WIN32_NT, "Service Pack 4", 4, 0, "WinNT", TRUE}, + { "winme", "Windows ME", 4, 90, 0xBB8, VER_PLATFORM_WIN32_WINDOWS, " ", 0, 0, "", TRUE}, + { "win98", "Windows 98", 4, 10, 0x8AE, VER_PLATFORM_WIN32_WINDOWS, " A ", 0, 0, "", TRUE}, + { "win95", "Windows 95", 4, 0, 0x3B6, VER_PLATFORM_WIN32_WINDOWS, "", 0, 0, "", TRUE}, + { "nt40", "Windows NT 4.0", 4, 0, 0x565, VER_PLATFORM_WIN32_NT, "Service Pack 6a", 6, 0, "WinNT", TRUE}, + { "nt351", "Windows NT 3.51", 3, 51, 0x421, VER_PLATFORM_WIN32_NT, "Service Pack 5", 5, 0, "WinNT", TRUE}, + { "win31", "Windows 3.1", 3, 10, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, "", TRUE}, + { "win30", "Windows 3.0", 3, 0, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, "", TRUE}, + { "win20", "Windows 2.0", 2, 0, 0, VER_PLATFORM_WIN32s, "Win32s 1.3", 0, 0, "", TRUE} }; #define NB_VERSIONS (sizeof(win_versions)/sizeof(win_versions[0])) @@ -399,9 +401,51 @@ static void on_remove_app_click(HWND dialog) SendMessageW(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0); } +#ifdef _WIN64 +static INT_PTR WINAPI win_ver_error_dlg_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static const WCHAR openW[] = {'o','p','e','n',0}; + switch (msg) + { + case WM_INITDIALOG: + { + return TRUE; + } + case WM_NOTIFY: + switch (((NMHDR *)lParam)->code) + { + case NM_CLICK: + case NM_RETURN: + if (wParam == IDC_WIN_VER_TEXT) + ShellExecuteW( NULL, openW, ((NMLINK *)lParam)->item.szUrl, NULL, NULL, SW_SHOW ); + break; + } + break; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: + case IDCANCEL: + EndDialog(hwnd, LOWORD(wParam)); + return TRUE; + } + return TRUE; + } + return FALSE; +} +#endif + static void on_winver_change(HWND dialog) { int selection = SendDlgItemMessageW(dialog, IDC_WINVER, CB_GETCURSEL, 0, 0); +#ifdef _WIN64 + if (win_versions[selection-1].bRequires32BitPrefix) + { + DialogBoxW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(IDD_WINVERERROR), dialog, win_ver_error_dlg_proc); + update_comboboxes(dialog); + return; + } +#endif if (current_app) { diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h index 3118fb6..669d863 100644 --- a/programs/winecfg/resource.h +++ b/programs/winecfg/resource.h @@ -54,6 +54,7 @@ #define IDD_DLLCFG 111 #define IDD_DRIVECFG 112 #define IDD_DESKTOP_INTEGRATION 115 +#define IDD_WINVERERROR 116 #define IDC_WINVER 1012 #define IDC_DESKTOP_WIDTH 1023 #define IDC_DESKTOP_HEIGHT 1024 @@ -135,6 +136,7 @@ #define IDC_APP_LISTVIEW 1200 #define IDC_APP_ADDAPP 1201 #define IDC_APP_REMOVEAPP 1202 +#define IDC_WIN_VER_TEXT 1205 /* audio tab */ #define IDC_AUDIO_TEST 1300 diff --git a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc index f82159e..b54846a 100644 --- a/programs/winecfg/winecfg.rc +++ b/programs/winecfg/winecfg.rc @@ -159,6 +159,21 @@ BEGIN COMBOBOX IDC_WINVER,100,194,145,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END +IDD_WINVERERROR DIALOGEX 100, 100, 238, 95 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Error: Invalid selection" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "This Wine prefix is built to support 64 bit applications. \ + Because the Windows version you selected does not support 64 bit applications, \ + this prefix cannot be configured to mimic that version of Windows.", + IDC_STATIC,5,5,220,40 + CONTROL "Please refer to the Wine FAQ \ + for instructions on how to create a 32 bit Wine prefix.", + IDC_WIN_VER_TEXT,"SysLink",0,5,40,220,70 + DEFPUSHBUTTON "Close", IDOK, 175, 75, 60, 16, WS_TABSTOP +END + IDD_GRAPHCFG DIALOG 0, 0, 260, 220 STYLE WS_CHILD | WS_DISABLED FONT 8, "MS Shell Dlg" -- 1.9.1