Alexandre Julliard : winetest: Report information about the CPU and host OS .

Alexandre Julliard julliard at winehq.org
Wed Dec 10 07:41:29 CST 2008


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Dec 10 09:46:02 2008 +0100

winetest: Report information about the CPU and host OS.

---

 programs/winetest/main.c |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 9623039..a6d4425 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -147,10 +147,23 @@ static int running_on_visible_desktop (void)
 
 static void print_version (void)
 {
+#ifdef __i386__
+    static const char platform[] = "i386";
+#elif defined(__x86_64__)
+    static const char platform[] = "x86_64";
+#elif defined(__sparc__)
+    static const char platform[] = "sparc";
+#elif defined(__ALPHA__)
+    static const char platform[] = "alpha";
+#elif defined(__powerpc__)
+    static const char platform[] = "powerpc";
+#endif
     OSVERSIONINFOEX ver;
-    BOOL ext;
+    BOOL ext, wow64;
     int is_win2k3_r2;
-    const char *(*wine_get_build_id)(void);
+    const char *(CDECL *wine_get_build_id)(void);
+    void (CDECL *wine_get_host_version)( const char **sysname, const char **release );
+    BOOL (WINAPI *pIsWow64Process)(HANDLE hProcess, PBOOL Wow64Process);
 
     ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
     if (!(ext = GetVersionEx ((OSVERSIONINFO *) &ver)))
@@ -159,7 +172,10 @@ static void print_version (void)
 	if (!GetVersionEx ((OSVERSIONINFO *) &ver))
 	    report (R_FATAL, "Can't get OS version.");
     }
+    pIsWow64Process = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"),"IsWow64Process");
+    if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &wow64 )) wow64 = FALSE;
 
+    xprintf ("    Platform=%s%s\n", platform, wow64 ? " (WOW64)" : "");
     xprintf ("    bRunningUnderWine=%d\n", running_under_wine ());
     xprintf ("    bRunningOnVisibleDesktop=%d\n", running_on_visible_desktop ());
     xprintf ("    dwMajorVersion=%u\n    dwMinorVersion=%u\n"
@@ -168,8 +184,14 @@ static void print_version (void)
              ver.dwPlatformId, ver.szCSDVersion);
 
     wine_get_build_id = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_build_id");
+    wine_get_host_version = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_host_version");
     if (wine_get_build_id) xprintf( "    WineBuild=%s\n", wine_get_build_id() );
-
+    if (wine_get_host_version)
+    {
+        const char *sysname, *release;
+        wine_get_host_version( &sysname, &release );
+        xprintf( "    Host system=%s\n    Host version=%s\n", sysname, release );
+    }
     is_win2k3_r2 = GetSystemMetrics(SM_SERVERR2);
     if(is_win2k3_r2)
         xprintf("    R2 build number=%d\n", is_win2k3_r2);




More information about the wine-cvs mailing list