Author: cgutman
Date: Mon Aug 27 06:50:01 2012
New Revision: 57178
URL:
http://svn.reactos.org/svn/reactos?rev=57178&view=rev
Log:
[AFD]
- Fix broken overlapped I/O on sockets
Modified:
trunk/reactos/drivers/network/afd/afd/read.c
trunk/reactos/drivers/network/afd/afd/write.c
Modified: trunk/reactos/drivers/network/afd/afd/read.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Mon Aug 27 06:50:01 2012
@@ -491,7 +491,8 @@
return UnlockAndMaybeComplete(FCB, Status, Irp,
Irp->IoStatus.Information);
}
- else if( (RecvReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking) )
+ else if (!(RecvReq->AfdFlags & AFD_OVERLAPPED) &&
+ ((RecvReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking)))
{
AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
Status = STATUS_CANT_WAIT;
@@ -517,7 +518,8 @@
Status = ReceiveActivity( FCB, Irp );
if( Status == STATUS_PENDING &&
- ((RecvReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking)) ) {
+ !(RecvReq->AfdFlags & AFD_OVERLAPPED) &&
+ ((RecvReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking))) {
AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
Status = STATUS_CANT_WAIT;
TotalBytesCopied = 0;
@@ -758,7 +760,8 @@
return UnlockAndMaybeComplete(FCB, Status, Irp, Irp->IoStatus.Information);
}
- else if( (RecvReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking) )
+ else if (!(RecvReq->AfdFlags & AFD_OVERLAPPED) &&
+ ((RecvReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking)))
{
AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
Status = STATUS_CANT_WAIT;
Modified: trunk/reactos/drivers/network/afd/afd/write.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/wr…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] Mon Aug 27 06:50:01 2012
@@ -386,7 +386,8 @@
AFD_DbgPrint(MID_TRACE,("Socket state %d\n", FCB->State));
if( FCB->State != SOCKET_STATE_CONNECTED ) {
- if( (SendReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking) ) {
+ if (!(SendReq->AfdFlags & AFD_OVERLAPPED) &&
+ ((SendReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking))) {
AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE );
return UnlockAndMaybeComplete( FCB, STATUS_CANT_WAIT, Irp, 0 );
@@ -478,7 +479,8 @@
else
{
FCB->PollState &= ~AFD_EVENT_SEND;
- if( (SendReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking) ) {
+ if (!(SendReq->AfdFlags & AFD_OVERLAPPED) &&
+ ((SendReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking))) {
AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE );
return UnlockAndMaybeComplete( FCB, STATUS_CANT_WAIT, Irp, 0 );