winetest.exe - Wine detect patch, take 4.

Ferenc Wagner wferi at afavant.elte.hu
Wed Apr 21 19:04:58 CDT 2004


Jakob Eriksson <jakov at vmlinux.org> writes:

> I don't know what I did, but take 3 was also wrong. *sigh*
>
> Please bear with me.
>
> Anyway, I'm back on vim until I have the time to learn emacs.

:)  Let me move that xprintf to the beginning!

Index: main.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/main.c,v
retrieving revision 1.11
diff -u -r1.11 main.c
--- main.c	20 Apr 2004 04:00:07 -0000	1.11
+++ main.c	22 Apr 2004 00:02:52 -0000
@@ -59,6 +59,20 @@
 
 static const char *wineloader;
 
+static int running_under_wine ()
+{
+    HMODULE module = LoadLibrary("ntdll");
+    FARPROC proc;
+
+    if (!module)
+        return 0;
+
+    proc = GetProcAddress(module, "wine_get_unix_file_name");
+    FreeLibrary(module);
+
+    return proc != NULL;
+}
+
 void print_version ()
 {
     OSVERSIONINFOEX ver;
@@ -72,6 +86,7 @@
 	    report (R_FATAL, "Can't get OS version.");
     }
 
+    xprintf ("    bRunningUnderWine=%d\n", running_under_wine ());
     xprintf ("    dwMajorVersion=%ld\n    dwMinorVersion=%ld\n"
              "    dwBuildNumber=%ld\n    PlatformId=%ld\n    szCSDVersion=%s\n",
              ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber,



More information about the wine-patches mailing list