mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:46:17 +00:00
- Check if TdiBuildNullConnectionInfo completed successfully
- Add a comment - Fail if we can't allocate Qelt svn path=/branches/aicom-network-fixes/; revision=35786
This commit is contained in:
parent
b8a0800ce6
commit
1cc8981800
1 changed files with 11 additions and 8 deletions
|
@ -98,7 +98,7 @@ static NTSTATUS NTAPI ListenComplete
|
|||
( PDEVICE_OBJECT DeviceObject,
|
||||
PIRP Irp,
|
||||
PVOID Context ) {
|
||||
NTSTATUS Status = STATUS_FILE_CLOSED;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
PAFD_FCB FCB = (PAFD_FCB)Context;
|
||||
PAFD_TDI_OBJECT_QELT Qelt;
|
||||
|
||||
|
@ -107,7 +107,7 @@ static NTSTATUS NTAPI ListenComplete
|
|||
return STATUS_CANCELLED;
|
||||
}
|
||||
|
||||
if( !SocketAcquireStateLock( FCB ) ) return Status;
|
||||
if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED;
|
||||
|
||||
FCB->ListenIrp.InFlightRequest = NULL;
|
||||
|
||||
|
@ -122,8 +122,10 @@ static NTSTATUS NTAPI ListenComplete
|
|||
|
||||
Qelt = ExAllocatePool( NonPagedPool, sizeof(*Qelt) );
|
||||
if( !Qelt ) {
|
||||
/* Is this correct? */
|
||||
TdiCloseDevice( FCB->Connection.Handle,
|
||||
FCB->Connection.Object );
|
||||
Status = STATUS_NO_MEMORY;
|
||||
} else {
|
||||
UINT AddressType =
|
||||
FCB->LocalAddress->Address[0].AddressType;
|
||||
|
@ -136,11 +138,12 @@ static NTSTATUS NTAPI ListenComplete
|
|||
ConnectionReturnInfo->RemoteAddress));
|
||||
|
||||
TdiBuildNullConnectionInfo( &Qelt->ConnInfo, AddressType );
|
||||
TaCopyTransportAddressInPlace
|
||||
( Qelt->ConnInfo->RemoteAddress,
|
||||
FCB->ListenIrp.ConnectionReturnInfo->RemoteAddress );
|
||||
|
||||
InsertTailList( &FCB->PendingConnections, &Qelt->ListEntry );
|
||||
if( Qelt->ConnInfo ) {
|
||||
TaCopyTransportAddressInPlace
|
||||
( Qelt->ConnInfo->RemoteAddress,
|
||||
FCB->ListenIrp.ConnectionReturnInfo->RemoteAddress );
|
||||
InsertTailList( &FCB->PendingConnections, &Qelt->ListEntry );
|
||||
} else Status = STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
/* Satisfy a pre-accept request if one is available */
|
||||
|
@ -168,7 +171,7 @@ static NTSTATUS NTAPI ListenComplete
|
|||
|
||||
SocketStateUnlock( FCB );
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
return Status;
|
||||
}
|
||||
|
||||
NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue