lock: Fixes suggested by w3seek:

protect the remaining MmProbeAndLockPages
don't return from the exception handler

read: Hopefully the last indecision in here:

Avoid using AFD_EVENT_CLOSE until the socket is really toast.
Use AFD_EVENT_DISCONNECT instead when we've got an EOF, but still have
buffered data.
I was doing this socket fiddling without a callout block.  Fixed.

svn path=/trunk/; revision=14584
This commit is contained in:
Art Yerkes 2005-04-11 06:03:20 +00:00
parent 7bbf6258d7
commit 9166ff8f34
2 changed files with 13 additions and 14 deletions

View file

@ -59,7 +59,14 @@ PAFD_WSABUF LockBuffers( PAFD_WSABUF Buf, UINT Count,
_SEH_TRY {
RtlCopyMemory( NewBuf, Buf, sizeof(AFD_WSABUF) * Count );
NewBufferLen = *AddressLen;
if( LockAddress ) {
NewBuf[Count].buf = AddressBuf;
NewBuf[Count].len = NewBufferLen;
Count++;
NewBuf[Count].buf = (PVOID)AddressLen;
NewBuf[Count].len = sizeof(*AddressLen);
Count++;
}
} _SEH_HANDLE {
AFD_DbgPrint(MIN_TRACE,("Access violation copying buffer info "
"from userland (%x %x)\n",
@ -68,15 +75,6 @@ PAFD_WSABUF LockBuffers( PAFD_WSABUF Buf, UINT Count,
return NULL;
} _SEH_END;
if( LockAddress ) {
NewBuf[Count].buf = AddressBuf;
NewBuf[Count].len = NewBufferLen;
Count++;
NewBuf[Count].buf = (PVOID)AddressLen;
NewBuf[Count].len = sizeof(*AddressLen);
Count++;
}
for( i = 0; i < Count; i++ ) {
AFD_DbgPrint(MID_TRACE,("Locking buffer %d (%x:%d)\n",
i, NewBuf[i].buf, NewBuf[i].len));

View file

@ -36,7 +36,7 @@ BOOLEAN CantReadMore( PAFD_FCB FCB ) {
VOID HandleEOFOnIrp( PAFD_FCB FCB, NTSTATUS Status, UINT Information ) {
if( Status == STATUS_SUCCESS && Information == 0 ) {
AFD_DbgPrint(MID_TRACE,("Looks like an EOF\n"));
FCB->PollState |= AFD_EVENT_CLOSE /*| AFD_EVENT_DISCONNECT */;
FCB->PollState |= AFD_EVENT_DISCONNECT;
PollReeval( FCB->DeviceExt, FCB->FileObject );
}
}
@ -109,10 +109,11 @@ NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
ReceiveComplete,
FCB );
if( Status == STATUS_SUCCESS )
FCB->Recv.Content = FCB->ReceiveIrp.Iosb.Information;
HandleEOFOnIrp( FCB, Status, FCB->Recv.Content );
SocketCalloutLeave( FCB );
if( Status == STATUS_SUCCESS )
FCB->Recv.Content = FCB->ReceiveIrp.Iosb.Information;
HandleEOFOnIrp( FCB, Status, FCB->ReceiveIrp.Iosb.Information );
}
}