Author: cgutman
Date: Mon Jul 4 19:13:45 2011
New Revision: 52539
URL:
http://svn.reactos.org/svn/reactos?rev=52539&view=rev
Log:
[AFD]
- Move the TdiReceiveDatagram call to WarmSocketForBind like it is done for connects
Modified:
trunk/reactos/drivers/network/afd/afd/bind.c
Modified: trunk/reactos/drivers/network/afd/afd/bind.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/bi…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/bind.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/bind.c [iso-8859-1] Mon Jul 4 19:13:45 2011
@@ -37,13 +37,33 @@
if (FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS)
{
- Status = TdiQueryMaxDatagramLength(FCB->AddressFile.Object,
- &FCB->Recv.Size);
- if (NT_SUCCESS(Status))
+ if (!FCB->Recv.Size)
+ {
+ Status = TdiQueryMaxDatagramLength(FCB->AddressFile.Object,
+ &FCB->Recv.Size);
+ }
+
+ if (NT_SUCCESS(Status) && !FCB->Recv.Window)
{
FCB->Recv.Window = ExAllocatePool(PagedPool, FCB->Recv.Size);
if (!FCB->Recv.Window)
Status = STATUS_NO_MEMORY;
+ }
+
+ if (NT_SUCCESS(Status))
+ {
+ Status = TdiReceiveDatagram(&FCB->ReceiveIrp.InFlightRequest,
+ FCB->AddressFile.Object,
+ 0,
+ FCB->Recv.Window,
+ FCB->Recv.Size,
+ FCB->AddressFrom,
+ &FCB->ReceiveIrp.Iosb,
+ PacketSocketRecvComplete,
+ FCB);
+
+ /* We don't want to wait for this read to complete. */
+ if( Status == STATUS_PENDING ) Status = STATUS_SUCCESS;
}
}
@@ -78,27 +98,6 @@
Status = WarmSocketForBind( FCB );
AFD_DbgPrint(MID_TRACE,("FCB->Flags %x\n", FCB->Flags));
- if( !NT_SUCCESS(Status) )
- return UnlockAndMaybeComplete(FCB, Status, Irp, 0);
-
- if( FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS ) {
- AFD_DbgPrint(MID_TRACE,("Calling TdiReceiveDatagram\n"));
-
- Status = TdiReceiveDatagram
- ( &FCB->ReceiveIrp.InFlightRequest,
- FCB->AddressFile.Object,
- 0,
- FCB->Recv.Window,
- FCB->Recv.Size,
- FCB->AddressFrom,
- &FCB->ReceiveIrp.Iosb,
- PacketSocketRecvComplete,
- FCB );
-
- /* We don't want to wait for this read to complete. */
- if( Status == STATUS_PENDING ) Status = STATUS_SUCCESS;
- }
-
if (NT_SUCCESS(Status))
FCB->State = SOCKET_STATE_BOUND;