Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9a7dc159
Commit
9a7dc159
authored
Jul 19, 2008
by
Mathias Kosch
Committed by
Alexandre Julliard
Jul 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Fix RegGetValue when dwFlags includes RRF_RT_ANY.
parent
07eeb4e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
registry.c
dlls/advapi32/registry.c
+6
-2
registry.c
dlls/advapi32/tests/registry.c
+10
-0
No files found.
dlls/advapi32/registry.c
View file @
9a7dc159
...
...
@@ -1466,6 +1466,8 @@ static VOID ADVAPI_ApplyRestrictions( DWORD dwFlags, DWORD dwType,
* expanded and pdwType is set to REG_SZ instead.
* - Restrictions are applied after expanding, using RRF_RT_REG_EXPAND_SZ
* without RRF_NOEXPAND is thus not allowed.
* An exception is the case where RRF_RT_ANY is specified, because then
* RRF_NOEXPAND is allowed.
*/
LSTATUS
WINAPI
RegGetValueW
(
HKEY
hKey
,
LPCWSTR
pszSubKey
,
LPCWSTR
pszValue
,
DWORD
dwFlags
,
LPDWORD
pdwType
,
PVOID
pvData
,
...
...
@@ -1481,7 +1483,8 @@ LSTATUS WINAPI RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue,
if
(
pvData
&&
!
pcbData
)
return
ERROR_INVALID_PARAMETER
;
if
((
dwFlags
&
RRF_RT_REG_EXPAND_SZ
)
&&
!
(
dwFlags
&
RRF_NOEXPAND
))
if
((
dwFlags
&
RRF_RT_REG_EXPAND_SZ
)
&&
!
(
dwFlags
&
RRF_NOEXPAND
)
&&
((
dwFlags
&
RRF_RT_ANY
)
!=
RRF_RT_ANY
))
return
ERROR_INVALID_PARAMETER
;
if
(
pszSubKey
&&
pszSubKey
[
0
])
...
...
@@ -1576,7 +1579,8 @@ LSTATUS WINAPI RegGetValueA( HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue,
if
(
pvData
&&
!
pcbData
)
return
ERROR_INVALID_PARAMETER
;
if
((
dwFlags
&
RRF_RT_REG_EXPAND_SZ
)
&&
!
(
dwFlags
&
RRF_NOEXPAND
))
if
((
dwFlags
&
RRF_RT_REG_EXPAND_SZ
)
&&
!
(
dwFlags
&
RRF_NOEXPAND
)
&&
((
dwFlags
&
RRF_RT_ANY
)
!=
RRF_RT_ANY
))
return
ERROR_INVALID_PARAMETER
;
if
(
pszSubKey
&&
pszSubKey
[
0
])
...
...
dlls/advapi32/tests/registry.c
View file @
9a7dc159
...
...
@@ -858,6 +858,16 @@ static void test_get_value(void)
/* Query REG_EXPAND_SZ using RRF_RT_REG_EXPAND_SZ (not allowed without RRF_NOEXPAND) */
ret
=
pRegGetValueA
(
hkey_main
,
NULL
,
"TP1_EXP_SZ"
,
RRF_RT_REG_EXPAND_SZ
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"ret=%d
\n
"
,
ret
);
/* Query REG_EXPAND_SZ using RRF_RT_ANY */
buf
[
0
]
=
0
;
type
=
0xdeadbeef
;
size
=
sizeof
(
buf
);
ret
=
pRegGetValueA
(
hkey_main
,
NULL
,
"TP1_EXP_SZ"
,
RRF_RT_ANY
,
&
type
,
buf
,
&
size
);
ok
(
ret
==
ERROR_SUCCESS
,
"ret=%d
\n
"
,
ret
);
/* At least v5.2.3790.1830 (2003 SP1) returns the unexpanded sTestpath1 length + 1 here. */
ok
(
size
==
strlen
(
expanded
)
+
1
||
broken
(
size
==
strlen
(
sTestpath1
)
+
1
),
"strlen(expanded)=%d, strlen(sTestpath1)=%d, size=%d
\n
"
,
lstrlenA
(
expanded
),
lstrlenA
(
sTestpath1
),
size
);
ok
(
type
==
REG_SZ
,
"type=%d
\n
"
,
type
);
ok
(
!
strcmp
(
expanded
,
buf
),
"expanded=
\"
%s
\"
buf=
\"
%s
\"\n
"
,
expanded
,
buf
);
}
static
void
test_reg_open_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