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
ca4ae96f
Commit
ca4ae96f
authored
Nov 14, 2005
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NtReadFile: now returning correct status in NtReadFile for EOF
conditions (on files) and broken pipe (on named pipes).
parent
c9e02e11
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
pipe.c
dlls/kernel/tests/pipe.c
+1
-1
file.c
dlls/ntdll/file.c
+9
-1
No files found.
dlls/kernel/tests/pipe.c
View file @
ca4ae96f
...
...
@@ -757,7 +757,7 @@ static void test_CreatePipe(void)
ok
(
ReadFile
(
piperead
,
readbuf
,
sizeof
(
readbuf
),
&
read
,
NULL
),
"Read from broken pipe withe with pending data failed
\n
"
);
ok
(
read
==
sizeof
(
PIPENAME
),
"Read from anonymous pipe got %ld bytes instead of %d
\n
"
,
read
,
sizeof
(
PIPENAME
));
/* But now we need to get informed that the pipe is closed */
todo_wine
ok
(
ReadFile
(
piperead
,
readbuf
,
sizeof
(
readbuf
),
&
read
,
NULL
)
==
0
,
"Broken pipe not detected
\n
"
);
ok
(
ReadFile
(
piperead
,
readbuf
,
sizeof
(
readbuf
),
&
read
,
NULL
)
==
0
,
"Broken pipe not detected
\n
"
);
}
START_TEST
(
pipe
)
...
...
dlls/ntdll/file.c
View file @
ca4ae96f
...
...
@@ -589,8 +589,16 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
else
io_status
->
u
.
Status
=
FILE_GetNtStatus
();
break
;
}
if
(
io_status
->
u
.
Status
==
STATUS_SUCCESS
&&
io_status
->
Information
==
0
)
{
struct
stat
st
;
if
(
fstat
(
unix_handle
,
&
st
)
!=
-
1
&&
S_ISSOCK
(
st
.
st_mode
))
io_status
->
u
.
Status
=
STATUS_PIPE_BROKEN
;
else
io_status
->
u
.
Status
=
STATUS_END_OF_FILE
;
}
wine_server_release_fd
(
hFile
,
unix_handle
);
TRACE
(
"= 0x%08lx
\n
"
,
io_status
->
u
.
Status
);
TRACE
(
"= 0x%08lx
(%lu)
\n
"
,
io_status
->
u
.
Status
,
io_status
->
Information
);
return
io_status
->
u
.
Status
;
}
...
...
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