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
590cc1ad
Commit
590cc1ad
authored
Nov 30, 2009
by
Paul Chitescu
Committed by
Alexandre Julliard
Nov 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Reduce registry access to KEY_READ wherever possible.
parent
77b98c9e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
computername.c
dlls/kernel32/computername.c
+4
-4
except.c
dlls/kernel32/except.c
+1
-1
locale.c
dlls/kernel32/locale.c
+1
-1
process.c
dlls/kernel32/process.c
+4
-4
relay16.c
dlls/kernel32/relay16.c
+2
-2
No files found.
dlls/kernel32/computername.c
View file @
590cc1ad
...
...
@@ -206,12 +206,12 @@ static BOOL get_use_dns_option(void)
BOOL
ret
=
TRUE
;
_init_attr
(
&
attr
,
&
nameW
);
RtlOpenCurrentUser
(
KEY_
ALL_ACCESS
,
&
root
);
RtlOpenCurrentUser
(
KEY_
READ
,
&
root
);
attr
.
RootDirectory
=
root
;
RtlInitUnicodeString
(
&
nameW
,
NetworkW
);
/* @@ Wine registry key: HKCU\Software\Wine\Network */
if
(
!
NtOpenKey
(
&
hkey
,
KEY_
ALL_ACCESS
,
&
attr
))
if
(
!
NtOpenKey
(
&
hkey
,
KEY_
READ
,
&
attr
))
{
RtlInitUnicodeString
(
&
nameW
,
UseDNSW
);
if
(
!
NtQueryValueKey
(
hkey
,
&
nameW
,
KeyValuePartialInformation
,
tmp
,
sizeof
(
tmp
),
&
dummy
))
...
...
@@ -321,12 +321,12 @@ BOOL WINAPI GetComputerNameW(LPWSTR name,LPDWORD size)
_init_attr
(
&
attr
,
&
nameW
);
RtlInitUnicodeString
(
&
nameW
,
ComputerW
);
if
(
(
st
=
NtOpenKey
(
&
hkey
,
KEY_
ALL_ACCESS
,
&
attr
)
)
!=
STATUS_SUCCESS
)
if
(
(
st
=
NtOpenKey
(
&
hkey
,
KEY_
READ
,
&
attr
)
)
!=
STATUS_SUCCESS
)
goto
out
;
attr
.
RootDirectory
=
hkey
;
RtlInitUnicodeString
(
&
nameW
,
ActiveComputerNameW
);
if
(
(
st
=
NtOpenKey
(
&
hsubkey
,
KEY_
ALL_ACCESS
,
&
attr
)
)
!=
STATUS_SUCCESS
)
if
(
(
st
=
NtOpenKey
(
&
hsubkey
,
KEY_
READ
,
&
attr
)
)
!=
STATUS_SUCCESS
)
goto
out
;
RtlInitUnicodeString
(
&
nameW
,
ComputerNameW
);
...
...
dlls/kernel32/except.c
View file @
590cc1ad
...
...
@@ -212,7 +212,7 @@ static BOOL start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
AeDebugW
);
if
(
!
NtOpenKey
(
&
hDbgConf
,
KEY_
ALL_ACCESS
,
&
attr
))
if
(
!
NtOpenKey
(
&
hDbgConf
,
KEY_
READ
,
&
attr
))
{
char
buffer
[
64
];
KEY_VALUE_PARTIAL_INFORMATION
*
info
;
...
...
dlls/kernel32/locale.c
View file @
590cc1ad
...
...
@@ -3017,7 +3017,7 @@ static HANDLE NLS_RegOpenKey(HANDLE hRootKey, LPCWSTR szKeyName)
RtlInitUnicodeString
(
&
keyName
,
szKeyName
);
InitializeObjectAttributes
(
&
attr
,
&
keyName
,
0
,
hRootKey
,
NULL
);
if
(
NtOpenKey
(
&
hkey
,
KEY_
ALL_ACCESS
,
&
attr
)
!=
STATUS_SUCCESS
)
if
(
NtOpenKey
(
&
hkey
,
KEY_
READ
,
&
attr
)
!=
STATUS_SUCCESS
)
hkey
=
0
;
return
hkey
;
...
...
dlls/kernel32/process.c
View file @
590cc1ad
...
...
@@ -432,7 +432,7 @@ static BOOL set_registry_environment(void)
/* first the system environment variables */
RtlInitUnicodeString
(
&
nameW
,
env_keyW
);
if
(
NtOpenKey
(
&
hkey
,
KEY_
ALL_ACCESS
,
&
attr
)
==
STATUS_SUCCESS
)
if
(
NtOpenKey
(
&
hkey
,
KEY_
READ
,
&
attr
)
==
STATUS_SUCCESS
)
{
set_registry_variables
(
hkey
,
REG_SZ
);
set_registry_variables
(
hkey
,
REG_EXPAND_SZ
);
...
...
@@ -441,9 +441,9 @@ static BOOL set_registry_environment(void)
}
/* then the ones for the current user */
if
(
RtlOpenCurrentUser
(
KEY_
ALL_ACCESS
,
&
attr
.
RootDirectory
)
!=
STATUS_SUCCESS
)
return
ret
;
if
(
RtlOpenCurrentUser
(
KEY_
READ
,
&
attr
.
RootDirectory
)
!=
STATUS_SUCCESS
)
return
ret
;
RtlInitUnicodeString
(
&
nameW
,
envW
);
if
(
NtOpenKey
(
&
hkey
,
KEY_
ALL_ACCESS
,
&
attr
)
==
STATUS_SUCCESS
)
if
(
NtOpenKey
(
&
hkey
,
KEY_
READ
,
&
attr
)
==
STATUS_SUCCESS
)
{
set_registry_variables
(
hkey
,
REG_SZ
);
set_registry_variables
(
hkey
,
REG_EXPAND_SZ
);
...
...
@@ -542,7 +542,7 @@ static void set_additional_environment(void)
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
profile_keyW
);
if
(
!
NtOpenKey
(
&
hkey
,
KEY_
ALL_ACCESS
,
&
attr
))
if
(
!
NtOpenKey
(
&
hkey
,
KEY_
READ
,
&
attr
))
{
profile_dir
=
get_reg_value
(
hkey
,
profiles_valueW
);
all_users_dir
=
get_reg_value
(
hkey
,
all_users_valueW
);
...
...
dlls/kernel32/relay16.c
View file @
590cc1ad
...
...
@@ -119,7 +119,7 @@ void RELAY16_InitDebugLists(void)
static
const
WCHAR
SnoopIncludeW
[]
=
{
'S'
,
'n'
,
'o'
,
'o'
,
'p'
,
'I'
,
'n'
,
'c'
,
'l'
,
'u'
,
'd'
,
'e'
,
0
};
static
const
WCHAR
SnoopExcludeW
[]
=
{
'S'
,
'n'
,
'o'
,
'o'
,
'p'
,
'E'
,
'x'
,
'c'
,
'l'
,
'u'
,
'd'
,
'e'
,
0
};
RtlOpenCurrentUser
(
KEY_
ALL_ACCESS
,
&
root
);
RtlOpenCurrentUser
(
KEY_
READ
,
&
root
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
root
;
attr
.
ObjectName
=
&
name
;
...
...
@@ -129,7 +129,7 @@ void RELAY16_InitDebugLists(void)
RtlInitUnicodeString
(
&
name
,
configW
);
/* @@ Wine registry key: HKCU\Software\Wine\Debug */
if
(
NtOpenKey
(
&
hkey
,
KEY_
ALL_ACCESS
,
&
attr
))
hkey
=
0
;
if
(
NtOpenKey
(
&
hkey
,
KEY_
READ
,
&
attr
))
hkey
=
0
;
NtClose
(
root
);
if
(
!
hkey
)
return
;
...
...
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