winetest.exe - Wine detect patch, take 4.

Jakob Eriksson jakov at vmlinux.org
Wed Apr 21 18:42:27 CDT 2004



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.



regards,
Jakob


-------------- next part --------------
Index: main.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/main.c,v
retrieving revision 1.11
diff -u -b -r1.11 main.c
--- main.c	20 Apr 2004 04:00:07 -0000	1.11
+++ main.c	21 Apr 2004 23:39:25 -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;
@@ -83,6 +97,8 @@
              "    wSuiteMask=%d\n    wProductType=%d\n    wReserved=%d\n",
              ver.wServicePackMajor, ver.wServicePackMinor, ver.wSuiteMask,
              ver.wProductType, ver.wReserved);
+
+    xprintf ("    bRunningUnderWine=%d\n", running_under_wine ());
 }
 
 static inline int is_dot_dir(const char* x)


More information about the wine-patches mailing list