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
7e39d1d1
Commit
7e39d1d1
authored
Jun 17, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved version key to HKCU\Software\Wine.
parent
fb99124f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
22 deletions
+14
-22
version.c
dlls/ntdll/version.c
+14
-22
No files found.
dlls/ntdll/version.c
View file @
7e39d1d1
...
@@ -191,7 +191,7 @@ static WINDOWS_VERSION forcedWinVersion; /* init value irrelevant */
...
@@ -191,7 +191,7 @@ static WINDOWS_VERSION forcedWinVersion; /* init value irrelevant */
*/
*/
static
BOOL
parse_win_version
(
HANDLE
hkey
)
static
BOOL
parse_win_version
(
HANDLE
hkey
)
{
{
static
const
WCHAR
WindowsW
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's
'
,
0
};
static
const
WCHAR
VersionW
[]
=
{
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n
'
,
0
};
UNICODE_STRING
valueW
;
UNICODE_STRING
valueW
;
char
tmp
[
64
],
buffer
[
50
];
char
tmp
[
64
],
buffer
[
50
];
...
@@ -199,7 +199,7 @@ static BOOL parse_win_version( HANDLE hkey )
...
@@ -199,7 +199,7 @@ static BOOL parse_win_version( HANDLE hkey )
DWORD
count
,
len
;
DWORD
count
,
len
;
int
i
;
int
i
;
RtlInitUnicodeString
(
&
valueW
,
Windows
W
);
RtlInitUnicodeString
(
&
valueW
,
Version
W
);
if
(
NtQueryValueKey
(
hkey
,
&
valueW
,
KeyValuePartialInformation
,
tmp
,
sizeof
(
tmp
),
&
count
))
if
(
NtQueryValueKey
(
hkey
,
&
valueW
,
KeyValuePartialInformation
,
tmp
,
sizeof
(
tmp
),
&
count
))
return
FALSE
;
return
FALSE
;
...
@@ -246,27 +246,25 @@ void VERSION_Init( const WCHAR *appname )
...
@@ -246,27 +246,25 @@ void VERSION_Init( const WCHAR *appname )
{
{
OBJECT_ATTRIBUTES
attr
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
UNICODE_STRING
nameW
;
HANDLE
hkey
,
config_key
;
HANDLE
root
,
hkey
,
config_key
;
static
const
WCHAR
configW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
static
const
WCHAR
configW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
0
};
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
0
};
static
const
WCHAR
appdefaultsW
[]
=
{
'A'
,
'p'
,
'p'
,
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
's'
,
'\\'
,
0
};
static
const
WCHAR
appdefaultsW
[]
=
{
'A'
,
'p'
,
'p'
,
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
's'
,
'\\'
,
0
};
static
const
WCHAR
versionW
[]
=
{
'\\'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
RtlOpenCurrentUser
(
KEY_ALL_ACCESS
,
&
root
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
RootDirectory
=
root
;
attr
.
ObjectName
=
&
nameW
;
attr
.
ObjectName
=
&
nameW
;
attr
.
Attributes
=
0
;
attr
.
Attributes
=
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
configW
);
RtlInitUnicodeString
(
&
nameW
,
configW
);
if
(
NtOpenKey
(
&
config_key
,
KEY_ALL_ACCESS
,
&
attr
))
return
;
/* @@ Wine registry key: HKCU\Software\Wine */
attr
.
RootDirectory
=
config_key
;
if
(
NtOpenKey
(
&
config_key
,
KEY_ALL_ACCESS
,
&
attr
))
config_key
=
0
;
NtClose
(
root
);
if
(
!
config_key
)
return
;
/* open AppDefaults\\appname
\\Version
key */
/* open AppDefaults\\appname key */
if
(
appname
&&
*
appname
)
if
(
appname
&&
*
appname
)
{
{
const
WCHAR
*
p
;
const
WCHAR
*
p
;
...
@@ -278,11 +276,11 @@ void VERSION_Init( const WCHAR *appname )
...
@@ -278,11 +276,11 @@ void VERSION_Init( const WCHAR *appname )
strcpyW
(
appversion
,
appdefaultsW
);
strcpyW
(
appversion
,
appdefaultsW
);
strcatW
(
appversion
,
appname
);
strcatW
(
appversion
,
appname
);
strcatW
(
appversion
,
versionW
);
TRACE
(
"getting version from %s
\n
"
,
debugstr_w
(
appversion
)
);
TRACE
(
"getting version from %s
\n
"
,
debugstr_w
(
appversion
)
);
RtlInitUnicodeString
(
&
nameW
,
appversion
);
RtlInitUnicodeString
(
&
nameW
,
appversion
);
attr
.
RootDirectory
=
config_key
;
/* @@ Wine registry key: HK
LM\Software\Wine\Wine\Config\AppDefaults\app.exe\Version
*/
/* @@ Wine registry key: HK
CU\Software\Wine\AppDefaults\app.exe
*/
if
(
!
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
))
if
(
!
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
))
{
{
got_win_ver
=
parse_win_version
(
hkey
);
got_win_ver
=
parse_win_version
(
hkey
);
...
@@ -292,13 +290,7 @@ void VERSION_Init( const WCHAR *appname )
...
@@ -292,13 +290,7 @@ void VERSION_Init( const WCHAR *appname )
}
}
TRACE
(
"getting default version
\n
"
);
TRACE
(
"getting default version
\n
"
);
RtlInitUnicodeString
(
&
nameW
,
versionW
+
1
);
parse_win_version
(
config_key
);
/* @@ Wine registry key: HKLM\Software\Wine\Wine\Config\Version */
if
(
!
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
))
{
parse_win_version
(
hkey
);
NtClose
(
hkey
);
}
done:
done:
NtClose
(
config_key
);
NtClose
(
config_key
);
...
...
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