Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
985bd97c
Commit
985bd97c
authored
Apr 05, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Retrieve Wine version strings through NtQuerySystemInformation().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
beff5c56
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
50 deletions
+63
-50
ntdll.spec
dlls/ntdll/ntdll.spec
+3
-3
loader.c
dlls/ntdll/unix/loader.c
+2
-46
system.c
dlls/ntdll/unix/system.c
+18
-0
version.c
dlls/ntdll/version.c
+37
-0
winternl.h
include/winternl.h
+3
-1
No files found.
dlls/ntdll/ntdll.spec
View file @
985bd97c
...
...
@@ -1623,9 +1623,9 @@
@ cdecl -syscall __wine_locked_recvmsg(long ptr long)
# Version
@ cdecl
-syscall
wine_get_version()
@ cdecl
-syscall
wine_get_build_id()
@ cdecl
-syscall
wine_get_host_version(ptr ptr)
@ cdecl wine_get_version()
@ cdecl wine_get_build_id()
@ cdecl wine_get_host_version(ptr ptr)
# Filesystem
@ cdecl -syscall wine_nt_to_unix_file_name(ptr ptr ptr long)
...
...
dlls/ntdll/unix/loader.c
View file @
985bd97c
...
...
@@ -51,9 +51,6 @@
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
...
...
@@ -335,48 +332,6 @@ static void init_paths( char *argv[] )
}
/*********************************************************************
* wine_get_version
*/
const
char
*
CDECL
wine_get_version
(
void
)
{
return
PACKAGE_VERSION
;
}
/*********************************************************************
* wine_get_build_id
*/
const
char
*
CDECL
wine_get_build_id
(
void
)
{
extern
const
char
wine_build
[];
return
wine_build
;
}
/*********************************************************************
* wine_get_host_version
*/
void
CDECL
wine_get_host_version
(
const
char
**
sysname
,
const
char
**
release
)
{
#ifdef HAVE_SYS_UTSNAME_H
static
struct
utsname
buf
;
static
BOOL
init_done
;
if
(
!
init_done
)
{
uname
(
&
buf
);
init_done
=
TRUE
;
}
if
(
sysname
)
*
sysname
=
buf
.
sysname
;
if
(
release
)
*
release
=
buf
.
release
;
#else
if
(
sysname
)
*
sysname
=
""
;
if
(
release
)
*
release
=
""
;
#endif
}
static
void
preloader_exec
(
char
**
argv
)
{
if
(
use_preloader
)
...
...
@@ -2107,7 +2062,8 @@ static void check_command_line( int argc, char *argv[] )
}
if
(
!
strcmp
(
argv
[
1
],
"--version"
))
{
printf
(
"%s
\n
"
,
wine_get_build_id
()
);
extern
const
char
wine_build
[];
printf
(
"%s
\n
"
,
wine_build
);
exit
(
0
);
}
}
...
...
dlls/ntdll/unix/system.c
View file @
985bd97c
...
...
@@ -40,6 +40,9 @@
#ifdef HAVE_SYS_SYSCTL_H
# include <sys/sysctl.h>
#endif
#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h>
#endif
#ifdef HAVE_MACHINE_CPU_H
# include <machine/cpu.h>
#endif
...
...
@@ -2809,6 +2812,21 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
ret
=
STATUS_SUCCESS
;
break
;
/* Wine extensions */
case
SystemWineVersionInformation
:
{
static
const
char
version
[]
=
PACKAGE_VERSION
;
extern
const
char
wine_build
[];
struct
utsname
buf
;
uname
(
&
buf
);
len
=
strlen
(
version
)
+
strlen
(
wine_build
)
+
strlen
(
buf
.
sysname
)
+
strlen
(
buf
.
release
)
+
4
;
snprintf
(
info
,
size
,
"%s%c%s%c%s%c%s"
,
version
,
0
,
wine_build
,
0
,
buf
.
sysname
,
0
,
buf
.
release
);
if
(
size
<
len
)
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
break
;
}
default
:
FIXME
(
"(0x%08x,%p,0x%08x,%p) stub
\n
"
,
class
,
info
,
size
,
ret_size
);
...
...
dlls/ntdll/version.c
View file @
985bd97c
...
...
@@ -207,6 +207,41 @@ static const struct { WCHAR name[12]; WINDOWS_VERSION ver; } version_names[] =
/* initialized to null so that we crash if we try to retrieve the version too early at startup */
static
const
RTL_OSVERSIONINFOEXW
*
current_version
;
static
char
wine_version
[
256
];
/*********************************************************************
* wine_get_version
*/
const
char
*
CDECL
wine_get_version
(
void
)
{
return
wine_version
;
}
/*********************************************************************
* wine_get_build_id
*/
const
char
*
CDECL
wine_get_build_id
(
void
)
{
const
char
*
p
=
wine_version
;
p
+=
strlen
(
p
)
+
1
;
/* skip version */
return
p
;
}
/*********************************************************************
* wine_get_host_version
*/
void
CDECL
wine_get_host_version
(
const
char
**
sysname
,
const
char
**
release
)
{
const
char
*
p
=
wine_version
;
p
+=
strlen
(
p
)
+
1
;
/* skip version */
p
+=
strlen
(
p
)
+
1
;
/* skip build id */
if
(
sysname
)
*
sysname
=
p
;
p
+=
strlen
(
p
)
+
1
;
if
(
release
)
*
release
=
p
;
}
/**********************************************************************
* get_nt_registry_version
...
...
@@ -430,6 +465,8 @@ void version_init(void)
const
WCHAR
*
p
,
*
appname
=
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
ImagePathName
.
Buffer
;
WCHAR
appversion
[
MAX_PATH
+
20
];
NtQuerySystemInformation
(
SystemWineVersionInformation
,
wine_version
,
sizeof
(
wine_version
),
NULL
);
current_version
=
&
VersionData
[
WIN7
];
RtlOpenCurrentUser
(
KEY_ALL_ACCESS
,
&
root
);
...
...
include/winternl.h
View file @
985bd97c
...
...
@@ -1693,7 +1693,9 @@ typedef enum _SYSTEM_INFORMATION_CLASS {
SystemDifRemovePluginVerificationOnDriver
=
220
,
SystemShadowStackInformation
=
221
,
SystemBuildVersionInformation
=
222
,
SystemInformationClassMax
#ifdef __WINESRC__
SystemWineVersionInformation
=
1000
,
#endif
}
SYSTEM_INFORMATION_CLASS
,
*
PSYSTEM_INFORMATION_CLASS
;
typedef
enum
_THREADINFOCLASS
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment