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
91852564
Commit
91852564
authored
Aug 08, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Improve named pipe read error handling.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0973b8d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
pipe.c
dlls/ntdll/tests/pipe.c
+0
-2
named_pipe.c
server/named_pipe.c
+11
-1
No files found.
dlls/ntdll/tests/pipe.c
View file @
91852564
...
@@ -1338,7 +1338,6 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
...
@@ -1338,7 +1338,6 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
break
;
break
;
}
}
status
=
NtReadFile
(
pipe
,
NULL
,
NULL
,
NULL
,
&
io
,
buf
,
1
,
NULL
,
NULL
);
status
=
NtReadFile
(
pipe
,
NULL
,
NULL
,
NULL
,
&
io
,
buf
,
1
,
NULL
,
NULL
);
todo_wine_if
(
state
==
FILE_PIPE_DISCONNECTED_STATE
&&
!
is_server
)
ok
(
status
==
expected_status
,
"NtReadFile failed in %s state %u: %x
\n
"
,
ok
(
status
==
expected_status
,
"NtReadFile failed in %s state %u: %x
\n
"
,
is_server
?
"server"
:
"client"
,
state
,
status
);
is_server
?
"server"
:
"client"
,
state
,
status
);
}
}
...
@@ -1427,7 +1426,6 @@ static void test_pipe_with_data_state(HANDLE pipe, BOOL is_server, DWORD state)
...
@@ -1427,7 +1426,6 @@ static void test_pipe_with_data_state(HANDLE pipe, BOOL is_server, DWORD state)
if
(
state
==
FILE_PIPE_CLOSING_STATE
)
if
(
state
==
FILE_PIPE_CLOSING_STATE
)
expected_status
=
STATUS_SUCCESS
;
expected_status
=
STATUS_SUCCESS
;
status
=
NtReadFile
(
pipe
,
NULL
,
NULL
,
NULL
,
&
io
,
buf
,
1
,
NULL
,
NULL
);
status
=
NtReadFile
(
pipe
,
NULL
,
NULL
,
NULL
,
&
io
,
buf
,
1
,
NULL
,
NULL
);
todo_wine_if
(
state
==
FILE_PIPE_DISCONNECTED_STATE
&&
status
!=
STATUS_PIPE_DISCONNECTED
)
ok
(
status
==
expected_status
,
"NtReadFile failed in %s state %u: %x
\n
"
,
ok
(
status
==
expected_status
,
"NtReadFile failed in %s state %u: %x
\n
"
,
is_server
?
"server"
:
"client"
,
state
,
status
);
is_server
?
"server"
:
"client"
,
state
,
status
);
}
}
...
...
server/named_pipe.c
View file @
91852564
...
@@ -798,8 +798,18 @@ static int pipe_end_read( struct fd *fd, struct async *async, file_pos_t pos )
...
@@ -798,8 +798,18 @@ static int pipe_end_read( struct fd *fd, struct async *async, file_pos_t pos )
{
{
struct
pipe_end
*
pipe_end
=
get_fd_user
(
fd
);
struct
pipe_end
*
pipe_end
=
get_fd_user
(
fd
);
if
(
!
pipe_end
->
connection
&&
list_empty
(
&
pipe_end
->
message_queue
)
)
switch
(
pipe_end
->
state
)
{
{
case
FILE_PIPE_CONNECTED_STATE
:
break
;
case
FILE_PIPE_DISCONNECTED_STATE
:
set_error
(
STATUS_PIPE_DISCONNECTED
);
return
0
;
case
FILE_PIPE_LISTENING_STATE
:
set_error
(
STATUS_PIPE_LISTENING
);
return
0
;
case
FILE_PIPE_CLOSING_STATE
:
if
(
!
list_empty
(
&
pipe_end
->
message_queue
))
break
;
set_error
(
STATUS_PIPE_BROKEN
);
set_error
(
STATUS_PIPE_BROKEN
);
return
0
;
return
0
;
}
}
...
...
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