mirror of
https://github.com/reactos/reactos.git
synced 2024-09-03 17:19:20 +00:00
- Only call LockBuffers() if we must
svn path=/branches/aicom-network-fixes/; revision=35279
This commit is contained in:
parent
4873208286
commit
ce24947336
|
@ -573,18 +573,18 @@ AfdPacketSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|||
|
||||
AFD_DbgPrint(MID_TRACE,("Recv flags %x\n", RecvReq->AfdFlags));
|
||||
|
||||
RecvReq->BufferArray = LockBuffers( RecvReq->BufferArray,
|
||||
RecvReq->BufferCount,
|
||||
RecvReq->Address,
|
||||
RecvReq->AddressLength,
|
||||
TRUE, TRUE );
|
||||
|
||||
if( !RecvReq->BufferArray ) { /* access violation in userspace */
|
||||
return UnlockAndMaybeComplete
|
||||
( FCB, STATUS_ACCESS_VIOLATION, Irp, 0, NULL );
|
||||
}
|
||||
|
||||
if( !IsListEmpty( &FCB->DatagramList ) ) {
|
||||
RecvReq->BufferArray = LockBuffers( RecvReq->BufferArray,
|
||||
RecvReq->BufferCount,
|
||||
RecvReq->Address,
|
||||
RecvReq->AddressLength,
|
||||
TRUE, TRUE );
|
||||
|
||||
if( !RecvReq->BufferArray ) { /* access violation in userspace */
|
||||
return UnlockAndMaybeComplete
|
||||
( FCB, STATUS_ACCESS_VIOLATION, Irp, 0, NULL );
|
||||
}
|
||||
|
||||
ListEntry = RemoveHeadList( &FCB->DatagramList );
|
||||
DatagramRecv = CONTAINING_RECORD
|
||||
( ListEntry, AFD_STORED_DATAGRAM, ListEntry );
|
||||
|
|
|
@ -273,11 +273,6 @@ AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|||
AFD_DbgPrint(MID_TRACE,("We already have %d bytes waiting.\n",
|
||||
FCB->Send.BytesUsed));
|
||||
|
||||
SendReq->BufferArray = LockBuffers( SendReq->BufferArray,
|
||||
SendReq->BufferCount,
|
||||
NULL, NULL,
|
||||
FALSE, FALSE );
|
||||
|
||||
AFD_DbgPrint(MID_TRACE,("FCB->Send.BytesUsed = %d\n",
|
||||
FCB->Send.BytesUsed));
|
||||
|
||||
|
@ -287,6 +282,11 @@ AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
|||
AFD_DbgPrint(MID_TRACE,("We can accept %d bytes\n",
|
||||
SpaceAvail));
|
||||
|
||||
SendReq->BufferArray = LockBuffers( SendReq->BufferArray,
|
||||
SendReq->BufferCount,
|
||||
NULL, NULL,
|
||||
FALSE, FALSE );
|
||||
|
||||
for( i = 0; FCB->Send.BytesUsed < FCB->Send.Size &&
|
||||
i < SendReq->BufferCount; i++ ) {
|
||||
CopySize = MIN( SpaceAvail,
|
||||
|
|
Loading…
Reference in a new issue