Alexandre Julliard : ntdll: Use syscalls for the Wine version functions.

Alexandre Julliard julliard at winehq.org
Tue Aug 25 16:16:57 CDT 2020


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Aug 25 14:04:23 2020 +0200

ntdll: Use syscalls for the Wine version functions.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/misc.c        | 24 ------------------------
 dlls/ntdll/ntdll.spec    |  6 +++---
 dlls/ntdll/unix/loader.c | 17 +++++++----------
 dlls/ntdll/unixlib.h     |  5 +----
 include/wine/library.h   |  2 --
 loader/main.c            |  2 ++
 6 files changed, 13 insertions(+), 43 deletions(-)

diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c
index a75188e981..9c7708a24a 100644
--- a/dlls/ntdll/misc.c
+++ b/dlls/ntdll/misc.c
@@ -38,30 +38,6 @@ LPCSTR debugstr_us( const UNICODE_STRING *us )
     return debugstr_wn(us->Buffer, us->Length / sizeof(WCHAR));
 }
 
-/*********************************************************************
- *                  wine_get_version   (NTDLL.@)
- */
-const char * CDECL wine_get_version(void)
-{
-    return unix_funcs->get_version();
-}
-
-/*********************************************************************
- *                  wine_get_build_id   (NTDLL.@)
- */
-const char * CDECL wine_get_build_id(void)
-{
-    return unix_funcs->get_build_id();
-}
-
-/*********************************************************************
- *                  wine_get_host_version   (NTDLL.@)
- */
-void CDECL wine_get_host_version( const char **sysname, const char **release )
-{
-    return unix_funcs->get_host_version( sysname, release );
-}
-
 /*********************************************************************
  *                  abs   (NTDLL.@)
  */
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 77fa53f245..5f69cfe785 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -1601,9 +1601,9 @@
 @ cdecl __wine_locked_recvmsg(long ptr long)
 
 # Version
-@ cdecl wine_get_version()
-@ cdecl wine_get_build_id()
-@ cdecl wine_get_host_version(ptr ptr)
+@ cdecl -syscall wine_get_version()
+@ cdecl -syscall wine_get_build_id()
+@ cdecl -syscall wine_get_host_version(ptr ptr)
 
 # Codepages
 @ cdecl __wine_get_unix_codepage()
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index 800d6bf57b..1a449714d0 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -354,18 +354,18 @@ static void init_paths( int argc, char *argv[], char *envp[] )
 
 
 /*********************************************************************
- *                  get_version
+ *                  wine_get_version
  */
-const char * CDECL get_version(void)
+const char * CDECL wine_get_version(void)
 {
     return PACKAGE_VERSION;
 }
 
 
 /*********************************************************************
- *                  get_build_id
+ *                  wine_get_build_id
  */
-const char * CDECL get_build_id(void)
+const char * CDECL wine_get_build_id(void)
 {
     extern const char wine_build[];
     return wine_build;
@@ -373,9 +373,9 @@ const char * CDECL get_build_id(void)
 
 
 /*********************************************************************
- *                  get_host_version
+ *                  wine_get_host_version
  */
-void CDECL get_host_version( const char **sysname, const char **release )
+void CDECL wine_get_host_version( const char **sysname, const char **release )
 {
 #ifdef HAVE_SYS_UTSNAME_H
     static struct utsname buf;
@@ -1346,9 +1346,6 @@ static struct unix_funcs unix_funcs =
     get_initial_directory,
     get_unix_codepage_data,
     get_locales,
-    get_version,
-    get_build_id,
-    get_host_version,
     virtual_map_section,
     virtual_locked_recvmsg,
     virtual_release_address_space,
@@ -1604,7 +1601,7 @@ static void check_command_line( int argc, char *argv[] )
     }
     if (!strcmp( argv[1], "--version" ))
     {
-        printf( "%s\n", get_build_id() );
+        printf( "%s\n", wine_get_build_id() );
         exit(0);
     }
 }
diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h
index 22ccb0911b..d3fedc196b 100644
--- a/dlls/ntdll/unixlib.h
+++ b/dlls/ntdll/unixlib.h
@@ -28,7 +28,7 @@ struct msghdr;
 struct _DISPATCHER_CONTEXT;
 
 /* increment this when you change the function table */
-#define NTDLL_UNIXLIB_VERSION 96
+#define NTDLL_UNIXLIB_VERSION 97
 
 struct unix_funcs
 {
@@ -78,9 +78,6 @@ struct unix_funcs
     void          (CDECL *get_initial_directory)( UNICODE_STRING *dir );
     USHORT *      (CDECL *get_unix_codepage_data)(void);
     void          (CDECL *get_locales)( WCHAR *sys, WCHAR *user );
-    const char *  (CDECL *get_version)(void);
-    const char *  (CDECL *get_build_id)(void);
-    void          (CDECL *get_host_version)( const char **sysname, const char **release );
 
     /* virtual memory functions */
     NTSTATUS      (CDECL *virtual_map_section)( HANDLE handle, PVOID *addr_ptr, unsigned short zero_bits_64, SIZE_T commit_size,
diff --git a/include/wine/library.h b/include/wine/library.h
index 090b834955..405ce0d9da 100644
--- a/include/wine/library.h
+++ b/include/wine/library.h
@@ -41,8 +41,6 @@ extern "C" {
 
 /* configuration */
 
-extern const char *wine_get_version(void);
-extern const char *wine_get_build_id(void);
 extern void wine_init_argv0_path( const char *argv0 );
 extern void wine_exec_wine_binary( const char *name, char **argv, const char *env_var );
 
diff --git a/loader/main.c b/loader/main.c
index 3c06728504..a92276fa41 100644
--- a/loader/main.c
+++ b/loader/main.c
@@ -42,6 +42,8 @@
 
 extern char **environ;
 
+extern const char *wine_get_build_id(void);
+
 /* the preloader will set this variable */
 const struct wine_preload_info *wine_main_preload_info = NULL;
 




More information about the wine-cvs mailing list