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
7cbaf1f5
Commit
7cbaf1f5
authored
Mar 22, 2017
by
Vitaly Lipatov
Committed by
Alexandre Julliard
Mar 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add test prototype for RegQueryValueEx HKEY_PERFORMANCE_DATA.
Signed-off-by:
Vitaly Lipatov
<
lav@etersoft.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2884205d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
registry.c
dlls/advapi32/tests/registry.c
+50
-0
No files found.
dlls/advapi32/tests/registry.c
View file @
7cbaf1f5
...
...
@@ -27,6 +27,7 @@
#include "winbase.h"
#include "winternl.h"
#include "winreg.h"
#include "winperf.h"
#include "winsvc.h"
#include "winerror.h"
#include "aclapi.h"
...
...
@@ -3480,6 +3481,54 @@ static void test_RegNotifyChangeKeyValue(void)
CloseHandle
(
event
);
}
static
void
test_RegQueryValueExPerformanceData
(
void
)
{
DWORD
cbData
,
len
;
BYTE
*
value
;
DWORD
dwret
;
LONG
limit
=
6
;
PERF_DATA_BLOCK
*
pdb
;
/* Test with data == NULL */
dwret
=
RegQueryValueExA
(
HKEY_PERFORMANCE_DATA
,
"Global"
,
NULL
,
NULL
,
NULL
,
&
cbData
);
todo_wine
ok
(
dwret
==
ERROR_MORE_DATA
,
"expected ERROR_MORE_DATA, got %d
\n
"
,
dwret
);
/* Test ERROR_MORE_DATA, start with small buffer */
len
=
10
;
value
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
cbData
=
len
;
dwret
=
RegQueryValueExA
(
HKEY_PERFORMANCE_DATA
,
"Global"
,
NULL
,
NULL
,
value
,
&
cbData
);
todo_wine
ok
(
dwret
==
ERROR_MORE_DATA
,
"expected ERROR_MORE_DATA, got %d
\n
"
,
dwret
);
while
(
dwret
==
ERROR_MORE_DATA
&&
limit
)
{
len
=
len
*
10
;
value
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
value
,
len
);
cbData
=
len
;
dwret
=
RegQueryValueExA
(
HKEY_PERFORMANCE_DATA
,
"Global"
,
NULL
,
NULL
,
value
,
&
cbData
);
limit
--
;
}
ok
(
limit
>
0
,
"too many times ERROR_MORE_DATA returned
\n
"
);
todo_wine
ok
(
dwret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
dwret
);
/* Check returned data */
if
(
dwret
==
ERROR_SUCCESS
)
{
todo_wine
ok
(
len
>=
sizeof
(
PERF_DATA_BLOCK
),
"got size %d
\n
"
,
len
);
if
(
len
>=
sizeof
(
PERF_DATA_BLOCK
))
{
pdb
=
(
PERF_DATA_BLOCK
*
)
value
;
ok
(
pdb
->
Signature
[
0
]
==
'P'
,
"expected Signature[0] = 'P', got 0x%x
\n
"
,
pdb
->
Signature
[
0
]);
ok
(
pdb
->
Signature
[
1
]
==
'E'
,
"expected Signature[1] = 'E', got 0x%x
\n
"
,
pdb
->
Signature
[
1
]);
ok
(
pdb
->
Signature
[
2
]
==
'R'
,
"expected Signature[2] = 'R', got 0x%x
\n
"
,
pdb
->
Signature
[
2
]);
ok
(
pdb
->
Signature
[
3
]
==
'F'
,
"expected Signature[3] = 'F', got 0x%x
\n
"
,
pdb
->
Signature
[
3
]);
/* TODO: check other field */
}
}
HeapFree
(
GetProcessHeap
(),
0
,
value
);
}
START_TEST
(
registry
)
{
/* Load pointers for functions that are not available in all Windows versions */
...
...
@@ -3515,6 +3564,7 @@ START_TEST(registry)
test_delete_key_value
();
test_RegOpenCurrentUser
();
test_RegNotifyChangeKeyValue
();
test_RegQueryValueExPerformanceData
();
/* cleanup */
delete_key
(
hkey_main
);
...
...
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