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
dd1769a1
Commit
dd1769a1
authored
Oct 20, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Improve error handling of disconnected named pipe clients.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0fe08b79
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
pipe.c
dlls/kernel32/tests/pipe.c
+0
-1
pipe.c
dlls/ntdll/tests/pipe.c
+0
-4
named_pipe.c
server/named_pipe.c
+8
-2
No files found.
dlls/kernel32/tests/pipe.c
View file @
dd1769a1
...
@@ -1506,7 +1506,6 @@ static int test_DisconnectNamedPipe(void)
...
@@ -1506,7 +1506,6 @@ static int test_DisconnectNamedPipe(void)
ok
(
ret
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %X
\n
"
,
ret
);
ok
(
ret
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %X
\n
"
,
ret
);
ret
=
PeekNamedPipe
(
hFile
,
NULL
,
0
,
NULL
,
&
readden
,
NULL
);
ret
=
PeekNamedPipe
(
hFile
,
NULL
,
0
,
NULL
,
&
readden
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_PIPE_NOT_CONNECTED
,
"PeekNamedPipe returned %x (%u)
\n
"
,
ok
(
!
ret
&&
GetLastError
()
==
ERROR_PIPE_NOT_CONNECTED
,
"PeekNamedPipe returned %x (%u)
\n
"
,
ret
,
GetLastError
());
ret
,
GetLastError
());
ret
=
PeekNamedPipe
(
hnp
,
NULL
,
0
,
NULL
,
&
readden
,
NULL
);
ret
=
PeekNamedPipe
(
hnp
,
NULL
,
0
,
NULL
,
&
readden
,
NULL
);
...
...
dlls/ntdll/tests/pipe.c
View file @
dd1769a1
...
@@ -1348,7 +1348,6 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
...
@@ -1348,7 +1348,6 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
expected_status
=
STATUS_PIPE_BROKEN
;
expected_status
=
STATUS_PIPE_BROKEN
;
break
;
break
;
}
}
todo_wine_if
(
expected_status
==
STATUS_PIPE_DISCONNECTED
)
ok
(
status
==
expected_status
,
"status = %x, expected %x in %s state %u
\n
"
,
ok
(
status
==
expected_status
,
"status = %x, expected %x in %s state %u
\n
"
,
status
,
expected_status
,
is_server
?
"server"
:
"client"
,
state
);
status
,
expected_status
,
is_server
?
"server"
:
"client"
,
state
);
if
(
!
status
)
if
(
!
status
)
...
@@ -1363,7 +1362,6 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
...
@@ -1363,7 +1362,6 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
buf
,
1
,
buf
+
1
,
1
);
buf
,
1
,
buf
+
1
,
1
);
if
(
!
status
||
status
==
STATUS_PENDING
)
if
(
!
status
||
status
==
STATUS_PENDING
)
status
=
io
.
Status
;
status
=
io
.
Status
;
todo_wine_if
(
expected_status
==
STATUS_PIPE_DISCONNECTED
)
ok
(
status
==
expected_status
,
ok
(
status
==
expected_status
,
"NtFsControlFile(FSCTL_PIPE_TRANSCEIVE) failed in %s state %u: %x
\n
"
,
"NtFsControlFile(FSCTL_PIPE_TRANSCEIVE) failed in %s state %u: %x
\n
"
,
is_server
?
"server"
:
"client"
,
state
,
status
);
is_server
?
"server"
:
"client"
,
state
,
status
);
...
@@ -1373,7 +1371,6 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
...
@@ -1373,7 +1371,6 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
status
=
NtFlushBuffersFile
(
pipe
,
&
io
);
status
=
NtFlushBuffersFile
(
pipe
,
&
io
);
if
(
!
is_server
&&
state
==
FILE_PIPE_DISCONNECTED_STATE
)
if
(
!
is_server
&&
state
==
FILE_PIPE_DISCONNECTED_STATE
)
{
{
todo_wine
ok
(
status
==
STATUS_PIPE_DISCONNECTED
,
"status = %x in %s state %u
\n
"
,
ok
(
status
==
STATUS_PIPE_DISCONNECTED
,
"status = %x in %s state %u
\n
"
,
status
,
is_server
?
"server"
:
"client"
,
state
);
status
,
is_server
?
"server"
:
"client"
,
state
);
}
}
...
@@ -1472,7 +1469,6 @@ static void test_pipe_with_data_state(HANDLE pipe, BOOL is_server, DWORD state)
...
@@ -1472,7 +1469,6 @@ static void test_pipe_with_data_state(HANDLE pipe, BOOL is_server, DWORD state)
expected_status
=
STATUS_BUFFER_OVERFLOW
;
expected_status
=
STATUS_BUFFER_OVERFLOW
;
break
;
break
;
}
}
todo_wine_if
(
expected_status
==
STATUS_PIPE_DISCONNECTED
)
ok
(
status
==
expected_status
,
"status = %x, expected %x in %s state %u
\n
"
,
ok
(
status
==
expected_status
,
"status = %x, expected %x in %s state %u
\n
"
,
status
,
expected_status
,
is_server
?
"server"
:
"client"
,
state
);
status
,
expected_status
,
is_server
?
"server"
:
"client"
,
state
);
if
(
status
==
STATUS_BUFFER_OVERFLOW
)
if
(
status
==
STATUS_BUFFER_OVERFLOW
)
...
...
server/named_pipe.c
View file @
dd1769a1
...
@@ -501,6 +501,12 @@ static int pipe_end_flush( struct fd *fd, struct async *async )
...
@@ -501,6 +501,12 @@ static int pipe_end_flush( struct fd *fd, struct async *async )
{
{
struct
pipe_end
*
pipe_end
=
get_fd_user
(
fd
);
struct
pipe_end
*
pipe_end
=
get_fd_user
(
fd
);
if
(
!
pipe_end
->
pipe
)
{
set_error
(
STATUS_PIPE_DISCONNECTED
);
return
0
;
}
if
(
pipe_end
->
connection
&&
!
list_empty
(
&
pipe_end
->
connection
->
message_queue
))
if
(
pipe_end
->
connection
&&
!
list_empty
(
&
pipe_end
->
connection
->
message_queue
))
{
{
fd_queue_async
(
pipe_end
->
fd
,
async
,
ASYNC_TYPE_WAIT
);
fd_queue_async
(
pipe_end
->
fd
,
async
,
ASYNC_TYPE_WAIT
);
...
@@ -888,7 +894,7 @@ static int pipe_end_peek( struct pipe_end *pipe_end )
...
@@ -888,7 +894,7 @@ static int pipe_end_peek( struct pipe_end *pipe_end )
set_error
(
STATUS_PIPE_BROKEN
);
set_error
(
STATUS_PIPE_BROKEN
);
return
0
;
return
0
;
default:
default:
set_error
(
STATUS_INVALID_PIPE_STATE
);
set_error
(
pipe_end
->
pipe
?
STATUS_INVALID_PIPE_STATE
:
STATUS_PIPE_DISCONNECTED
);
return
0
;
return
0
;
}
}
...
@@ -932,7 +938,7 @@ static int pipe_end_transceive( struct pipe_end *pipe_end, struct async *async )
...
@@ -932,7 +938,7 @@ static int pipe_end_transceive( struct pipe_end *pipe_end, struct async *async )
if
(
!
pipe_end
->
connection
)
if
(
!
pipe_end
->
connection
)
{
{
set_error
(
STATUS_INVALID_PIPE_STATE
);
set_error
(
pipe_end
->
pipe
?
STATUS_INVALID_PIPE_STATE
:
STATUS_PIPE_DISCONNECTED
);
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