Hans Leidekker : ntdll: Fix the version reported for 64-bit Windows XP.

Alexandre Julliard julliard at winehq.org
Tue Oct 1 14:54:28 CDT 2013


Module: wine
Branch: master
Commit: b0755344c46886f8ae1f294fdc207166dc6783fc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b0755344c46886f8ae1f294fdc207166dc6783fc

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Oct  1 16:34:20 2013 +0200

ntdll: Fix the version reported for 64-bit Windows XP.

---

 dlls/ntdll/version.c           |   15 +++++++++++++--
 programs/winecfg/appdefaults.c |    4 ++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c
index 86637fc..1939c76 100644
--- a/dlls/ntdll/version.c
+++ b/dlls/ntdll/version.c
@@ -50,6 +50,7 @@ typedef enum
     NT40,    /* Windows NT 4.0 */
     NT2K,    /* Windows 2000 */
     WINXP,   /* Windows XP */
+    WINXP64, /* Windows XP 64-bit */
     WIN2K3,  /* Windows 2003 */
     WINVISTA,/* Windows Vista */
     WIN2K8,  /* Windows 2008 */
@@ -134,6 +135,12 @@ static const RTL_OSVERSIONINFOEXW VersionData[NB_WINDOWS_VERSIONS] =
         {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','3',0},
         3, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 30 /* FIXME: Great, a reserved field with a value! */
     },
+    /* WINXP64 */
+    {
+        sizeof(RTL_OSVERSIONINFOEXW), 5, 2, 0xECE, VER_PLATFORM_WIN32_NT,
+        {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','1',0},
+        1, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
+    },
     /* WIN2K3 */
     {
         sizeof(RTL_OSVERSIONINFOEXW), 5, 2, 0xECE, VER_PLATFORM_WIN32_NT,
@@ -185,6 +192,7 @@ static const char * const WinVersionNames[NB_WINDOWS_VERSIONS] =
     "nt40",                       /* NT40 */
     "win2000,win2k,nt2k,nt2000",  /* NT2K */
     "winxp",                      /* WINXP */
+    "winxp64",                    /* WINXP64 */
     "win2003,win2k3",             /* WIN2K3 */
     "vista,winvista",             /* WINVISTA*/
     "win2008,win2k8",             /* WIN2K8 */
@@ -468,13 +476,16 @@ void version_init( const WCHAR *appname )
 {
     static const WCHAR configW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e',0};
     static const WCHAR appdefaultsW[] = {'A','p','p','D','e','f','a','u','l','t','s','\\',0};
-
+    static const int is_win64 = (sizeof(void *) > sizeof(int));
     OBJECT_ATTRIBUTES attr;
     UNICODE_STRING nameW;
     HANDLE root, hkey, config_key;
     BOOL got_win_ver = FALSE;
 
-    current_version = &VersionData[WINXP];  /* default if nothing else is specified */
+    if (is_win64 || is_wow64)
+        current_version = &VersionData[WINXP64];  /* default if nothing else is specified */
+    else
+        current_version = &VersionData[WINXP];
 
     RtlOpenCurrentUser( KEY_ALL_ACCESS, &root );
     attr.Length = sizeof(attr);
diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c
index c8940a6..fdb0a71 100644
--- a/programs/winecfg/appdefaults.c
+++ b/programs/winecfg/appdefaults.c
@@ -55,6 +55,9 @@ static const struct
     { "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"},
+#ifdef _WIN64
+    { "winxp64",     "Windows XP",        5,  2, 0xECE, VER_PLATFORM_WIN32_NT, "Service Pack 1", 1, 0, "WinNT"},
+#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, ""},
@@ -65,6 +68,7 @@ static const struct
     { "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, ""}
+#endif
 };
 
 #define NB_VERSIONS (sizeof(win_versions)/sizeof(win_versions[0]))




More information about the wine-cvs mailing list