Author: cgutman
Date: Thu Sep 11 13:17:11 2008
New Revision: 36141
URL:
http://svn.reactos.org/svn/reactos?rev=36141&view=rev
Log:
- Nicer solution for the problem fixed in r36102
Modified:
branches/aicom-network-fixes/drivers/network/afd/afd/select.c
Modified: branches/aicom-network-fixes/drivers/network/afd/afd/select.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/afd/afd/select.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/afd/afd/select.c [iso-8859-1] Thu Sep 11
13:17:11 2008
@@ -57,7 +57,9 @@
PAFD_ACTIVE_POLL Poll OPTIONAL,
PIRP _Irp OPTIONAL,
PAFD_POLL_INFO PollReq,
- NTSTATUS Status
+ NTSTATUS Status,
+ KSPIN_LOCK Lock,
+ KIRQL OldIrql
)
{
UINT i;
@@ -86,6 +88,10 @@
}
UnlockHandles( AFD_HANDLES(PollReq), PollReq->HandleCount );
if( Irp->MdlAddress ) UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) );
+ AFD_DbgPrint(MID_TRACE,("Completing\n"));
+ KeReleaseSpinLock(&Lock, OldIrql);
+ IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
+ KeAcquireSpinLock(&Lock, &OldIrql);
AFD_DbgPrint(MID_TRACE,("Done\n"));
}
@@ -108,10 +114,8 @@
ZeroEvents( PollReq->Handles, PollReq->HandleCount );
KeAcquireSpinLock( &DeviceExt->Lock, &OldIrql );
- SignalSocket( Poll, NULL, PollReq, STATUS_TIMEOUT );
+ SignalSocket( Poll, NULL, PollReq, STATUS_TIMEOUT, DeviceExt->Lock, OldIrql );
KeReleaseSpinLock( &DeviceExt->Lock, OldIrql );
-
- IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
AFD_DbgPrint(MID_TRACE,("Timeout\n"));
}
@@ -145,10 +149,7 @@
if( (PVOID)HandleArray[i].Handle == FileObject &&
(!OnlyExclusive || (OnlyExclusive && Poll->Exclusive)) ) {
ZeroEvents( PollReq->Handles, PollReq->HandleCount );
- SignalSocket( Poll, NULL, PollReq, STATUS_SUCCESS );
- KeReleaseSpinLock( &DeviceExt->Lock, OldIrql );
- IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
- KeAcquireSpinLock( &DeviceExt->Lock, &OldIrql );
+ SignalSocket( Poll, NULL, PollReq, STATUS_SUCCESS, DeviceExt->Lock,
OldIrql );
}
}
}
@@ -232,10 +233,7 @@
if( Signalled ) {
Status = STATUS_SUCCESS;
Irp->IoStatus.Status = Status;
- SignalSocket( NULL, Irp, PollReq, Status );
- KeReleaseSpinLock( &DeviceExt->Lock, OldIrql );
- IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
- return Status;
+ SignalSocket( NULL, Irp, PollReq, Status, DeviceExt->Lock, OldIrql );
} else {
PAFD_ACTIVE_POLL Poll = NULL;
@@ -426,10 +424,7 @@
if( UpdatePollWithFCB( Poll, FileObject ) ) {
ThePollEnt = ThePollEnt->Flink;
AFD_DbgPrint(MID_TRACE,("Signalling socket\n"));
- SignalSocket( Poll, NULL, PollReq, STATUS_SUCCESS );
- KeReleaseSpinLock( &DeviceExt->Lock, OldIrql );
- IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
- KeAcquireSpinLock( &DeviceExt->Lock, &OldIrql );
+ SignalSocket( Poll, NULL, PollReq, STATUS_SUCCESS, DeviceExt->Lock, OldIrql );
} else
ThePollEnt = ThePollEnt->Flink;
}