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
d6d6ce29
Commit
d6d6ce29
authored
Feb 03, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
Feb 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Added conformance test for nested thread wakeups in the server.
parent
49868e3c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
change.c
dlls/kernel32/tests/change.c
+46
-0
No files found.
dlls/kernel32/tests/change.c
View file @
d6d6ce29
...
...
@@ -317,6 +317,48 @@ static void test_ffcn(void)
ok
(
r
==
TRUE
,
"failed to remove dir
\n
"
);
}
/* this test concentrates on the wait behavior when multiple threads are
* waiting on a change notification handle. */
static
void
test_ffcnMultipleThreads
()
{
LONG
r
;
DWORD
filter
,
threadId
,
status
,
exitcode
;
HANDLE
handles
[
2
];
char
path
[
MAX_PATH
];
r
=
GetTempPathA
(
MAX_PATH
,
path
);
ok
(
r
,
"GetTempPathA error: %d
\n
"
,
GetLastError
());
lstrcatA
(
path
,
"ffcnTestMultipleThreads"
);
RemoveDirectoryA
(
path
);
r
=
CreateDirectoryA
(
path
,
NULL
);
ok
(
r
,
"CreateDirectoryA error: %d
\n
"
,
GetLastError
());
filter
=
FILE_NOTIFY_CHANGE_FILE_NAME
;
filter
|=
FILE_NOTIFY_CHANGE_DIR_NAME
;
handles
[
0
]
=
FindFirstChangeNotificationA
(
path
,
FALSE
,
filter
);
ok
(
handles
[
0
]
!=
INVALID_HANDLE_VALUE
,
"FindFirstChangeNotification error: %d
\n
"
,
GetLastError
());
/* Test behavior if a waiting thread holds the last reference to a change
* directory object with an empty wine user APC queue for this thread (bug #7286) */
/* Create our notification thread */
handles
[
1
]
=
CreateThread
(
NULL
,
0
,
NotificationThread
,
(
LPVOID
)
handles
[
0
],
0
,
&
threadId
);
ok
(
handles
[
1
]
!=
NULL
,
"CreateThread error: %d
\n
"
,
GetLastError
());
status
=
WaitForMultipleObjects
(
2
,
handles
,
FALSE
,
5000
);
ok
(
status
==
WAIT_OBJECT_0
||
status
==
WAIT_OBJECT_0
+
1
,
"WaitForMultipleObjects status %d error %d
\n
"
,
status
,
GetLastError
());
ok
(
GetExitCodeThread
(
handles
[
1
],
&
exitcode
),
"Could not retrieve thread exit code
\n
"
);
/* Clean up */
r
=
RemoveDirectoryA
(
path
);
ok
(
r
==
TRUE
,
"failed to remove dir
\n
"
);
}
typedef
BOOL
(
WINAPI
*
fnReadDirectoryChangesW
)(
HANDLE
,
LPVOID
,
DWORD
,
BOOL
,
DWORD
,
LPDWORD
,
LPOVERLAPPED
,
LPOVERLAPPED_COMPLETION_ROUTINE
);
fnReadDirectoryChangesW
pReadDirectoryChangesW
;
...
...
@@ -708,6 +750,10 @@ START_TEST(change)
pReadDirectoryChangesW
=
(
fnReadDirectoryChangesW
)
GetProcAddress
(
hkernel32
,
"ReadDirectoryChangesW"
);
test_ffcnMultipleThreads
();
/* The above function runs a test that must occur before FindCloseChangeNotification is run in the
current thread to preserve the emptiness of the wine user APC queue. To ensure this it should be
placed first. */
test_FindFirstChangeNotification
();
test_ffcn
();
test_readdirectorychanges
();
...
...
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