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
daafda22
Commit
daafda22
authored
Jul 24, 2008
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Jul 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Remove access checks from advapi32 (makes KEY_WOW64_* work).
parent
140b259d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
registry.c
dlls/advapi32/registry.c
+0
-5
registry.c
dlls/advapi32/tests/registry.c
+22
-0
No files found.
dlls/advapi32/registry.c
View file @
daafda22
...
...
@@ -44,9 +44,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
reg
);
/* allowed bits for access mask */
#define KEY_ACCESS_MASK (KEY_ALL_ACCESS | MAXIMUM_ALLOWED)
#define HKEY_SPECIAL_ROOT_FIRST HKEY_CLASSES_ROOT
#define HKEY_SPECIAL_ROOT_LAST HKEY_DYN_DATA
#define NB_SPECIAL_ROOT_KEYS ((UINT)HKEY_SPECIAL_ROOT_LAST - (UINT)HKEY_SPECIAL_ROOT_FIRST + 1)
...
...
@@ -188,7 +185,6 @@ LSTATUS WINAPI RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD reserved, LPWSTR
UNICODE_STRING
nameW
,
classW
;
if
(
reserved
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
access
&
KEY_ACCESS_MASK
)
||
(
access
&
~
KEY_ACCESS_MASK
))
return
ERROR_ACCESS_DENIED
;
if
(
!
(
hkey
=
get_special_root_hkey
(
hkey
)))
return
ERROR_INVALID_HANDLE
;
attr
.
Length
=
sizeof
(
attr
);
...
...
@@ -243,7 +239,6 @@ LSTATUS WINAPI RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, LPSTR cl
access
=
KEY_ALL_ACCESS
;
/* Win95 ignores the access mask */
if
(
name
&&
*
name
==
'\\'
)
name
++
;
/* win9x,ME ignores one (and only one) beginning backslash */
}
else
if
(
!
(
access
&
KEY_ACCESS_MASK
)
||
(
access
&
~
KEY_ACCESS_MASK
))
return
ERROR_ACCESS_DENIED
;
if
(
!
(
hkey
=
get_special_root_hkey
(
hkey
)))
return
ERROR_INVALID_HANDLE
;
attr
.
Length
=
sizeof
(
attr
);
...
...
dlls/advapi32/tests/registry.c
View file @
daafda22
...
...
@@ -949,6 +949,17 @@ static void test_reg_open_key(void)
ok
(
ret
==
ERROR_BAD_PATHNAME
||
/* NT/2k/XP */
ret
==
ERROR_FILE_NOT_FOUND
/* Win9x,ME */
,
"expected ERROR_BAD_PATHNAME or ERROR_FILE_NOT_FOUND, got %d
\n
"
,
ret
);
/* WOW64 flags */
hkResult
=
NULL
;
ret
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software"
,
0
,
KEY_READ
|
KEY_WOW64_32KEY
,
&
hkResult
);
ok
(
ret
==
ERROR_SUCCESS
&&
hkResult
!=
NULL
,
"RegOpenKeyEx with KEY_WOW64_32KEY failed (err=%u)
\n
"
,
ret
);
RegCloseKey
(
hkResult
);
hkResult
=
NULL
;
ret
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software"
,
0
,
KEY_READ
|
KEY_WOW64_64KEY
,
&
hkResult
);
ok
(
ret
==
ERROR_SUCCESS
&&
hkResult
!=
NULL
,
"RegOpenKeyEx with KEY_WOW64_64KEY failed (err=%u)
\n
"
,
ret
);
RegCloseKey
(
hkResult
);
}
static
void
test_reg_create_key
(
void
)
...
...
@@ -974,6 +985,17 @@ static void test_reg_create_key(void)
ok
(
!
ret
,
"RegCreateKeyExA failed with error %d
\n
"
,
ret
);
RegDeleteKey
(
hkey1
,
NULL
);
}
/* WOW64 flags - open an existing key */
hkey1
=
NULL
;
ret
=
RegCreateKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software"
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WOW64_32KEY
,
NULL
,
&
hkey1
,
NULL
);
ok
(
ret
==
ERROR_SUCCESS
&&
hkey1
!=
NULL
,
"RegOpenKeyEx with KEY_WOW64_32KEY failed (err=%u)
\n
"
,
ret
);
RegCloseKey
(
hkey1
);
hkey1
=
NULL
;
ret
=
RegCreateKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software"
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WOW64_32KEY
,
NULL
,
&
hkey1
,
NULL
);
ok
(
ret
==
ERROR_SUCCESS
&&
hkey1
!=
NULL
,
"RegOpenKeyEx with KEY_WOW64_64KEY failed (err=%u)
\n
"
,
ret
);
RegCloseKey
(
hkey1
);
}
static
void
test_reg_close_key
(
void
)
...
...
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