Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
589ce2bb
Commit
589ce2bb
authored
Mar 26, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Always return STATUS_PENDING when an async I/O operation has been queued.
parent
cc578af7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
22 deletions
+18
-22
file.c
dlls/ntdll/file.c
+6
-7
socket.c
dlls/ws2_32/socket.c
+8
-12
fd.c
server/fd.c
+2
-3
serial.c
server/serial.c
+1
-0
sock.c
server/sock.c
+1
-0
No files found.
dlls/ntdll/file.c
View file @
589ce2bb
...
...
@@ -282,14 +282,13 @@ static ULONG fileio_queue_async(async_fileio* fileio, IO_STATUS_BLOCK* iosb,
}
SERVER_END_REQ
;
if
(
status
)
iosb
->
u
.
Status
=
status
;
if
(
iosb
->
u
.
Status
!=
STATUS_PENDING
)
if
(
status
!=
STATUS_PENDING
)
{
iosb
->
u
.
Status
=
status
;
(
apc
)(
fileio
,
iosb
,
iosb
->
u
.
Status
);
return
iosb
->
u
.
Status
;
}
NtCurrentTeb
()
->
num_async_io
++
;
return
STATUS_SUCCESS
;
else
NtCurrentTeb
()
->
num_async_io
++
;
return
status
;
}
/***********************************************************************
...
...
@@ -531,7 +530,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
io_status
->
u
.
Status
=
STATUS_PENDING
;
ret
=
fileio_queue_async
(
fileio
,
io_status
,
TRUE
);
if
(
ret
!=
STATUS_
SUCCESS
)
if
(
ret
!=
STATUS_
PENDING
)
{
if
(
flags
&
FD_FLAG_TIMEOUT
)
NtClose
(
hEvent
);
return
ret
;
...
...
@@ -762,7 +761,7 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
io_status
->
Information
=
0
;
io_status
->
u
.
Status
=
STATUS_PENDING
;
ret
=
fileio_queue_async
(
fileio
,
io_status
,
FALSE
);
if
(
ret
!=
STATUS_
SUCCESS
)
if
(
ret
!=
STATUS_
PENDING
)
{
if
(
flags
&
FD_FLAG_TIMEOUT
)
NtClose
(
hEvent
);
return
ret
;
...
...
dlls/ws2_32/socket.c
View file @
589ce2bb
...
...
@@ -1150,6 +1150,7 @@ static ULONG ws2_queue_async(struct ws2_async* wsa, IO_STATUS_BLOCK* iosb)
default:
FIXME
(
"Unknown internal mode (%d)
\n
"
,
wsa
->
mode
);
return
STATUS_INVALID_PARAMETER
;
}
iosb
->
u
.
Status
=
STATUS_PENDING
;
SERVER_START_REQ
(
register_async
)
{
req
->
handle
=
wsa
->
hSocket
;
...
...
@@ -1163,18 +1164,13 @@ static ULONG ws2_queue_async(struct ws2_async* wsa, IO_STATUS_BLOCK* iosb)
}
SERVER_END_REQ
;
if
(
status
)
iosb
->
u
.
Status
=
status
;
if
(
iosb
->
u
.
Status
!=
STATUS_PENDING
)
if
(
status
!=
STATUS_PENDING
)
{
/* Note: we get here a non zero status when we couldn't queue the async
* in the server. Therefore, we simply terminate the async.
*/
status
=
iosb
->
u
.
Status
;
iosb
->
u
.
Status
=
status
;
ws2_async_terminate
(
wsa
,
iosb
);
return
status
;
}
NtCurrentTeb
()
->
num_async_io
++
;
return
STATUS_SUCCESS
;
else
NtCurrentTeb
()
->
num_async_io
++
;
return
status
;
}
/***********************************************************************
...
...
@@ -1500,7 +1496,7 @@ static int WS2_register_async_shutdown( SOCKET s, enum ws2_mode mode )
/* Hack: this will cause ws2_async_terminate() to free the overlapped structure */
wsa
->
user_overlapped
=
NULL
;
if
(
(
ret
=
ws2_queue_async
(
wsa
,
iosb
))
)
if
(
(
ret
=
ws2_queue_async
(
wsa
,
iosb
))
!=
STATUS_PENDING
)
{
err
=
NtStatusToWSAError
(
ret
);
goto
out
;
...
...
@@ -2843,7 +2839,7 @@ INT WINAPI WSASendTo( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
goto
err_free
;
}
if
(
(
ret
=
ws2_queue_async
(
wsa
,
iosb
)
)
)
if
(
(
ret
=
ws2_queue_async
(
wsa
,
iosb
))
!=
STATUS_PENDING
)
{
err
=
NtStatusToWSAError
(
ret
);
...
...
@@ -4349,7 +4345,7 @@ INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
goto
err_free
;
}
if
(
(
ret
=
ws2_queue_async
(
wsa
,
iosb
))
)
if
(
(
ret
=
ws2_queue_async
(
wsa
,
iosb
))
!=
STATUS_PENDING
)
{
err
=
NtStatusToWSAError
(
ret
);
...
...
server/fd.c
View file @
589ce2bb
...
...
@@ -1742,6 +1742,7 @@ void fd_queue_async_timeout( struct fd *fd, const async_data_t *data, int type,
}
if
(
!
create_async
(
current
,
timeout
,
queue
,
data
))
return
;
set_error
(
STATUS_PENDING
);
/* Check if the new pending request can be served immediately */
events
=
check_fd_events
(
fd
,
fd
->
fd_ops
->
get_poll_events
(
fd
)
);
...
...
@@ -1937,9 +1938,7 @@ DECL_HANDLER(register_async)
* 3. Carry out any operations necessary to adjust the object's poll events
* Usually: set_elect_events (obj, obj->ops->get_poll_events()).
* 4. When the async request is triggered, then send back (with a proper APC)
* the trigger (STATUS_ALERTED) to the thread that posted the request.
* async_destroy() is to be called: it will both notify the sender about
* the trigger and destroy the request by itself
* the trigger (STATUS_ALERTED) to the thread that posted the request.
* See also the implementations in file.c, serial.c, and sock.c.
*/
...
...
server/serial.c
View file @
589ce2bb
...
...
@@ -273,6 +273,7 @@ static void serial_queue_async( struct fd *fd, const async_data_t *data, int typ
add_timeout
(
&
when
,
timeout
);
if
(
!
create_async
(
current
,
timeout
?
&
when
:
NULL
,
queue
,
data
))
return
;
set_error
(
STATUS_PENDING
);
/* Check if the new pending request can be served immediately */
events
=
check_fd_events
(
fd
,
serial_get_poll_events
(
fd
)
);
...
...
server/sock.c
View file @
589ce2bb
...
...
@@ -545,6 +545,7 @@ static void sock_queue_async( struct fd *fd, const async_data_t *data, int type,
else
{
if
(
!
create_async
(
current
,
NULL
,
queue
,
data
))
return
;
set_error
(
STATUS_PENDING
);
}
pollev
=
sock_reselect
(
sock
);
...
...
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