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
43cdcc07
Commit
43cdcc07
authored
Oct 31, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use file mode flags in async_handoff to decide if request is blocking.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f7f9bf98
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
20 deletions
+14
-20
pipe.c
dlls/ntdll/tests/pipe.c
+7
-13
async.c
server/async.c
+2
-2
fd.c
server/fd.c
+4
-4
file.h
server/file.h
+1
-1
No files found.
dlls/ntdll/tests/pipe.c
View file @
43cdcc07
...
...
@@ -412,9 +412,9 @@ static void test_alertable(void)
res
=
listen_pipe
(
hPipe
,
hEvent
,
&
iosb
,
TRUE
);
todo_wine
ok
(
res
==
STATUS_CANCELLED
,
"NtFsControlFile returned %x
\n
"
,
res
);
todo_wine
ok
(
userapc_called
,
"user apc didn't run
\n
"
);
ok
(
userapc_called
,
"user apc didn't run
\n
"
);
ok
(
U
(
iosb
).
Status
==
0x55555555
,
"iosb.Status got changed to %x
\n
"
,
U
(
iosb
).
Status
);
todo_wine
ok
(
WaitForSingleObjectEx
(
hEvent
,
0
,
TRUE
)
==
WAIT_TIMEOUT
,
"hEvent signaled
\n
"
);
ok
(
WaitForSingleObjectEx
(
hEvent
,
0
,
TRUE
)
==
WAIT_TIMEOUT
,
"hEvent signaled
\n
"
);
ok
(
!
ioapc_called
,
"IOAPC ran
\n
"
);
/* queue an user apc from a different thread */
...
...
@@ -445,11 +445,11 @@ static void test_alertable(void)
ok
(
hThread
!=
INVALID_HANDLE_VALUE
,
"can't create thread, GetLastError: %x
\n
"
,
GetLastError
());
res
=
listen_pipe
(
hPipe
,
hEvent
,
&
iosb
,
TRUE
);
todo_wine
ok
(
!
res
,
"NtFsControlFile returned %x
\n
"
,
res
);
ok
(
!
res
,
"NtFsControlFile returned %x
\n
"
,
res
);
ok
(
open_succeeded
,
"couldn't open client side pipe
\n
"
);
ok
(
!
U
(
iosb
).
Status
,
"Wrong iostatus %x
\n
"
,
U
(
iosb
).
Status
);
todo_wine
ok
(
WaitForSingleObject
(
hEvent
,
0
)
==
0
,
"hEvent not signaled
\n
"
);
ok
(
WaitForSingleObject
(
hEvent
,
0
)
==
0
,
"hEvent not signaled
\n
"
);
WaitForSingleObject
(
hThread
,
INFINITE
);
CloseHandle
(
hThread
);
...
...
@@ -482,11 +482,11 @@ static void test_nonalertable(void)
ok
(
ret
,
"can't queue user apc, GetLastError: %x
\n
"
,
GetLastError
());
res
=
listen_pipe
(
hPipe
,
hEvent
,
&
iosb
,
TRUE
);
todo_wine
ok
(
!
res
,
"NtFsControlFile returned %x
\n
"
,
res
);
ok
(
!
res
,
"NtFsControlFile returned %x
\n
"
,
res
);
ok
(
open_succeeded
,
"couldn't open client side pipe
\n
"
);
todo_wine
ok
(
!
U
(
iosb
).
Status
,
"Wrong iostatus %x
\n
"
,
U
(
iosb
).
Status
);
todo_wine
ok
(
WaitForSingleObject
(
hEvent
,
0
)
==
0
,
"hEvent not signaled
\n
"
);
ok
(
!
U
(
iosb
).
Status
,
"Wrong iostatus %x
\n
"
,
U
(
iosb
).
Status
);
ok
(
WaitForSingleObject
(
hEvent
,
0
)
==
0
,
"hEvent not signaled
\n
"
);
ok
(
!
ioapc_called
,
"IOAPC ran too early
\n
"
);
ok
(
!
userapc_called
,
"user apc ran too early
\n
"
);
...
...
@@ -1348,7 +1348,6 @@ static void test_completion(void)
ok
(
is_signaled
(
client
),
"client is not signaled
\n
"
);
if
(
broken
(
1
))
{
/* blocks on wine */
/* no event, APC nor completion: only signals on handle */
memset
(
&
io
,
0xcc
,
sizeof
(
io
));
status
=
NtReadFile
(
client
,
NULL
,
NULL
,
NULL
,
&
io
,
read_buf
,
sizeof
(
read_buf
),
NULL
,
NULL
);
...
...
@@ -1360,7 +1359,6 @@ static void test_completion(void)
ok
(
is_signaled
(
client
),
"client is signaled
\n
"
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"Status = %x
\n
"
,
io
.
Status
);
ok
(
io
.
Information
==
sizeof
(
buf
),
"Information = %lu
\n
"
,
io
.
Information
);
}
/* event with no APC nor completion: signals only event */
memset
(
&
io
,
0xcc
,
sizeof
(
io
));
...
...
@@ -1434,12 +1432,10 @@ static void test_completion(void)
ok
(
!
is_signaled
(
client
),
"client is signaled
\n
"
);
test_queued_completion
(
port
,
&
io
,
STATUS_SUCCESS
,
sizeof
(
buf
));
if
(
broken
(
1
))
{
/* blocks on wine */
memset
(
&
io
,
0xcc
,
sizeof
(
io
));
status
=
NtReadFile
(
client
,
NULL
,
NULL
,
NULL
,
&
io
,
read_buf
,
sizeof
(
read_buf
),
NULL
,
NULL
);
ok
(
status
==
STATUS_PENDING
,
"status = %x
\n
"
,
status
);
ok
(
!
is_signaled
(
client
),
"client is signaled
\n
"
);
}
ret
=
WriteFile
(
client
,
buf
,
1
,
&
num_bytes
,
NULL
);
ok
(
ret
,
"WriteFile failed, error %u
\n
"
,
GetLastError
());
...
...
@@ -1575,9 +1571,7 @@ static void test_blocking(ULONG options)
SetEvent
(
ctx
.
wait
);
status
=
NtReadFile
(
ctx
.
client
,
ctx
.
event
,
ioapc
,
&
io
,
&
io
,
read_buf
,
sizeof
(
read_buf
),
NULL
,
NULL
);
todo_wine
ok
(
status
==
STATUS_SUCCESS
,
"status = %x
\n
"
,
status
);
if
(
status
==
STATUS_PENDING
)
WaitForSingleObject
(
ctx
.
event
,
INFINITE
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"Status = %x
\n
"
,
io
.
Status
);
ok
(
io
.
Information
==
1
,
"Information = %lu
\n
"
,
io
.
Information
);
ok
(
is_signaled
(
ctx
.
event
),
"event is not signaled
\n
"
);
...
...
server/async.c
View file @
43cdcc07
...
...
@@ -284,7 +284,7 @@ struct async *create_request_async( struct fd *fd, unsigned int comp_flags, cons
}
/* return async object status and wait handle to client */
obj_handle_t
async_handoff
(
struct
async
*
async
,
int
success
,
data_size_t
*
result
)
obj_handle_t
async_handoff
(
struct
async
*
async
,
int
success
,
data_size_t
*
result
,
int
force_blocking
)
{
if
(
!
success
)
{
...
...
@@ -316,7 +316,7 @@ obj_handle_t async_handoff( struct async *async, int success, data_size_t *resul
else
{
async
->
direct_result
=
0
;
if
(
!
async_is_blocking
(
async
))
if
(
!
force_blocking
&&
async
->
fd
&&
is_fd_overlapped
(
async
->
fd
))
{
close_handle
(
async
->
thread
->
process
,
async
->
wait_handle
);
async
->
wait_handle
=
0
;
...
...
server/fd.c
View file @
43cdcc07
...
...
@@ -2438,7 +2438,7 @@ DECL_HANDLER(flush)
if
((
async
=
create_request_async
(
fd
,
fd
->
comp_flags
,
&
req
->
async
)))
{
reply
->
event
=
async_handoff
(
async
,
fd
->
fd_ops
->
flush
(
fd
,
async
),
NULL
);
reply
->
event
=
async_handoff
(
async
,
fd
->
fd_ops
->
flush
(
fd
,
async
),
NULL
,
1
);
release_object
(
async
);
}
release_object
(
fd
);
...
...
@@ -2537,7 +2537,7 @@ DECL_HANDLER(read)
if
((
async
=
create_request_async
(
fd
,
fd
->
comp_flags
,
&
req
->
async
)))
{
reply
->
wait
=
async_handoff
(
async
,
fd
->
fd_ops
->
read
(
fd
,
async
,
req
->
pos
),
NULL
);
reply
->
wait
=
async_handoff
(
async
,
fd
->
fd_ops
->
read
(
fd
,
async
,
req
->
pos
),
NULL
,
0
);
reply
->
options
=
fd
->
options
;
release_object
(
async
);
}
...
...
@@ -2554,7 +2554,7 @@ DECL_HANDLER(write)
if
((
async
=
create_request_async
(
fd
,
fd
->
comp_flags
,
&
req
->
async
)))
{
reply
->
wait
=
async_handoff
(
async
,
fd
->
fd_ops
->
write
(
fd
,
async
,
req
->
pos
),
&
reply
->
size
);
reply
->
wait
=
async_handoff
(
async
,
fd
->
fd_ops
->
write
(
fd
,
async
,
req
->
pos
),
&
reply
->
size
,
0
);
reply
->
options
=
fd
->
options
;
release_object
(
async
);
}
...
...
@@ -2572,7 +2572,7 @@ DECL_HANDLER(ioctl)
if
((
async
=
create_request_async
(
fd
,
fd
->
comp_flags
,
&
req
->
async
)))
{
reply
->
wait
=
async_handoff
(
async
,
fd
->
fd_ops
->
ioctl
(
fd
,
req
->
code
,
async
),
NULL
);
reply
->
wait
=
async_handoff
(
async
,
fd
->
fd_ops
->
ioctl
(
fd
,
req
->
code
,
async
),
NULL
,
0
);
reply
->
options
=
fd
->
options
;
release_object
(
async
);
}
...
...
server/file.h
View file @
43cdcc07
...
...
@@ -187,7 +187,7 @@ extern struct object *create_serial( struct fd *fd );
extern
void
free_async_queue
(
struct
async_queue
*
queue
);
extern
struct
async
*
create_async
(
struct
fd
*
fd
,
struct
thread
*
thread
,
const
async_data_t
*
data
,
struct
iosb
*
iosb
);
extern
struct
async
*
create_request_async
(
struct
fd
*
fd
,
unsigned
int
comp_flags
,
const
async_data_t
*
data
);
extern
obj_handle_t
async_handoff
(
struct
async
*
async
,
int
success
,
data_size_t
*
result
);
extern
obj_handle_t
async_handoff
(
struct
async
*
async
,
int
success
,
data_size_t
*
result
,
int
force_blocking
);
extern
void
queue_async
(
struct
async_queue
*
queue
,
struct
async
*
async
);
extern
void
async_set_timeout
(
struct
async
*
async
,
timeout_t
timeout
,
unsigned
int
status
);
extern
void
async_set_result
(
struct
object
*
obj
,
unsigned
int
status
,
apc_param_t
total
);
...
...
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