Alexandre Julliard : ntdll: Add a function to export the host OS type and version.

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


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Dec  9 19:33:06 2008 +0100

ntdll: Add a function to export the host OS type and version.

---

 configure             |    2 ++
 configure.ac          |    1 +
 dlls/ntdll/misc.c     |   25 +++++++++++++++++++++++++
 dlls/ntdll/ntdll.spec |    1 +
 include/config.h.in   |    3 +++
 5 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 1ff8e1f..eaa4da7 100755
--- a/configure
+++ b/configure
@@ -7437,6 +7437,7 @@ done
 
 
 
+
 for ac_header in \
 	AudioUnit/AudioUnit.h \
 	Carbon/Carbon.h \
@@ -7543,6 +7544,7 @@ for ac_header in \
 	sys/times.h \
 	sys/uio.h \
 	sys/un.h \
+	sys/utsname.h \
 	sys/vm86.h \
 	sys/wait.h \
 	syscall.h \
diff --git a/configure.ac b/configure.ac
index 1dce0d1..071013c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -344,6 +344,7 @@ AC_CHECK_HEADERS(\
 	sys/times.h \
 	sys/uio.h \
 	sys/un.h \
+	sys/utsname.h \
 	sys/vm86.h \
 	sys/wait.h \
 	syscall.h \
diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c
index 218c289..5272c87 100644
--- a/dlls/ntdll/misc.c
+++ b/dlls/ntdll/misc.c
@@ -22,6 +22,9 @@
 
 #include <time.h>
 #include <math.h>
+#ifdef HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
 
 #include "wine/library.h"
 #include "wine/debug.h"
@@ -156,6 +159,28 @@ const char * CDECL NTDLL_wine_get_build_id(void)
 }
 
 /*********************************************************************
+ *                  wine_get_host_version   (NTDLL.@)
+ */
+void CDECL NTDLL_wine_get_host_version( const char **sysname, const char **release )
+{
+#ifdef HAVE_SYS_UTSNAME_H
+    static struct utsname buf;
+    static int init_done;
+
+    if (!init_done)
+    {
+        uname( &buf );
+        init_done = 1;
+    }
+    if (sysname) *sysname = buf.sysname;
+    if (release) *release = buf.release;
+#else
+    if (sysname) *sysname = "";
+    if (release) *release = "";
+#endif
+}
+
+/*********************************************************************
  *                  abs   (NTDLL.@)
  */
 int CDECL NTDLL_abs( int i )
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index d4c8d4e..442516e 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -1384,6 +1384,7 @@
 # Version
 @ cdecl wine_get_version() NTDLL_wine_get_version
 @ cdecl wine_get_build_id() NTDLL_wine_get_build_id
+@ cdecl wine_get_host_version(ptr ptr) NTDLL_wine_get_host_version
 
 # Codepages
 @ cdecl __wine_init_codepages(ptr ptr ptr)
diff --git a/include/config.h.in b/include/config.h.in
index 84c41de..c45765e 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -897,6 +897,9 @@
 /* Define to 1 if you have the <sys/user.h> header file. */
 #undef HAVE_SYS_USER_H
 
+/* Define to 1 if you have the <sys/utsname.h> header file. */
+#undef HAVE_SYS_UTSNAME_H
+
 /* Define to 1 if you have the <sys/vfs.h> header file. */
 #undef HAVE_SYS_VFS_H
 




More information about the wine-cvs mailing list