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
8dee2df6
Commit
8dee2df6
authored
May 03, 2018
by
Daniel Lehman
Committed by
Alexandre Julliard
May 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add RegNotifyChangeKeyValue tests.
Signed-off-by:
Daniel Lehman
<
dlehman@esri.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
950b3498
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
2 deletions
+42
-2
registry.c
dlls/advapi32/tests/registry.c
+42
-2
No files found.
dlls/advapi32/tests/registry.c
View file @
8dee2df6
...
@@ -3484,7 +3484,7 @@ static DWORD WINAPI notify_change_thread(void *arg)
...
@@ -3484,7 +3484,7 @@ static DWORD WINAPI notify_change_thread(void *arg)
static
void
test_RegNotifyChangeKeyValue
(
void
)
static
void
test_RegNotifyChangeKeyValue
(
void
)
{
{
struct
notify_data
data
;
struct
notify_data
data
;
HKEY
key
,
subkey
;
HKEY
key
,
subkey
,
subsubkey
;
HANDLE
thread
;
HANDLE
thread
;
HANDLE
event
;
HANDLE
event
;
DWORD
dwret
;
DWORD
dwret
;
...
@@ -3495,7 +3495,7 @@ static void test_RegNotifyChangeKeyValue(void)
...
@@ -3495,7 +3495,7 @@ static void test_RegNotifyChangeKeyValue(void)
ret
=
RegCreateKeyA
(
hkey_main
,
"TestKey"
,
&
key
);
ret
=
RegCreateKeyA
(
hkey_main
,
"TestKey"
,
&
key
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ret
=
RegNotifyChangeKeyValue
(
key
,
TRUE
,
REG_NOTIFY_CHANGE_NAME
,
event
,
TRUE
);
ret
=
RegNotifyChangeKeyValue
(
key
,
TRUE
,
REG_NOTIFY_CHANGE_NAME
|
REG_NOTIFY_CHANGE_LAST_SET
,
event
,
TRUE
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
dwret
=
WaitForSingleObject
(
event
,
0
);
dwret
=
WaitForSingleObject
(
event
,
0
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %u
\n
"
,
dwret
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %u
\n
"
,
dwret
);
...
@@ -3505,7 +3505,47 @@ static void test_RegNotifyChangeKeyValue(void)
...
@@ -3505,7 +3505,47 @@ static void test_RegNotifyChangeKeyValue(void)
dwret
=
WaitForSingleObject
(
event
,
0
);
dwret
=
WaitForSingleObject
(
event
,
0
);
ok
(
dwret
==
WAIT_OBJECT_0
,
"expected WAIT_OBJECT_0, got %u
\n
"
,
dwret
);
ok
(
dwret
==
WAIT_OBJECT_0
,
"expected WAIT_OBJECT_0, got %u
\n
"
,
dwret
);
/* watching deeper keys */
ret
=
RegNotifyChangeKeyValue
(
key
,
TRUE
,
REG_NOTIFY_CHANGE_NAME
|
REG_NOTIFY_CHANGE_LAST_SET
,
event
,
TRUE
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
dwret
=
WaitForSingleObject
(
event
,
0
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %u
\n
"
,
dwret
);
ret
=
RegCreateKeyA
(
subkey
,
"SubKey"
,
&
subsubkey
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
dwret
=
WaitForSingleObject
(
event
,
0
);
ok
(
dwret
==
WAIT_OBJECT_0
,
"expected WAIT_OBJECT_0, got %u
\n
"
,
dwret
);
/* watching deeper values */
ret
=
RegNotifyChangeKeyValue
(
key
,
TRUE
,
REG_NOTIFY_CHANGE_NAME
|
REG_NOTIFY_CHANGE_LAST_SET
,
event
,
TRUE
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
dwret
=
WaitForSingleObject
(
event
,
0
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %u
\n
"
,
dwret
);
ret
=
RegSetValueA
(
subsubkey
,
NULL
,
REG_SZ
,
"SubSubKeyValue"
,
0
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
dwret
=
WaitForSingleObject
(
event
,
0
);
todo_wine
ok
(
dwret
==
WAIT_OBJECT_0
,
"expected WAIT_OBJECT_0, got %u
\n
"
,
dwret
);
/* don't watch deeper values */
RegCloseKey
(
key
);
ret
=
RegOpenKeyA
(
hkey_main
,
"TestKey"
,
&
key
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ret
=
RegNotifyChangeKeyValue
(
key
,
FALSE
,
REG_NOTIFY_CHANGE_NAME
|
REG_NOTIFY_CHANGE_LAST_SET
,
event
,
TRUE
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
dwret
=
WaitForSingleObject
(
event
,
0
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %u
\n
"
,
dwret
);
ret
=
RegSetValueA
(
subsubkey
,
NULL
,
REG_SZ
,
"SubSubKeyValueNEW"
,
0
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
dwret
=
WaitForSingleObject
(
event
,
0
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %u
\n
"
,
dwret
);
RegDeleteKeyA
(
subkey
,
"SubKey"
);
RegDeleteKeyA
(
key
,
"SubKey"
);
RegDeleteKeyA
(
key
,
"SubKey"
);
RegCloseKey
(
subsubkey
);
RegCloseKey
(
subkey
);
RegCloseKey
(
key
);
RegCloseKey
(
key
);
/* test same thread with REG_NOTIFY_THREAD_AGNOSTIC */
/* test same thread with REG_NOTIFY_THREAD_AGNOSTIC */
...
...
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