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
87b6d42c
Commit
87b6d42c
authored
May 19, 2015
by
Thomas Faber
Committed by
Alexandre Julliard
May 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Do not fail in RegQueryInfoKey if *class_len is 0.
parent
b6c31bea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
registry.c
dlls/advapi32/registry.c
+3
-2
registry.c
dlls/advapi32/tests/registry.c
+4
-4
No files found.
dlls/advapi32/registry.c
View file @
87b6d42c
...
...
@@ -849,7 +849,7 @@ LSTATUS WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPD
status
=
NtQueryKey
(
hkey
,
KeyFullInformation
,
buffer
,
sizeof
(
buffer
),
&
total_size
);
if
(
status
&&
status
!=
STATUS_BUFFER_OVERFLOW
)
goto
done
;
if
(
class
)
if
(
class
&&
class_len
&&
*
class_len
)
{
/* retry with a dynamically allocated buffer */
while
(
status
==
STATUS_BUFFER_OVERFLOW
)
...
...
@@ -1052,7 +1052,8 @@ LSTATUS WINAPI RegQueryInfoKeyA( HKEY hkey, LPSTR class, LPDWORD class_len, LPDW
RtlUnicodeToMultiByteSize
(
&
len
,
(
WCHAR
*
)(
buf_ptr
+
info
->
ClassOffset
),
info
->
ClassLength
);
if
(
class_len
)
{
if
(
len
+
1
>
*
class_len
)
status
=
STATUS_BUFFER_OVERFLOW
;
if
(
*
class_len
==
0
)
class
=
NULL
;
if
(
class
&&
len
+
1
>
*
class_len
)
status
=
STATUS_BUFFER_OVERFLOW
;
*
class_len
=
len
;
}
if
(
class
&&
!
status
)
...
...
dlls/advapi32/tests/registry.c
View file @
87b6d42c
...
...
@@ -1747,7 +1747,7 @@ static void test_reg_query_info(void)
/* with subkey & default value */
ret
=
RegQueryInfoKeyA
(
subkey
,
NULL
,
&
classlen
,
NULL
,
&
subkeys
,
&
maxsubkeylen
,
&
maxclasslen
,
&
values
,
&
maxvaluenamelen
,
&
maxvaluelen
,
&
sdlen
,
&
lastwrite
);
todo_wine
ok
(
ret
==
ERROR_SUCCESS
,
"ret = %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_SUCCESS
,
"ret = %d
\n
"
,
ret
);
ok
(
classlen
==
strlen
(
subkey_class
),
"classlen = %u
\n
"
,
classlen
);
ok
(
subkeys
==
1
,
"subkeys = %u
\n
"
,
subkeys
);
ok
(
maxsubkeylen
==
strlen
(
"subsubkey"
),
"maxsubkeylen = %u
\n
"
,
maxsubkeylen
);
...
...
@@ -1780,7 +1780,7 @@ static void test_reg_query_info(void)
/* with named value */
ret
=
RegQueryInfoKeyA
(
subkey
,
NULL
,
&
classlen
,
NULL
,
&
subkeys
,
&
maxsubkeylen
,
&
maxclasslen
,
&
values
,
&
maxvaluenamelen
,
&
maxvaluelen
,
&
sdlen
,
&
lastwrite
);
todo_wine
ok
(
ret
==
ERROR_SUCCESS
,
"ret = %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_SUCCESS
,
"ret = %d
\n
"
,
ret
);
ok
(
values
==
3
,
"values = %u
\n
"
,
values
);
ok
(
maxvaluenamelen
==
strlen
(
"value one"
),
"maxvaluenamelen = %u
\n
"
,
maxvaluenamelen
);
ok
(
maxvaluelen
==
sizeof
(
"second value data"
)
*
sizeof
(
WCHAR
),
"maxvaluelen = %u
\n
"
,
maxvaluelen
);
...
...
@@ -1795,7 +1795,7 @@ static void test_reg_query_info(void)
memset
(
classbuffer
,
0x55
,
sizeof
(
classbuffer
));
classlen
=
0
;
ret
=
RegQueryInfoKeyA
(
subkey
,
classbuffer
,
&
classlen
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_SUCCESS
,
"ret = %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_SUCCESS
,
"ret = %d
\n
"
,
ret
);
ok
(
classlen
==
strlen
(
subkey_class
)
/* win2k */
||
classlen
==
0
,
"classlen = %u
\n
"
,
classlen
);
memset
(
expectbuffer
,
0x55
,
sizeof
(
expectbuffer
));
...
...
@@ -1804,7 +1804,7 @@ static void test_reg_query_info(void)
memset
(
classbufferW
,
0x55
,
sizeof
(
classbufferW
));
classlen
=
0
;
ret
=
RegQueryInfoKeyW
(
subkey
,
classbufferW
,
&
classlen
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_SUCCESS
,
"ret = %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_SUCCESS
,
"ret = %d
\n
"
,
ret
);
ok
(
classlen
==
strlen
(
subkey_class
)
/* win2k */
||
classlen
==
0
,
"classlen = %u
\n
"
,
classlen
);
memset
(
expectbufferW
,
0x55
,
sizeof
(
expectbufferW
));
...
...
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