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
bc590e87
Commit
bc590e87
authored
Aug 16, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Aug 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add tests for RegQueryValueEx to show that it sets the data
size to 0 when a buffer isn't present and that it sets the type to REG_NONE on Win9x.
parent
ce5c4d38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
registry.c
dlls/advapi32/registry.c
+10
-1
registry.c
dlls/advapi32/tests/registry.c
+14
-0
No files found.
dlls/advapi32/registry.c
View file @
bc590e87
...
...
@@ -1142,7 +1142,11 @@ LONG WINAPI RegQueryValueExW( HKEY hkey, LPCWSTR name, LPDWORD reserved, LPDWORD
RtlInitUnicodeString
(
&
name_str
,
name
);
if
(
data
)
total_size
=
min
(
sizeof
(
buffer
),
*
count
+
info_size
);
else
total_size
=
info_size
;
else
{
total_size
=
info_size
;
if
(
count
)
*
count
=
0
;
}
status
=
NtQueryValueKey
(
hkey
,
&
name_str
,
KeyValuePartialInformation
,
buffer
,
total_size
,
&
total_size
);
...
...
@@ -1224,6 +1228,11 @@ LONG WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD
if
((
data
&&
!
count
)
||
reserved
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
hkey
=
get_special_root_hkey
(
hkey
)))
return
ERROR_INVALID_HANDLE
;
if
(
!
data
&&
count
)
*
count
=
0
;
/* this matches Win9x behaviour - NT sets *type to a random value */
if
(
type
)
*
type
=
REG_NONE
;
RtlInitAnsiString
(
&
nameA
,
name
);
if
((
status
=
RtlAnsiStringToUnicodeString
(
&
NtCurrentTeb
()
->
StaticUnicodeString
,
&
nameA
,
FALSE
)))
...
...
dlls/advapi32/tests/registry.c
View file @
bc590e87
...
...
@@ -333,11 +333,25 @@ static void test_query_value_ex(void)
DWORD
ret
;
DWORD
size
;
DWORD
type
;
BYTE
buffer
[
10
];
ret
=
RegQueryValueExA
(
hkey_main
,
"TP1_SZ"
,
NULL
,
&
type
,
NULL
,
&
size
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %ld
\n
"
,
ret
);
ok
(
size
==
strlen
(
sTestpath1
)
+
1
,
"(%ld,%ld)
\n
"
,
(
DWORD
)
strlen
(
sTestpath1
)
+
1
,
size
);
ok
(
type
==
REG_SZ
,
"type %ld is not REG_SZ
\n
"
,
type
);
type
=
0xdeadbeef
;
size
=
0xdeadbeef
;
ret
=
RegQueryValueExA
(
HKEY_CLASSES_ROOT
,
"Non Existent Value"
,
NULL
,
&
type
,
NULL
,
&
size
);
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"expected ERROR_FILE_NOT_FOUND, got %ld
\n
"
,
ret
);
ok
(
size
==
0
,
"size should have been set to 0 instead of %ld
\n
"
,
size
);
ok
(
type
==
(
DWORD
)
HKEY_CLASSES_ROOT
/* NT */
||
type
==
0
/* Win9x */
,
"type should have been set to 0x80000000 or 0 instead of 0x%lx
\n
"
,
type
);
size
=
sizeof
(
buffer
);
ret
=
RegQueryValueExA
(
HKEY_CLASSES_ROOT
,
"Non Existent Value"
,
NULL
,
&
type
,
buffer
,
&
size
);
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"expected ERROR_FILE_NOT_FOUND, got %ld
\n
"
,
ret
);
ok
(
size
==
sizeof
(
buffer
),
"size shouldn't have been changed to %ld
\n
"
,
size
);
}
static
void
test_get_value
(
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