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
2b6cf134
Commit
2b6cf134
authored
Aug 20, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe/tests: Add tests for remove locks.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
59f72d87
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
1 deletion
+54
-1
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+54
-1
No files found.
dlls/ntoskrnl.exe/tests/driver.c
View file @
2b6cf134
...
...
@@ -427,16 +427,33 @@ static void WINAPI mutex_thread(void *arg)
PsTerminateSystemThread
(
STATUS_SUCCESS
);
}
static
KEVENT
remove_lock_ready
;
static
void
WINAPI
remove_lock_thread
(
void
*
arg
)
{
IO_REMOVE_LOCK
*
lock
=
arg
;
NTSTATUS
ret
;
ret
=
IoAcquireRemoveLockEx
(
lock
,
NULL
,
""
,
1
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
ok
(
ret
==
STATUS_SUCCESS
,
"got %#x
\n
"
,
ret
);
KeSetEvent
(
&
remove_lock_ready
,
0
,
FALSE
);
IoReleaseRemoveLockAndWaitEx
(
lock
,
NULL
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
PsTerminateSystemThread
(
STATUS_SUCCESS
);
}
static
void
test_sync
(
void
)
{
static
const
ULONG
wine_tag
=
0x454e4957
;
/* WINE */
KSEMAPHORE
semaphore
,
semaphore2
;
KEVENT
manual_event
,
auto_event
,
*
event
;
KTIMER
timer
;
IO_REMOVE_LOCK
remove_lock
;
LARGE_INTEGER
timeout
;
OBJECT_ATTRIBUTES
attr
;
HANDLE
handle
,
thread
;
void
*
objs
[
2
];
NTSTATUS
ret
;
HANDLE
handle
;
int
i
;
KeInitializeEvent
(
&
manual_event
,
NotificationEvent
,
FALSE
);
...
...
@@ -719,6 +736,42 @@ static void test_sync(void)
ok
(
ret
==
0
,
"got %#x
\n
"
,
ret
);
KeCancelTimer
(
&
timer
);
/* remove locks */
IoInitializeRemoveLockEx
(
&
remove_lock
,
wine_tag
,
0
,
0
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
ret
=
IoAcquireRemoveLockEx
(
&
remove_lock
,
NULL
,
""
,
1
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
ok
(
ret
==
STATUS_SUCCESS
,
"got %#x
\n
"
,
ret
);
IoReleaseRemoveLockEx
(
&
remove_lock
,
NULL
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
ret
=
IoAcquireRemoveLockEx
(
&
remove_lock
,
NULL
,
""
,
1
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
ok
(
ret
==
STATUS_SUCCESS
,
"got %#x
\n
"
,
ret
);
ret
=
IoAcquireRemoveLockEx
(
&
remove_lock
,
NULL
,
""
,
1
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
ok
(
ret
==
STATUS_SUCCESS
,
"got %#x
\n
"
,
ret
);
KeInitializeEvent
(
&
remove_lock_ready
,
SynchronizationEvent
,
FALSE
);
thread
=
create_thread
(
remove_lock_thread
,
&
remove_lock
);
ret
=
wait_single
(
&
remove_lock_ready
,
-
1000
*
10000
);
ok
(
!
ret
,
"got %#x
\n
"
,
ret
);
ret
=
wait_single_handle
(
thread
,
-
50
*
10000
);
ok
(
ret
==
STATUS_TIMEOUT
,
"got %#x
\n
"
,
ret
);
ret
=
IoAcquireRemoveLockEx
(
&
remove_lock
,
NULL
,
""
,
1
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
ok
(
ret
==
STATUS_DELETE_PENDING
,
"got %#x
\n
"
,
ret
);
IoReleaseRemoveLockEx
(
&
remove_lock
,
NULL
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
ret
=
wait_single_handle
(
thread
,
0
);
ok
(
ret
==
STATUS_TIMEOUT
,
"got %#x
\n
"
,
ret
);
IoReleaseRemoveLockEx
(
&
remove_lock
,
NULL
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
ret
=
wait_single_handle
(
thread
,
-
10000
*
10000
);
ok
(
ret
==
STATUS_SUCCESS
,
"got %#x
\n
"
,
ret
);
ret
=
IoAcquireRemoveLockEx
(
&
remove_lock
,
NULL
,
""
,
1
,
sizeof
(
IO_REMOVE_LOCK_COMMON_BLOCK
));
ok
(
ret
==
STATUS_DELETE_PENDING
,
"got %#x
\n
"
,
ret
);
}
static
void
test_call_driver
(
DEVICE_OBJECT
*
device
)
...
...
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