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
8e5bc0da
Commit
8e5bc0da
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: Store pipe state in pipe_end struct and return it in FSCTL_PIPE_PEEK.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5efd706c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
pipe.c
dlls/ntdll/tests/pipe.c
+0
-1
named_pipe.c
server/named_pipe.c
+8
-1
No files found.
dlls/ntdll/tests/pipe.c
View file @
8e5bc0da
...
...
@@ -1290,7 +1290,6 @@ static void test_pipe_state(HANDLE pipe, BOOL is_server, DWORD state)
ok
(
status
==
expected_status
,
"status = %x, expected %x in %s state %u
\n
"
,
status
,
expected_status
,
is_server
?
"server"
:
"client"
,
state
);
if
(
!
status
)
todo_wine
ok
(
peek_buf
.
NamedPipeState
==
state
,
"NamedPipeState = %u, expected %u
\n
"
,
peek_buf
.
NamedPipeState
,
state
);
...
...
server/named_pipe.c
View file @
8e5bc0da
...
...
@@ -66,6 +66,7 @@ struct pipe_end
struct
object
obj
;
/* object header */
struct
fd
*
fd
;
/* pipe file descriptor */
unsigned
int
flags
;
/* pipe flags */
unsigned
int
state
;
/* pipe state */
struct
pipe_end
*
connection
;
/* the other end of the pipe */
process_id_t
client_pid
;
/* process that created the client */
process_id_t
server_pid
;
/* process that created the server */
...
...
@@ -394,6 +395,8 @@ static void pipe_end_disconnect( struct pipe_end *pipe_end, unsigned int status
pipe_end
->
connection
=
NULL
;
pipe_end
->
state
=
status
==
STATUS_PIPE_DISCONNECTED
?
FILE_PIPE_DISCONNECTED_STATE
:
FILE_PIPE_CLOSING_STATE
;
fd_async_wake_up
(
pipe_end
->
fd
,
ASYNC_TYPE_WAIT
,
status
);
async_wake_up
(
&
pipe_end
->
read_q
,
status
);
LIST_FOR_EACH_ENTRY_SAFE
(
message
,
next
,
&
pipe_end
->
message_queue
,
struct
pipe_message
,
entry
)
...
...
@@ -883,7 +886,7 @@ static int pipe_end_peek( struct pipe_end *pipe_end )
}
if
(
!
(
buffer
=
set_reply_data_size
(
offsetof
(
FILE_PIPE_PEEK_BUFFER
,
Data
[
reply_size
]
))))
return
0
;
buffer
->
NamedPipeState
=
0
;
/* FIXME */
buffer
->
NamedPipeState
=
pipe_end
->
state
;
buffer
->
ReadDataAvailable
=
avail
;
buffer
->
NumberOfMessages
=
0
;
/* FIXME */
buffer
->
MessageLength
=
message_length
;
...
...
@@ -1005,6 +1008,7 @@ static int pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct async *as
case
ps_idle_server
:
case
ps_wait_connect
:
fd_queue_async
(
server
->
pipe_end
.
fd
,
async
,
ASYNC_TYPE_WAIT
);
server
->
pipe_end
.
state
=
FILE_PIPE_LISTENING_STATE
;
set_server_state
(
server
,
ps_wait_open
);
async_wake_up
(
&
server
->
pipe
->
waiters
,
STATUS_SUCCESS
);
set_error
(
STATUS_PENDING
);
...
...
@@ -1100,6 +1104,7 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned
server
->
client
=
NULL
;
server
->
options
=
options
;
init_pipe_end
(
&
server
->
pipe_end
,
pipe_flags
,
pipe
->
insize
);
server
->
pipe_end
.
state
=
FILE_PIPE_LISTENING_STATE
;
server
->
pipe_end
.
server_pid
=
get_process_id
(
current
->
process
);
list_add_head
(
&
pipe
->
servers
,
&
server
->
entry
);
...
...
@@ -1126,6 +1131,7 @@ static struct pipe_client *create_pipe_client( unsigned int flags, unsigned int
client
->
server
=
NULL
;
client
->
flags
=
flags
;
init_pipe_end
(
&
client
->
pipe_end
,
pipe_flags
,
buffer_size
);
client
->
pipe_end
.
state
=
FILE_PIPE_CONNECTED_STATE
;
client
->
pipe_end
.
client_pid
=
get_process_id
(
current
->
process
);
client
->
pipe_end
.
fd
=
alloc_pseudo_fd
(
&
pipe_client_fd_ops
,
&
client
->
pipe_end
.
obj
,
options
);
...
...
@@ -1204,6 +1210,7 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc
allow_fd_caching
(
server
->
pipe_end
.
fd
);
if
(
server
->
state
==
ps_wait_open
)
fd_async_wake_up
(
server
->
pipe_end
.
fd
,
ASYNC_TYPE_WAIT
,
STATUS_SUCCESS
);
server
->
pipe_end
.
state
=
FILE_PIPE_CONNECTED_STATE
;
set_server_state
(
server
,
ps_connected_server
);
server
->
client
=
client
;
client
->
server
=
server
;
...
...
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