[ros-diffs] [arty] 34567: Patch by Cameron Gutman (aicommander <at> gmail <dot> com) - Don't mess with cancelled IRPs - Don't attempt to cancel an already cancelled IRP - Unmap MDL when then IRP gets completed
arty at svn.reactos.org
arty at svn.reactos.org
Thu Jul 17 21:42:26 CEST 2008
- Previous message: [ros-diffs] [jmorlan] 34566: Fix argument parsing for label command. It should not split the arguments by spaces; on Windows you can do 'label c:x y z' and it will set the label to X Y Z. (Bug 3530 #2)
- Next message: [ros-diffs] [jmorlan] 34568: Clean up console code a bit: - Get/SetConsoleTitle: Get rid of unnecessary handle creation; instead, just have csrss get the console from the ProcessData. - Instead of using ShowX/ShowY to store the origin of the buffer, use the VirtualX member that was put there for this purpose. Rename it to VirtualY, though, since it's a row number. ShowX/ShowY should hold the position of the visible window, once that's implemented. - From the CSRSS_CONSOLE structure: remove hActiveBuffer (redundant), CodePageId (unused), and hWindowIcon (only used as a temporary) - Make cursor coordinates be "logical", not "physical". This simplifies various things. - ConioConsoleFromProcessData: If process has no console, return STATUS_INVALID_HANDLE; don't pretend to succeed (causing many functions to access memory around address 0, which is probably not a good thing). Remove various Console != NULL checks which are now unnecessary.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: arty
Date: Thu Jul 17 14:42:26 2008
New Revision: 34567
URL: http://svn.reactos.org/svn/reactos?rev=34567&view=rev
Log:
Patch by Cameron Gutman (aicommander <at> gmail <dot> com)
- Don't mess with cancelled IRPs
- Don't attempt to cancel an already cancelled IRP
- Unmap MDL when then IRP gets completed
Modified:
trunk/reactos/drivers/network/afd/afd/listen.c
trunk/reactos/drivers/network/afd/afd/lock.c
trunk/reactos/drivers/network/afd/afd/read.c
trunk/reactos/drivers/network/afd/afd/write.c
Modified: trunk/reactos/drivers/network/afd/afd/listen.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/listen.c?rev=34567&r1=34566&r2=34567&view=diff
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] Thu Jul 17 14:42:26 2008
@@ -82,6 +82,7 @@
if ( Irp->Cancel ) {
/* FIXME: is this anything else we need to do? */
+ FCB->ListenIrp.InFlightRequest = NULL;
return STATUS_SUCCESS;
}
Modified: trunk/reactos/drivers/network/afd/afd/lock.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lock.c?rev=34567&r1=34566&r2=34567&view=diff
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] Thu Jul 17 14:42:26 2008
@@ -243,7 +243,9 @@
otherwise it may be completed by StreamSocketConnectComplete()
before we return from SocketStateUnlock(). */
IoMarkIrpPending( Irp );
- SocketStateUnlock( FCB );
+ SocketStateUnlock( FCB );
+ if( ShouldUnlock )
+ UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) );
} else {
SocketStateUnlock( FCB );
Irp->IoStatus.Status = Status;
Modified: trunk/reactos/drivers/network/afd/afd/read.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/read.c?rev=34567&r1=34566&r2=34567&view=diff
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Thu Jul 17 14:42:26 2008
@@ -154,6 +154,7 @@
FCB->Overread ? STATUS_END_OF_FILE : STATUS_SUCCESS;
NextIrp->IoStatus.Information = 0;
if( NextIrp == Irp ) RetStatus = Status;
+ UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) );
IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT );
FCB->Overread = TRUE;
//FCB->PollState |= AFD_EVENT_DISCONNECT;
@@ -197,6 +198,7 @@
NextIrp->IoStatus.Status = Status;
NextIrp->IoStatus.Information = TotalBytesCopied;
if( NextIrp == Irp ) RetStatus = Status;
+ UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) );
IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT );
}
}
@@ -224,6 +226,11 @@
AFD_DbgPrint(MID_TRACE,("Called\n"));
ASSERT_IRQL(APC_LEVEL);
+
+ if (Irp->Cancel) {
+ FCB->ReceiveIrp.InFlightRequest = NULL;
+ return STATUS_SUCCESS;
+ }
if( !SocketAcquireStateLock( FCB ) ) return Status;
@@ -299,7 +306,7 @@
if( !RecvReq->BufferArray ) {
return UnlockAndMaybeComplete( FCB, STATUS_ACCESS_VIOLATION,
- Irp, 0, NULL, FALSE );
+ Irp, 0, NULL, TRUE );
}
Irp->IoStatus.Status = STATUS_PENDING;
@@ -440,6 +447,11 @@
UINT DGSize = Irp->IoStatus.Information + sizeof( AFD_STORED_DATAGRAM );
AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB));
+
+ if (Irp->Cancel) {
+ FCB->ReceiveIrp.InFlightRequest = NULL;
+ return STATUS_SUCCESS;
+ }
if( !SocketAcquireStateLock( FCB ) ) return STATUS_UNSUCCESSFUL;
Modified: trunk/reactos/drivers/network/afd/afd/write.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/write.c?rev=34567&r1=34566&r2=34567&view=diff
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] Thu Jul 17 14:42:26 2008
@@ -40,6 +40,11 @@
ASSERT_IRQL(APC_LEVEL);
+ if (Irp->Cancel) {
+ FCB->ReceiveIrp.InFlightRequest = NULL;
+ return STATUS_SUCCESS;
+ }
+
if( !SocketAcquireStateLock( FCB ) ) return Status;
FCB->SendIrp.InFlightRequest = NULL;
@@ -169,6 +174,11 @@
Irp->IoStatus.Status,
Irp->IoStatus.Information));
+ if (Irp->Cancel) {
+ FCB->ReceiveIrp.InFlightRequest = NULL;
+ return STATUS_SUCCESS;
+ }
+
/* It's ok if the FCB already died */
if( !SocketAcquireStateLock( FCB ) ) return STATUS_SUCCESS;
- Previous message: [ros-diffs] [jmorlan] 34566: Fix argument parsing for label command. It should not split the arguments by spaces; on Windows you can do 'label c:x y z' and it will set the label to X Y Z. (Bug 3530 #2)
- Next message: [ros-diffs] [jmorlan] 34568: Clean up console code a bit: - Get/SetConsoleTitle: Get rid of unnecessary handle creation; instead, just have csrss get the console from the ProcessData. - Instead of using ShowX/ShowY to store the origin of the buffer, use the VirtualX member that was put there for this purpose. Rename it to VirtualY, though, since it's a row number. ShowX/ShowY should hold the position of the visible window, once that's implemented. - From the CSRSS_CONSOLE structure: remove hActiveBuffer (redundant), CodePageId (unused), and hWindowIcon (only used as a temporary) - Make cursor coordinates be "logical", not "physical". This simplifies various things. - ConioConsoleFromProcessData: If process has no console, return STATUS_INVALID_HANDLE; don't pretend to succeed (causing many functions to access memory around address 0, which is probably not a good thing). Remove various Console != NULL checks which are now unnecessary.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Ros-diffs
mailing list