ntdll: Use syscalls for the Wine version functions.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-08-25 14:04:23 +02:00
parent 482b64effd
commit af1a328fa0
6 changed files with 13 additions and 43 deletions

View File

@ -38,30 +38,6 @@ LPCSTR debugstr_us( const UNICODE_STRING *us )
return debugstr_wn(us->Buffer, us->Length / sizeof(WCHAR)); 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.@) * abs (NTDLL.@)
*/ */

View File

@ -1601,9 +1601,9 @@
@ cdecl __wine_locked_recvmsg(long ptr long) @ cdecl __wine_locked_recvmsg(long ptr long)
# Version # Version
@ cdecl wine_get_version() @ cdecl -syscall wine_get_version()
@ cdecl wine_get_build_id() @ cdecl -syscall wine_get_build_id()
@ cdecl wine_get_host_version(ptr ptr) @ cdecl -syscall wine_get_host_version(ptr ptr)
# Codepages # Codepages
@ cdecl __wine_get_unix_codepage() @ cdecl __wine_get_unix_codepage()

View File

@ -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; 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[]; extern const char wine_build[];
return 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 #ifdef HAVE_SYS_UTSNAME_H
static struct utsname buf; static struct utsname buf;
@ -1346,9 +1346,6 @@ static struct unix_funcs unix_funcs =
get_initial_directory, get_initial_directory,
get_unix_codepage_data, get_unix_codepage_data,
get_locales, get_locales,
get_version,
get_build_id,
get_host_version,
virtual_map_section, virtual_map_section,
virtual_locked_recvmsg, virtual_locked_recvmsg,
virtual_release_address_space, virtual_release_address_space,
@ -1604,7 +1601,7 @@ static void check_command_line( int argc, char *argv[] )
} }
if (!strcmp( argv[1], "--version" )) if (!strcmp( argv[1], "--version" ))
{ {
printf( "%s\n", get_build_id() ); printf( "%s\n", wine_get_build_id() );
exit(0); exit(0);
} }
} }

View File

@ -28,7 +28,7 @@ struct msghdr;
struct _DISPATCHER_CONTEXT; struct _DISPATCHER_CONTEXT;
/* increment this when you change the function table */ /* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 96 #define NTDLL_UNIXLIB_VERSION 97
struct unix_funcs struct unix_funcs
{ {
@ -78,9 +78,6 @@ struct unix_funcs
void (CDECL *get_initial_directory)( UNICODE_STRING *dir ); void (CDECL *get_initial_directory)( UNICODE_STRING *dir );
USHORT * (CDECL *get_unix_codepage_data)(void); USHORT * (CDECL *get_unix_codepage_data)(void);
void (CDECL *get_locales)( WCHAR *sys, WCHAR *user ); 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 */ /* virtual memory functions */
NTSTATUS (CDECL *virtual_map_section)( HANDLE handle, PVOID *addr_ptr, unsigned short zero_bits_64, SIZE_T commit_size, NTSTATUS (CDECL *virtual_map_section)( HANDLE handle, PVOID *addr_ptr, unsigned short zero_bits_64, SIZE_T commit_size,

View File

@ -41,8 +41,6 @@ extern "C" {
/* configuration */ /* 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_init_argv0_path( const char *argv0 );
extern void wine_exec_wine_binary( const char *name, char **argv, const char *env_var ); extern void wine_exec_wine_binary( const char *name, char **argv, const char *env_var );

View File

@ -42,6 +42,8 @@
extern char **environ; extern char **environ;
extern const char *wine_get_build_id(void);
/* the preloader will set this variable */ /* the preloader will set this variable */
const struct wine_preload_info *wine_main_preload_info = NULL; const struct wine_preload_info *wine_main_preload_info = NULL;