Author: cgutman
Date: Wed Aug 20 09:21:08 2008
New Revision: 35477
URL:
http://svn.reactos.org/svn/reactos?rev=35477&view=rev
Log:
- Reapply arty's datagram cancellation work
- Part 1 of 3
Modified:
branches/aicom-network-fixes/drivers/network/afd/afd/lock.c
branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c
branches/aicom-network-fixes/drivers/network/afd/afd/write.c
branches/aicom-network-fixes/drivers/network/afd/include/afd.h
Modified: branches/aicom-network-fixes/drivers/network/afd/afd/lock.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/afd/afd/lock.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/afd/afd/lock.c [iso-8859-1] Wed Aug 20
09:21:08 2008
@@ -68,7 +68,7 @@
BOOLEAN Write, BOOLEAN LockAddress ) {
UINT i;
/* Copy the buffer array so we don't lose it */
- UINT Lock = (LockAddress && AddressLen) ? 2 : 0;
+ UINT Lock = LockAddress ? 2 : 0;
UINT Size = sizeof(AFD_WSABUF) * (Count + Lock);
PAFD_WSABUF NewBuf = ExAllocatePool( PagedPool, Size * 2 );
PMDL NewMdl;
@@ -80,13 +80,16 @@
_SEH_TRY {
RtlCopyMemory( NewBuf, Buf, sizeof(AFD_WSABUF) * Count );
- if( LockAddress ) {
+ if( LockAddress && AddressLen ) {
NewBuf[Count].buf = AddressBuf;
NewBuf[Count].len = *AddressLen;
Count++;
NewBuf[Count].buf = (PVOID)AddressLen;
NewBuf[Count].len = sizeof(*AddressLen);
Count++;
+ } else if( LockAddress ) {
+ RtlZeroMemory(NewBuf, sizeof(*NewBuf) * 2);
+ Count += 2;
}
} _SEH_HANDLE {
AFD_DbgPrint(MIN_TRACE,("Access violation copying buffer info "
Modified: branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c [iso-8859-1] Wed Aug 20
09:21:08 2008
@@ -172,54 +172,6 @@
return Status;
}
-NTSTATUS
-TdiBuildConnectionInfoPair
-( PTDI_CONNECTION_INFO_PAIR ConnectionInfo,
- PTRANSPORT_ADDRESS From, PTRANSPORT_ADDRESS To )
- /*
- * FUNCTION: Fill a TDI_CONNECTION_INFO_PAIR struct will the two addresses
- * given.
- * ARGUMENTS:
- * ConnectionInfo: The pair
- * From: The from address
- * To: The to address
- * RETURNS:
- * Status of the operation
- */
-{
- PCHAR LayoutFrame;
- UINT SizeOfEntry;
- ULONG TdiAddressSize;
- PTDI_CONNECTION_INFORMATION FromTdiConn, ToTdiConn;
-
- /* FIXME: Get from socket information */
- TdiAddressSize = TdiAddressSizeFromType(From->Address[0].AddressType);
- SizeOfEntry = TdiAddressSize + sizeof(TDI_CONNECTION_INFORMATION);
-
- LayoutFrame = (PCHAR)ExAllocatePool(NonPagedPool, 2 * SizeOfEntry);
-
- if (!LayoutFrame) {
- AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- RtlZeroMemory( LayoutFrame, 2 * SizeOfEntry );
-
- FromTdiConn = (PTDI_CONNECTION_INFORMATION)LayoutFrame;
- ToTdiConn = (PTDI_CONNECTION_INFORMATION)LayoutFrame + SizeOfEntry;
-
- if (From != NULL) {
- TdiBuildConnectionInfoInPlace( FromTdiConn, From );
- } else {
- TdiBuildNullConnectionInfoInPlace( FromTdiConn,
- From->Address[0].AddressType );
- }
-
- TdiBuildConnectionInfoInPlace( ToTdiConn, To );
-
- return STATUS_SUCCESS;
-}
-
PTA_ADDRESS TdiGetRemoteAddress( PTDI_CONNECTION_INFORMATION TdiConn )
/*
* Convenience function that rounds out the abstraction of
Modified: branches/aicom-network-fixes/drivers/network/afd/afd/write.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/afd/afd/write.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/afd/afd/write.c [iso-8859-1] Wed Aug 20
09:21:08 2008
@@ -47,7 +47,6 @@
if( FCB->State == SOCKET_STATE_CLOSED ) {
SocketStateUnlock( FCB );
- DestroySocket( FCB );
return STATUS_SUCCESS;
}
@@ -179,12 +178,6 @@
FCB->SendIrp.InFlightRequest = NULL;
/* Request is not in flight any longer */
- if( FCB->State == SOCKET_STATE_CLOSED ) {
- SocketStateUnlock( FCB );
- DestroySocket( FCB );
- return STATUS_SUCCESS;
- }
-
SocketStateUnlock( FCB );
return STATUS_SUCCESS;
Modified: branches/aicom-network-fixes/drivers/network/afd/include/afd.h
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/afd/include/afd.h [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/afd/include/afd.h [iso-8859-1] Wed Aug 20
09:21:08 2008
@@ -196,6 +196,7 @@
PVOID Context;
DWORD PollState;
UINT ContextSize;
+ PIRP PendingClose;
LIST_ENTRY PendingIrpList[MAX_FUNCTIONS];
LIST_ENTRY DatagramList;
LIST_ENTRY PendingConnections;