- Make sure we successfully allocated ConnectionReturnInfo and ConnectionCallInfo

- Make sure ObReferenceObjectByHandle was successful

svn path=/branches/aicom-network-fixes/; revision=35398
This commit is contained in:
Cameron Gutman 2008-08-16 21:16:41 +00:00
parent 05a4dffa6e
commit 54a02c3ea8

View file

@ -188,8 +188,6 @@ NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp,
if( !NT_SUCCESS(Status) ) return UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL );
FCB->State = SOCKET_STATE_LISTENING;
TdiBuildNullConnectionInfo
( &FCB->ListenIrp.ConnectionCallInfo,
FCB->LocalAddress->Address[0].AddressType );
@ -197,6 +195,11 @@ NTSTATUS AfdListenSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp,
( &FCB->ListenIrp.ConnectionReturnInfo,
FCB->LocalAddress->Address[0].AddressType );
if( !FCB->ListenIrp.ConnectionReturnInfo || !FCB->ListenIrp.ConnectionCallInfo )
return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL );
FCB->State = SOCKET_STATE_LISTENING;
Status = TdiListen( &FCB->ListenIrp.InFlightRequest,
FCB->Connection.Object,
&FCB->ListenIrp.ConnectionCallInfo,
@ -271,6 +274,8 @@ NTSTATUS AfdAccept( PDEVICE_OBJECT DeviceObject, PIRP Irp,
( &FCB->ListenIrp.ConnectionReturnInfo,
FCB->LocalAddress->Address[0].AddressType );
if( !FCB->ListenIrp.ConnectionReturnInfo ) return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0, NULL );
Status = TdiListen( &FCB->ListenIrp.InFlightRequest,
FCB->Connection.Object,
&FCB->ListenIrp.ConnectionCallInfo,
@ -305,6 +310,8 @@ NTSTATUS AfdAccept( PDEVICE_OBJECT DeviceObject, PIRP Irp,
(PVOID *)&NewFileObject,
NULL );
if( !NT_SUCCESS(Status) ) UnlockAndMaybeComplete( FCB, Status, Irp, 0, NULL );
ASSERT(NewFileObject != FileObject);
ASSERT(NewFileObject->FsContext != FCB);