Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e024094b
Commit
e024094b
authored
Mar 29, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Added tests of partial reads and reads with invalid wait handle.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0d6b783c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
pipe.c
dlls/ntdll/tests/pipe.c
+50
-0
No files found.
dlls/ntdll/tests/pipe.c
View file @
e024094b
...
...
@@ -840,6 +840,43 @@ static void read_pipe_test(ULONG pipe_flags, ULONG pipe_type)
SleepEx
(
1
,
TRUE
);
/* alertable sleep */
ok
(
apc_count
==
1
,
"apc not called
\n
"
);
/* now partial read with data ready */
apc_count
=
0
;
U
(
iosb
).
Status
=
0xdeadbabe
;
iosb
.
Information
=
0xdeadbeef
;
ResetEvent
(
event
);
ret
=
WriteFile
(
write
,
buffer
,
2
,
&
written
,
NULL
);
ok
(
ret
&&
written
==
2
,
"WriteFile error %d
\n
"
,
GetLastError
());
status
=
NtReadFile
(
read
,
event
,
apc
,
&
apc_count
,
&
iosb
,
buffer
,
1
,
NULL
,
NULL
);
if
(
pipe_type
&
PIPE_READMODE_MESSAGE
)
{
ok
(
status
==
STATUS_BUFFER_OVERFLOW
,
"wrong status %x
\n
"
,
status
);
ok
(
U
(
iosb
).
Status
==
STATUS_BUFFER_OVERFLOW
,
"wrong status %x
\n
"
,
U
(
iosb
).
Status
);
}
else
{
ok
(
status
==
STATUS_SUCCESS
,
"wrong status %x
\n
"
,
status
);
ok
(
U
(
iosb
).
Status
==
0
,
"wrong status %x
\n
"
,
U
(
iosb
).
Status
);
}
ok
(
iosb
.
Information
==
1
,
"wrong info %lu
\n
"
,
iosb
.
Information
);
ok
(
is_signaled
(
event
),
"event is not signaled
\n
"
);
ok
(
!
apc_count
,
"apc was called
\n
"
);
SleepEx
(
1
,
FALSE
);
/* non-alertable sleep */
ok
(
!
apc_count
,
"apc was called
\n
"
);
SleepEx
(
1
,
TRUE
);
/* alertable sleep */
ok
(
apc_count
==
1
,
"apc not called
\n
"
);
apc_count
=
0
;
status
=
NtReadFile
(
read
,
event
,
apc
,
&
apc_count
,
&
iosb
,
buffer
,
1
,
NULL
,
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"wrong status %x
\n
"
,
status
);
ok
(
U
(
iosb
).
Status
==
0
,
"wrong status %x
\n
"
,
U
(
iosb
).
Status
);
ok
(
iosb
.
Information
==
1
,
"wrong info %lu
\n
"
,
iosb
.
Information
);
ok
(
is_signaled
(
event
),
"event is not signaled
\n
"
);
ok
(
!
apc_count
,
"apc was called
\n
"
);
SleepEx
(
1
,
FALSE
);
/* non-alertable sleep */
ok
(
!
apc_count
,
"apc was called
\n
"
);
SleepEx
(
1
,
TRUE
);
/* alertable sleep */
ok
(
apc_count
==
1
,
"apc not called
\n
"
);
/* try read with no data */
apc_count
=
0
;
U
(
iosb
).
Status
=
0xdeadbabe
;
...
...
@@ -877,6 +914,19 @@ static void read_pipe_test(ULONG pipe_flags, ULONG pipe_type)
ok
(
!
apc_count
,
"apc was called
\n
"
);
CloseHandle
(
read
);
/* read from disconnected pipe, with invalid event handle */
apc_count
=
0
;
U
(
iosb
).
Status
=
0xdeadbabe
;
iosb
.
Information
=
0xdeadbeef
;
status
=
NtReadFile
(
read
,
(
HANDLE
)
0xdeadbeef
,
apc
,
&
apc_count
,
&
iosb
,
buffer
,
1
,
NULL
,
NULL
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"wrong status %x
\n
"
,
status
);
ok
(
U
(
iosb
).
Status
==
0xdeadbabe
,
"wrong status %x
\n
"
,
U
(
iosb
).
Status
);
ok
(
iosb
.
Information
==
0xdeadbeef
,
"wrong info %lu
\n
"
,
iosb
.
Information
);
ok
(
!
apc_count
,
"apc was called
\n
"
);
SleepEx
(
1
,
TRUE
);
/* alertable sleep */
ok
(
!
apc_count
,
"apc was called
\n
"
);
CloseHandle
(
read
);
/* read from closed handle */
apc_count
=
0
;
U
(
iosb
).
Status
=
0xdeadbabe
;
...
...
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