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
49e58012
Commit
49e58012
authored
Nov 27, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe/tests: Add tests for waiting on timers.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fc230cd4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+51
-0
No files found.
dlls/ntoskrnl.exe/tests/driver.c
View file @
49e58012
...
...
@@ -260,6 +260,8 @@ static void test_sync(void)
{
KSEMAPHORE
semaphore
,
semaphore2
;
KEVENT
manual_event
,
auto_event
;
KTIMER
timer
;
LARGE_INTEGER
timeout
;
void
*
objs
[
2
];
NTSTATUS
ret
;
int
i
;
...
...
@@ -444,6 +446,55 @@ static void test_sync(void)
ok
(
ret
==
0
,
"got %#x
\n
"
,
ret
);
run_thread
(
mutex_thread
,
(
void
*
)
0
);
/* test timers */
KeInitializeTimerEx
(
&
timer
,
NotificationTimer
);
timeout
.
QuadPart
=
-
100
;
KeSetTimerEx
(
&
timer
,
timeout
,
0
,
NULL
);
ret
=
wait_single
(
&
timer
,
0
);
ok
(
ret
==
WAIT_TIMEOUT
,
"got %#x
\n
"
,
ret
);
ret
=
wait_single
(
&
timer
,
-
200
);
ok
(
ret
==
0
,
"got %#x
\n
"
,
ret
);
ret
=
wait_single
(
&
timer
,
0
);
ok
(
ret
==
0
,
"got %#x
\n
"
,
ret
);
KeCancelTimer
(
&
timer
);
KeInitializeTimerEx
(
&
timer
,
SynchronizationTimer
);
KeSetTimerEx
(
&
timer
,
timeout
,
0
,
NULL
);
ret
=
wait_single
(
&
timer
,
0
);
ok
(
ret
==
WAIT_TIMEOUT
,
"got %#x
\n
"
,
ret
);
ret
=
wait_single
(
&
timer
,
-
200
);
ok
(
ret
==
0
,
"got %#x
\n
"
,
ret
);
ret
=
wait_single
(
&
timer
,
0
);
ok
(
ret
==
WAIT_TIMEOUT
,
"got %#x
\n
"
,
ret
);
KeCancelTimer
(
&
timer
);
KeSetTimerEx
(
&
timer
,
timeout
,
10
,
NULL
);
ret
=
wait_single
(
&
timer
,
0
);
ok
(
ret
==
WAIT_TIMEOUT
,
"got %#x
\n
"
,
ret
);
ret
=
wait_single
(
&
timer
,
-
200
);
ok
(
ret
==
0
,
"got %#x
\n
"
,
ret
);
ret
=
wait_single
(
&
timer
,
0
);
ok
(
ret
==
WAIT_TIMEOUT
,
"got %#x
\n
"
,
ret
);
ret
=
wait_single
(
&
timer
,
-
20
*
10000
);
ok
(
ret
==
0
,
"got %#x
\n
"
,
ret
);
ret
=
wait_single
(
&
timer
,
-
20
*
10000
);
ok
(
ret
==
0
,
"got %#x
\n
"
,
ret
);
KeCancelTimer
(
&
timer
);
}
static
NTSTATUS
main_test
(
IRP
*
irp
,
IO_STACK_LOCATION
*
stack
,
ULONG_PTR
*
info
)
...
...
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