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
817d903c
Commit
817d903c
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: Write back partial results in RegQueryInfoKeyA.
parent
87b6d42c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
registry.c
dlls/advapi32/registry.c
+11
-11
registry.c
dlls/advapi32/tests/registry.c
+4
-4
No files found.
dlls/advapi32/registry.c
View file @
817d903c
...
...
@@ -1049,18 +1049,18 @@ LSTATUS WINAPI RegQueryInfoKeyA( HKEY hkey, LPSTR class, LPDWORD class_len, LPDW
if
(
status
)
goto
done
;
RtlUnicodeToMultiByteSize
(
&
len
,
(
WCHAR
*
)(
buf_ptr
+
info
->
ClassOffset
),
info
->
ClassLength
);
if
(
class_len
)
len
=
0
;
if
(
class
&&
class_len
)
len
=
*
class_len
;
RtlUnicodeToMultiByteN
(
class
,
len
,
class_len
,
(
WCHAR
*
)(
buf_ptr
+
info
->
ClassOffset
),
info
->
ClassLength
);
if
(
len
)
{
if
(
*
class_len
==
0
)
class
=
NULL
;
if
(
class
&&
len
+
1
>
*
class_len
)
status
=
STATUS_BUFFER_OVERFLOW
;
*
class_len
=
len
;
}
if
(
class
&&
!
status
)
{
RtlUnicodeToMultiByteN
(
class
,
len
,
NULL
,
(
WCHAR
*
)(
buf_ptr
+
info
->
ClassOffset
),
info
->
ClassLength
);
class
[
len
]
=
0
;
class
[
len
-
1
]
=
0
;
if
(
*
class_len
+
1
>
len
)
{
status
=
STATUS_BUFFER_OVERFLOW
;
*
class_len
-=
1
;
}
}
}
else
status
=
STATUS_SUCCESS
;
...
...
dlls/advapi32/tests/registry.c
View file @
817d903c
...
...
@@ -1815,10 +1815,10 @@ static void test_reg_query_info(void)
classlen
=
1
;
ret
=
RegQueryInfoKeyA
(
subkey
,
classbuffer
,
&
classlen
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_MORE_DATA
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
classlen
==
0
,
"classlen = %u
\n
"
,
classlen
);
ok
(
classlen
==
0
,
"classlen = %u
\n
"
,
classlen
);
memset
(
expectbuffer
,
0x55
,
sizeof
(
expectbuffer
));
expectbuffer
[
0
]
=
0
;
todo_wine
ok
(
!
memcmp
(
classbuffer
,
expectbuffer
,
sizeof
(
classbuffer
)),
"classbuffer was modified
\n
"
);
ok
(
!
memcmp
(
classbuffer
,
expectbuffer
,
sizeof
(
classbuffer
)),
"classbuffer was modified
\n
"
);
memset
(
classbufferW
,
0x55
,
sizeof
(
classbufferW
));
classlen
=
1
;
...
...
@@ -1834,12 +1834,12 @@ static void test_reg_query_info(void)
classlen
=
sizeof
(
subkey_class
)
-
1
;
ret
=
RegQueryInfoKeyA
(
subkey
,
classbuffer
,
&
classlen
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_MORE_DATA
,
"ret = %d
\n
"
,
ret
);
todo_wine
ok
(
classlen
==
sizeof
(
subkey_class
)
-
2
,
"classlen = %u
\n
"
,
classlen
);
ok
(
classlen
==
sizeof
(
subkey_class
)
-
2
,
"classlen = %u
\n
"
,
classlen
);
memset
(
expectbuffer
,
0x55
,
sizeof
(
expectbuffer
));
strcpy
(
expectbuffer
,
subkey_class
);
expectbuffer
[
sizeof
(
subkey_class
)
-
2
]
=
0
;
expectbuffer
[
sizeof
(
subkey_class
)
-
1
]
=
0x55
;
todo_wine
ok
(
!
memcmp
(
classbuffer
,
expectbuffer
,
sizeof
(
classbuffer
)),
ok
(
!
memcmp
(
classbuffer
,
expectbuffer
,
sizeof
(
classbuffer
)),
"classbuffer = %.*s, expected %s
\n
"
,
(
int
)
sizeof
(
classbuffer
),
classbuffer
,
expectbuffer
);
...
...
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