ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2008
----- 2024 -----
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
27 participants
853 discussions
Start a n
N
ew thread
[cgutman] 35484: - Revert 35477-35481
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 20 13:46:38 2008 New Revision: 35484 URL:
http://svn.reactos.org/svn/reactos?rev=35484&view=rev
Log: - Revert 35477-35481 Modified: branches/aicom-network-fixes/drivers/network/afd/afd/listen.c branches/aicom-network-fixes/drivers/network/afd/afd/lock.c branches/aicom-network-fixes/drivers/network/afd/afd/main.c branches/aicom-network-fixes/drivers/network/afd/afd/read.c branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c branches/aicom-network-fixes/drivers/network/afd/afd/write.c branches/aicom-network-fixes/drivers/network/afd/include/afd.h branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c Modified: branches/aicom-network-fixes/drivers/network/afd/afd/listen.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/listen.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/listen.c [iso-8859-1] Wed Aug 20 13:46:38 2008 @@ -87,14 +87,14 @@ PAFD_FCB FCB = (PAFD_FCB)Context; PAFD_TDI_OBJECT_QELT Qelt; + if( !SocketAcquireStateLock( FCB ) ) return Status; + + FCB->ListenIrp.InFlightRequest = NULL; + if( Irp->Cancel ) { - if( FCB ) FCB->ListenIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - - if( !SocketAcquireStateLock( FCB ) ) return Status; - - FCB->ListenIrp.InFlightRequest = NULL; + SocketStateUnlock( FCB ); + return STATUS_SUCCESS; + } if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); Modified: branches/aicom-network-fixes/drivers/network/afd/afd/lock.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/lock.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/lock.c [iso-8859-1] Wed Aug 20 13:46:38 2008 @@ -68,7 +68,7 @@ BOOLEAN Write, BOOLEAN LockAddress ) { UINT i; /* Copy the buffer array so we don't lose it */ - UINT Lock = LockAddress ? 2 : 0; + UINT Lock = (LockAddress && AddressLen) ? 2 : 0; UINT Size = sizeof(AFD_WSABUF) * (Count + Lock); PAFD_WSABUF NewBuf = ExAllocatePool( PagedPool, Size * 2 ); PMDL NewMdl; @@ -80,16 +80,13 @@ _SEH_TRY { RtlCopyMemory( NewBuf, Buf, sizeof(AFD_WSABUF) * Count ); - if( LockAddress && AddressLen ) { + if( LockAddress ) { NewBuf[Count].buf = AddressBuf; NewBuf[Count].len = *AddressLen; Count++; NewBuf[Count].buf = (PVOID)AddressLen; NewBuf[Count].len = sizeof(*AddressLen); Count++; - } else if( LockAddress ) { - RtlZeroMemory(NewBuf, sizeof(*NewBuf) * 2); - Count += 2; } } _SEH_HANDLE { AFD_DbgPrint(MIN_TRACE,("Access violation copying buffer info " Modified: branches/aicom-network-fixes/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/main.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/main.c [iso-8859-1] Wed Aug 20 13:46:38 2008 @@ -153,7 +153,52 @@ } VOID DestroySocket( PAFD_FCB FCB ) { + UINT i; + BOOLEAN ReturnEarly = FALSE; + PAFD_IN_FLIGHT_REQUEST InFlightRequest[IN_FLIGHT_REQUESTS]; + AFD_DbgPrint(MIN_TRACE,("Called (%x)\n", FCB)); + + if( !SocketAcquireStateLock( FCB ) ) return; + + FCB->State = SOCKET_STATE_CLOSED; + + InFlightRequest[0] = &FCB->ListenIrp; + InFlightRequest[1] = &FCB->ReceiveIrp; + InFlightRequest[2] = &FCB->SendIrp; + InFlightRequest[3] = &FCB->ConnectIrp; + + /* Return early here because we might be called in the mean time. */ + if( FCB->Critical || + FCB->ListenIrp.InFlightRequest || + FCB->ReceiveIrp.InFlightRequest || + FCB->SendIrp.InFlightRequest || + FCB->ConnectIrp.InFlightRequest ) { + AFD_DbgPrint(MIN_TRACE,("Leaving socket alive (%x %x %x %x)\n", + FCB->ListenIrp.InFlightRequest, + FCB->ReceiveIrp.InFlightRequest, + FCB->SendIrp.InFlightRequest, + FCB->ConnectIrp.InFlightRequest)); + ReturnEarly = TRUE; + } + + /* After PoolReeval, this FCB should not be involved in any outstanding + * poll requests */ + + /* Cancel our pending requests */ + for( i = 0; i < IN_FLIGHT_REQUESTS; i++ ) { + if( InFlightRequest[i]->InFlightRequest ) { + AFD_DbgPrint(MID_TRACE,("Cancelling in flight irp %d (%x)\n", + i, InFlightRequest[i]->InFlightRequest)); + InFlightRequest[i]->InFlightRequest->IoStatus.Status = STATUS_CANCELLED; + InFlightRequest[i]->InFlightRequest->IoStatus.Information = 0; + IoCancelIrp( InFlightRequest[i]->InFlightRequest ); + } + } + + SocketStateUnlock( FCB ); + + if( ReturnEarly ) return; if( FCB->Recv.Window ) ExFreePool( FCB->Recv.Window ); @@ -182,12 +227,8 @@ AfdCloseSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp) { - UINT i; - AFD_IN_FLIGHT_REQUEST InFlightRequest[IN_FLIGHT_REQUESTS]; PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; - - if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); AFD_DbgPrint(MID_TRACE, ("AfdClose(DeviceObject %p Irp %p)\n", DeviceObject, Irp)); @@ -201,57 +242,15 @@ if( FCB->EventSelect ) ObDereferenceObject( FCB->EventSelect ); FileObject->FsContext = NULL; - - FCB->State = SOCKET_STATE_CLOSED; - SocketStateUnlock(FCB); - - InFlightRequest[0] = FCB->ListenIrp; - InFlightRequest[1] = FCB->ReceiveIrp; - InFlightRequest[2] = FCB->SendIrp; - InFlightRequest[3] = FCB->ConnectIrp; - - /* Return early here because we might be called in the mean time. */ - if( !(FCB->Critical || - FCB->ListenIrp.InFlightRequest || - FCB->ReceiveIrp.InFlightRequest || - FCB->SendIrp.InFlightRequest || - FCB->ConnectIrp.InFlightRequest) ) { - AFD_DbgPrint(MIN_TRACE,("Leaving socket alive (%x %x %x)\n", - FCB->ListenIrp.InFlightRequest, - FCB->ReceiveIrp.InFlightRequest, - FCB->SendIrp.InFlightRequest)); - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - } - else - { - /* After PoolReeval, this FCB should not be involved in any outstanding - * poll requests */ - - /* Cancel our pending requests */ - for( i = 0; i < IN_FLIGHT_REQUESTS; i++ ) { - NTSTATUS Status = STATUS_NO_SUCH_FILE; - if( InFlightRequest[i].InFlightRequest ) { - AFD_DbgPrint(MID_TRACE,("Cancelling in flight irp %d (%x)\n", - i, InFlightRequest[i].InFlightRequest)); - InFlightRequest[i].InFlightRequest->IoStatus.Status = Status; - InFlightRequest[i].InFlightRequest->IoStatus.Information = 0; - IoCancelIrp( InFlightRequest[i].InFlightRequest ); - } - } - - FCB->PendingClose = Irp; - DestroySocket( FCB ); - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - } + DestroySocket( FCB ); + + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); AFD_DbgPrint(MID_TRACE, ("Returning success.\n")); - return Irp->IoStatus.Status; + return STATUS_SUCCESS; } static NTSTATUS STDCALL Modified: branches/aicom-network-fixes/drivers/network/afd/afd/read.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/read.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/read.c [iso-8859-1] Wed Aug 20 13:46:38 2008 @@ -233,11 +233,6 @@ ASSERT_IRQL(APC_LEVEL); - if( Irp->Cancel ) { - if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->ReceiveIrp.InFlightRequest = NULL; @@ -247,6 +242,7 @@ if( FCB->State == SOCKET_STATE_CLOSED ) { AFD_DbgPrint(MIN_TRACE,("!!! CLOSED SOCK GOT A RECEIVE COMPLETE !!!\n")); SocketStateUnlock( FCB ); + DestroySocket( FCB ); return STATUS_SUCCESS; } else if( FCB->State == SOCKET_STATE_LISTENING ) { AFD_DbgPrint(MIN_TRACE,("!!! LISTENER GOT A RECEIVE COMPLETE !!!\n")); @@ -453,17 +449,13 @@ AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); - if( Irp->Cancel ) { - if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; FCB->ReceiveIrp.InFlightRequest = NULL; if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); + DestroySocket( FCB ); return STATUS_SUCCESS; } Modified: branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c [iso-8859-1] Wed Aug 20 13:46:38 2008 @@ -172,6 +172,54 @@ return Status; } +NTSTATUS +TdiBuildConnectionInfoPair +( PTDI_CONNECTION_INFO_PAIR ConnectionInfo, + PTRANSPORT_ADDRESS From, PTRANSPORT_ADDRESS To ) + /* + * FUNCTION: Fill a TDI_CONNECTION_INFO_PAIR struct will the two addresses + * given. + * ARGUMENTS: + * ConnectionInfo: The pair + * From: The from address + * To: The to address + * RETURNS: + * Status of the operation + */ +{ + PCHAR LayoutFrame; + UINT SizeOfEntry; + ULONG TdiAddressSize; + PTDI_CONNECTION_INFORMATION FromTdiConn, ToTdiConn; + + /* FIXME: Get from socket information */ + TdiAddressSize = TdiAddressSizeFromType(From->Address[0].AddressType); + SizeOfEntry = TdiAddressSize + sizeof(TDI_CONNECTION_INFORMATION); + + LayoutFrame = (PCHAR)ExAllocatePool(NonPagedPool, 2 * SizeOfEntry); + + if (!LayoutFrame) { + AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlZeroMemory( LayoutFrame, 2 * SizeOfEntry ); + + FromTdiConn = (PTDI_CONNECTION_INFORMATION)LayoutFrame; + ToTdiConn = (PTDI_CONNECTION_INFORMATION)LayoutFrame + SizeOfEntry; + + if (From != NULL) { + TdiBuildConnectionInfoInPlace( FromTdiConn, From ); + } else { + TdiBuildNullConnectionInfoInPlace( FromTdiConn, + From->Address[0].AddressType ); + } + + TdiBuildConnectionInfoInPlace( ToTdiConn, To ); + + return STATUS_SUCCESS; +} + PTA_ADDRESS TdiGetRemoteAddress( PTDI_CONNECTION_INFORMATION TdiConn ) /* * Convenience function that rounds out the abstraction of Modified: branches/aicom-network-fixes/drivers/network/afd/afd/write.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/write.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/write.c [iso-8859-1] Wed Aug 20 13:46:38 2008 @@ -40,11 +40,6 @@ ASSERT_IRQL(APC_LEVEL); - if( Irp->Cancel ) { - if( FCB ) FCB->SendIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->SendIrp.InFlightRequest = NULL; @@ -52,6 +47,7 @@ if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); + DestroySocket( FCB ); return STATUS_SUCCESS; } @@ -174,11 +170,6 @@ Irp->IoStatus.Status, Irp->IoStatus.Information)); - if( Irp->Cancel ) { - if( FCB ) FCB->SendIrp.InFlightRequest = NULL; - return STATUS_CANCELLED; - } - /* It's ok if the FCB already died */ if( !SocketAcquireStateLock( FCB ) ) return STATUS_SUCCESS; @@ -187,6 +178,12 @@ FCB->SendIrp.InFlightRequest = NULL; /* Request is not in flight any longer */ + + if( FCB->State == SOCKET_STATE_CLOSED ) { + SocketStateUnlock( FCB ); + DestroySocket( FCB ); + return STATUS_SUCCESS; + } SocketStateUnlock( FCB ); Modified: branches/aicom-network-fixes/drivers/network/afd/include/afd.h URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/include/afd.h [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/include/afd.h [iso-8859-1] Wed Aug 20 13:46:38 2008 @@ -196,7 +196,6 @@ PVOID Context; DWORD PollState; UINT ContextSize; - PIRP PendingClose; LIST_ENTRY PendingIrpList[MAX_FUNCTIONS]; LIST_ENTRY DatagramList; LIST_ENTRY PendingConnections; Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Wed Aug 20 13:46:38 2008 @@ -52,6 +52,34 @@ return IRPFinish(Irp, STATUS_CANCELLED); } + + +VOID DispCancelComplete( + PVOID Context) +/* + * FUNCTION: Completes a cancel request + * ARGUMENTS: + * Context = Pointer to context information (FILE_OBJECT) + */ +{ + /*KIRQL OldIrql;*/ + PFILE_OBJECT FileObject; + PTRANSPORT_CONTEXT TranContext; + + TI_DbgPrint(DEBUG_IRP, ("Called.\n")); + + FileObject = (PFILE_OBJECT)Context; + TranContext = (PTRANSPORT_CONTEXT)FileObject->FsContext; + + /* Set the cleanup event */ + KeSetEvent(&TranContext->CleanupEvent, 0, FALSE); + + /* We are expected to release the cancel spin lock */ + /*IoReleaseCancelSpinLock(OldIrql);*/ + + TI_DbgPrint(DEBUG_IRP, ("Leaving.\n")); +} + VOID DispDataRequestComplete( PVOID Context, @@ -127,14 +155,8 @@ TI_DbgPrint(DEBUG_IRP, ("PostCancel: DoDisconnect done\n")); DispDataRequestComplete(DisType->Irp, STATUS_CANCELLED, 0); -} - -VOID DispDoPacketCancel( PVOID Data ) { - TI_DbgPrint(DEBUG_IRP, ("Called.\n")); - PIRP *IrpP = (PIRP *)Data, Irp = *IrpP; - Irp->IoStatus.Status = STATUS_CANCELLED; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + + DispCancelComplete(DisType->FileObject); } VOID NTAPI DispCancelRequest( @@ -153,7 +175,6 @@ UCHAR MinorFunction; DISCONNECT_TYPE DisType; PVOID WorkItem; - PADDRESS_FILE AddrFile; /*NTSTATUS Status = STATUS_SUCCESS;*/ TI_DbgPrint(DEBUG_IRP, ("Called.\n")); @@ -188,23 +209,24 @@ if( !ChewCreate( &WorkItem, sizeof(DISCONNECT_TYPE), DispDoDisconnect, &DisType ) ) ASSERT(0); - return; + break; case TDI_SEND_DATAGRAM: if (FileObject->FsContext2 != (PVOID)TDI_TRANSPORT_ADDRESS_FILE) { TI_DbgPrint(MIN_TRACE, ("TDI_SEND_DATAGRAM, but no address file.\n")); break; } - /* Nothing to do. We don't keep them around. */ + + /*DGCancelSendRequest(TranContext->Handle.AddressHandle, Irp);*/ break; case TDI_RECEIVE_DATAGRAM: - AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle; if (FileObject->FsContext2 != (PVOID)TDI_TRANSPORT_ADDRESS_FILE) { TI_DbgPrint(MIN_TRACE, ("TDI_RECEIVE_DATAGRAM, but no address file.\n")); break; } - DGRemoveIRP(AddrFile, Irp); + + /*DGCancelReceiveRequest(TranContext->Handle.AddressHandle, Irp);*/ break; default: @@ -213,8 +235,7 @@ } IoReleaseCancelSpinLock(Irp->CancelIrql); - IoCompleteRequest(Irp, IO_NO_INCREMENT); - + TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } @@ -258,6 +279,9 @@ IoReleaseCancelSpinLock(Irp->CancelIrql); DispDataRequestComplete(Irp, STATUS_CANCELLED, 0); + + DispCancelComplete(FileObject); + TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } @@ -793,6 +817,7 @@ return Status; } + NTSTATUS DispTdiReceiveDatagram( PIRP Irp) /* @@ -809,7 +834,6 @@ TDI_REQUEST Request; NTSTATUS Status; ULONG BytesReceived; - PADDRESS_FILE AddrFile; TI_DbgPrint(DEBUG_IRP, ("Called.\n")); @@ -823,8 +847,6 @@ return STATUS_INVALID_ADDRESS; } - AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle; - /* Initialize a receive request */ Request.Handle.AddressHandle = TranContext->Handle.AddressHandle; Request.RequestNotifyObject = DispDataRequestComplete; @@ -844,21 +866,21 @@ &DataBuffer, &BufferSize ); - Status = DGReceiveDatagram( - AddrFile, - DgramInfo->ReceiveDatagramInformation, - DataBuffer, - DgramInfo->ReceiveLength, - DgramInfo->ReceiveFlags, - DgramInfo->ReturnDatagramInformation, - &BytesReceived, - (PDATAGRAM_COMPLETION_ROUTINE)DispDataRequestComplete, - Irp, - Irp); - if (Status != STATUS_PENDING) { - DispDataRequestComplete(Irp, Status, BytesReceived); - } else - IoMarkIrpPending(Irp); + Status = DGReceiveDatagram( + Request.Handle.AddressHandle, + DgramInfo->ReceiveDatagramInformation, + DataBuffer, + DgramInfo->ReceiveLength, + DgramInfo->ReceiveFlags, + DgramInfo->ReturnDatagramInformation, + &BytesReceived, + (PDATAGRAM_COMPLETION_ROUTINE)DispDataRequestComplete, + Irp, + Irp); + if (Status != STATUS_PENDING) { + DispDataRequestComplete(Irp, Status, BytesReceived); + } else + IoMarkIrpPending(Irp); } TI_DbgPrint(DEBUG_IRP, ("Leaving. Status is (0x%X)\n", Status)); Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Wed Aug 20 13:46:38 2008 @@ -138,6 +138,7 @@ } CP Context->CancelIrps = FALSE; + KeInitializeEvent(&Context->CleanupEvent, NotificationEvent, FALSE); CP IrpSp = IoGetCurrentIrpStackLocation(Irp); IrpSp->FileObject->FsContext = Context; @@ -265,11 +266,20 @@ { PIRP Irp; PIO_STACK_LOCATION IrpSp; + PTRANSPORT_CONTEXT TranContext; + KIRQL OldIrql; Irp = (PIRP)Context; IrpSp = IoGetCurrentIrpStackLocation(Irp); + TranContext = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext; Irp->IoStatus.Status = Status; + + IoAcquireCancelSpinLock(&OldIrql); + + KeSetEvent(&TranContext->CleanupEvent, 0, FALSE); + + IoReleaseCancelSpinLock(OldIrql); } @@ -303,6 +313,7 @@ IoAcquireCancelSpinLock(&OldIrql); Context->CancelIrps = TRUE; + KeResetEvent(&Context->CleanupEvent); IoReleaseCancelSpinLock(OldIrql); @@ -337,6 +348,16 @@ Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; return Irp->IoStatus.Status; + } + + if (Status != STATUS_PENDING) + { + IoAcquireCancelSpinLock(&OldIrql); + KeSetEvent(&Context->CleanupEvent, 0, FALSE); + IoReleaseCancelSpinLock(OldIrql); + + KeWaitForSingleObject(&Context->CleanupEvent, + UserRequest, KernelMode, FALSE, NULL); } Irp->IoStatus.Status = Status;
16 years, 2 months
1
0
0
0
[cwittich] 35483: add support for edit->copy menu
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Aug 20 13:10:51 2008 New Revision: 35483 URL:
http://svn.reactos.org/svn/reactos?rev=35483&view=rev
Log: add support for edit->copy menu Modified: trunk/tools/reactosdbg/RosDBG/MainWindow.Designer.cs trunk/tools/reactosdbg/RosDBG/MainWindow.cs trunk/tools/reactosdbg/RosDBG/RawTraffic.Designer.cs trunk/tools/reactosdbg/RosDBG/RawTraffic.cs trunk/tools/reactosdbg/RosDBG/ReactOSWeb.cs trunk/tools/reactosdbg/RosDBG/SourceView.Designer.cs trunk/tools/reactosdbg/RosDBG/SourceView.cs trunk/tools/reactosdbg/RosDBG/SourceView.resx Modified: trunk/tools/reactosdbg/RosDBG/MainWindow.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MainWindow…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/MainWindow.Designer.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/MainWindow.Designer.cs [iso-8859-1] Wed Aug 20 13:10:51 2008 @@ -200,6 +200,7 @@ this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; this.copyToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.copyToolStripMenuItem.Text = "Copy"; + this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); // // pasteToInteractionToolStripMenuItem // Modified: trunk/tools/reactosdbg/RosDBG/MainWindow.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/MainWindow…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/MainWindow.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/MainWindow.cs [iso-8859-1] Wed Aug 20 13:10:51 2008 @@ -28,7 +28,8 @@ SymbolContext mSymbolContext; Dictionary<uint, Module> mModules = new Dictionary<uint, Module>(); Dictionary<string, SourceView> mSourceFiles = new Dictionary<string, SourceView>(); - + public event CopyEventHandler CopyEvent; + public DebugConnection DebugConnection { get { return mConnection; } @@ -96,6 +97,11 @@ mConnection.DebugModuleChangedEvent += DebugModuleChangedEvent; ComposeTitleString(); mSymbolContext.ReactosOutputPath = Settings.OutputDirectory; + } + + void CanCopyChanged(object sender, CanCopyChangedEventArgs args) + { + copyToolStripMenuItem.Enabled = args.Enabled; } void DebugModuleChangedEvent(object sender, DebugModuleChangedEventArgs args) @@ -169,6 +175,12 @@ tp.Text = ctrl.Tag != null ? ctrl.Tag.ToString() : ctrl.GetType().Name; ctrl.Dock = DockStyle.Fill; WorkTabs.Controls.Add(tp); + + if (ctrl.GetType() == typeof(SourceView)) + ((SourceView)ctrl).CanCopyChangedEvent += CanCopyChanged; + else if (ctrl.GetType() == typeof(RawTraffic)) + ((RawTraffic)ctrl).CanCopyChangedEvent += CanCopyChanged; + ResumeLayout(); } @@ -331,6 +343,13 @@ mConnection.Start(targetSelect.PipeName); } } + + private void copyToolStripMenuItem_Click(object sender, EventArgs e) + { + if (CopyEvent != null) + CopyEvent(this, new CopyEventArgs(WorkTabs.SelectedTab.Controls[0])); + } + } public class InteractiveInputEventArgs : EventArgs @@ -339,4 +358,25 @@ public string Command { get { return mCommand; } } public InteractiveInputEventArgs(object sender, string cmd) { mCommand = cmd; } } + + public class CanCopyChangedEventArgs : EventArgs + { + public readonly bool Enabled; + public CanCopyChangedEventArgs(bool enabled) + { + Enabled = enabled; + } + } + + public class CopyEventArgs : EventArgs + { + public readonly object Obj; + public CopyEventArgs(object obj) + { + Obj = obj; + } + } + + public delegate void CanCopyChangedEventHandler(object sender, CanCopyChangedEventArgs args); + public delegate void CopyEventHandler(object sender, CopyEventArgs args); } Modified: trunk/tools/reactosdbg/RosDBG/RawTraffic.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RawTraffic…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/RawTraffic.Designer.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/RawTraffic.Designer.cs [iso-8859-1] Wed Aug 20 13:10:51 2008 @@ -43,6 +43,7 @@ this.RawTrafficText.Size = new System.Drawing.Size(150, 150); this.RawTrafficText.TabIndex = 0; this.RawTrafficText.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.RawTrafficText_KeyPress); + this.RawTrafficText.MouseUp += new System.Windows.Forms.MouseEventHandler(this.RawTrafficText_MouseUp); // // RawTraffic // Modified: trunk/tools/reactosdbg/RosDBG/RawTraffic.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/RawTraffic…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/RawTraffic.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/RawTraffic.cs [iso-8859-1] Wed Aug 20 13:10:51 2008 @@ -15,6 +15,13 @@ { DebugConnection mConnection; List<string> textToAdd = new List<string>(); + public event CanCopyChangedEventHandler CanCopyChangedEvent; + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + ((MainWindow)this.ParentForm).CopyEvent += CopyEvent; + } public void SetDebugConnection(DebugConnection conn) { @@ -43,6 +50,12 @@ Invoke(Delegate.CreateDelegate(typeof(NoParamsDelegate), this, "UpdateText")); } + void CopyEvent(object sender, CopyEventArgs args) + { + if (args.Obj == this) + Clipboard.SetText(RawTrafficText.SelectedText); + } + public RawTraffic() { InitializeComponent(); @@ -53,5 +66,11 @@ { mConnection.Debugger.Write("" + e.KeyChar); } + + private void RawTrafficText_MouseUp(object sender, MouseEventArgs e) + { + if (CanCopyChangedEvent != null) + CanCopyChangedEvent(this, new CanCopyChangedEventArgs(RawTrafficText.SelectionLength != 0)); + } } } Modified: trunk/tools/reactosdbg/RosDBG/ReactOSWeb.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/ReactOSWeb…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/ReactOSWeb.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/ReactOSWeb.cs [iso-8859-1] Wed Aug 20 13:10:51 2008 @@ -69,8 +69,7 @@ { navForward.Enabled = BrowserView.CanGoForward; } - - + private void AddressInput_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Return) Modified: trunk/tools/reactosdbg/RosDBG/SourceView.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/SourceView…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/SourceView.Designer.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/SourceView.Designer.cs [iso-8859-1] Wed Aug 20 13:10:51 2008 @@ -30,10 +30,10 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SourceView)); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.SourceCode = new System.Windows.Forms.RichTextBox(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.btnCopy = new System.Windows.Forms.ToolStripButton(); this.btnBreakpoint = new System.Windows.Forms.ToolStripButton(); + this.SourceCode = new System.Windows.Forms.RichTextBox(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); @@ -58,17 +58,6 @@ this.splitContainer1.Size = new System.Drawing.Size(497, 308); this.splitContainer1.SplitterDistance = 25; this.splitContainer1.TabIndex = 2; - // - // SourceCode - // - this.SourceCode.Dock = System.Windows.Forms.DockStyle.Fill; - this.SourceCode.Location = new System.Drawing.Point(0, 0); - this.SourceCode.Name = "SourceCode"; - this.SourceCode.ReadOnly = true; - this.SourceCode.Size = new System.Drawing.Size(497, 279); - this.SourceCode.TabIndex = 3; - this.SourceCode.Text = ""; - this.SourceCode.SelectionChanged += new System.EventHandler(this.SourceCode_SelectionChanged); // // toolStrip1 // @@ -102,6 +91,17 @@ this.btnBreakpoint.Size = new System.Drawing.Size(23, 22); this.btnBreakpoint.ToolTipText = "Set Breakpoint"; // + // SourceCode + // + this.SourceCode.Dock = System.Windows.Forms.DockStyle.Fill; + this.SourceCode.Location = new System.Drawing.Point(0, 0); + this.SourceCode.Name = "SourceCode"; + this.SourceCode.ReadOnly = true; + this.SourceCode.Size = new System.Drawing.Size(497, 279); + this.SourceCode.TabIndex = 3; + this.SourceCode.Text = ""; + this.SourceCode.SelectionChanged += new System.EventHandler(this.SourceCode_SelectionChanged); + // // SourceView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -123,9 +123,9 @@ private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.RichTextBox SourceCode; private System.Windows.Forms.ToolStripButton btnCopy; private System.Windows.Forms.ToolStripButton btnBreakpoint; + private System.Windows.Forms.RichTextBox SourceCode; } } Modified: trunk/tools/reactosdbg/RosDBG/SourceView.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/SourceView…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/SourceView.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/SourceView.cs [iso-8859-1] Wed Aug 20 13:10:51 2008 @@ -10,9 +10,12 @@ namespace RosDBG { + public partial class SourceView : UserControl { string mSourceFile; + public event CanCopyChangedEventHandler CanCopyChangedEvent; + public string SourceFile { get { return mSourceFile; } @@ -27,6 +30,7 @@ { base.OnLoad(e); SourceCode.BackColor = Color.FromKnownColor(KnownColor.Window); + ((MainWindow)this.ParentForm).CopyEvent += CopyEvent; } public void ScrollTo(int line) @@ -81,14 +85,25 @@ } } + void CopyEvent(object sender, CopyEventArgs args) + { + if (args.Obj == this) + Clipboard.SetText(SourceCode.SelectedText); + } + private void SourceCode_SelectionChanged(object sender, EventArgs e) { btnCopy.Enabled = (SourceCode.SelectionLength > 0); - } + + if (CanCopyChangedEvent != null) + CanCopyChangedEvent(this, new CanCopyChangedEventArgs(btnCopy.Enabled)); + } private void btnCopy_Click(object sender, EventArgs e) { - Clipboard.SetText(SourceCode.SelectedText); + CopyEvent(this, new CopyEventArgs(this)); } + } + } Modified: trunk/tools/reactosdbg/RosDBG/SourceView.resx URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/SourceView…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/SourceView.resx [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/SourceView.resx [iso-8859-1] Wed Aug 20 13:10:51 2008 @@ -139,18 +139,18 @@ <data name="btnBreakpoint.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlNJREFUOE+10l9I - U1EcB3Bfe/MhCHzqoYeKIpD+WJi0kolUuAos2EgykjGa5eya0839uc47zf2rrc1tbW5NclKsQRIKKj4E - abFypW1amKvG1Mq5TMnyfrvXIJBs2kMHzsOPc36f3+F3fhkZ/2sNPuraccuhEfgcWkglF7f2BQKZ667V - rCGO+N0Ubtspem5cTbdayHF/K4Vgu0O6LsTb0kDPT5Bgq2PKCI+NxMKEZjkODfYcWBNxmZVz9KSBSaB+ - ARY12Nhra4BNJ4PHri9KizhNdUyCHl6rCpg0wmWSg2Ygt0WFr29JWHXSnrSAUS1erui6LgWdMMLWdAVL - DGhtJLAY06K+6lx0BeA2K+Uuswrsfhj0XKOIEiZRD7uhAovvmnBTI8Ti+0Y011zA/EQ9JKXHR34Dfp1u - g9emQfI1yRyS6HApIRPy8CPehO72y0hF5ei/K8aXNwq03yhDKlILEZ8bXvECn51SS/iHMD2ixOyYDFYl - DwsxCjNjaiRHZZiJSPE5QiAZlSIeEuH8idwnf/Sgzd5ILCPhSkw9K8fMKyVSo2rMRhT4OFyLxNBVJEKX - EO06DcHRff2rNtFhkt9hkQ8DQsQHyzHFJH0arsH0i2rEHpfh+b0C9Dnz6DOFu3tXBQIBQ2ZVCZdkkaEH - pxAK8OiXnSfp8P1jeOo/jAFfLrTi3G+Ss1zrX7+xrVmxkWmigkU6dPl0dwuH7nflodOcs1Rdmv298OB2 - EKX5WWnnQCHibqkrL64UFO0P5uzMWtizbRM4ezeP8AuynRXFnF1rjvK/XPgJ7YdwWhzybo4AAAAASUVO - RK5CYII= + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlRJREFUOE+10l9I + U1EcB3Bfe/MhiHrqoYeKIorEiiVZtooKR4EFG8mKZImunN1sunm33a5X16ZbzXbbdLoxaYtqCkYYaOwh + yFUrFW3T/mk1/FPNP+XI8n67d0EgmdpDB87Dj3N+n9/hd34pKf9rhR62bah30jKvsxJqVcHaB4FA6pJr + mWhij7+Bged6BTf1Ws812qg3/kYGLT6nekmIm6W56UEKQnWMWuBmKSQG6WQcDrXvWBSpt5FfuJEaPoH5 + BdQaIMQetgKsWQO3ozp7QaTOWs4nVMNj1wMjFrisWnA81FCrx9e3FOxmdfuCgMVQmKzouqIGN2wBazyP + WR60VxGYGaoERcijc4AGm07rsukh7HvN7ssMkcsnVsNRU4SZd0ZcoxWYeV8FU+lpTA9egkp+uO834Deb + l3lYGuMvKf6Qwk2XDhqFBD9iRtz3ncNkVIvgrUJMvSLhu5qHyUgZzkjF3XNe4HUwBpV0F8b6dJgY0MCu + kyAxxCA+YMB4vwbxiBqfIwTGo2rEwvk4JRE9/qMHTY4qIol0F2P0mRLxFzpM9hswESHxsbcMw10lGA6f + RbTtGGQH04PzNtFp1d4QkA+dCsRCSozySZ96SzHWcxFDj/Lw/PY+dDgzuOP7t3bMCwQCNakXcsWUgHS1 + HsXTOxKup/UI1918CE/8u9HpFaGyQPRNdWKv/a/f2GQil/NNJAXEb8ri2thMLujKwF3bttkS+ebvB3au + B3Eya9WCc0Dmi9eUK3OKZdnbW9I3rkykrVuBzLTVfVLxlrqinMxNi47yv1z4CauDcDT2mV8JAAAAAElF + TkSuQmCC </value> </data> </root>
16 years, 2 months
1
0
0
0
[janderwald] 35482: - Implement SHParseDisplayName by Paul paulvgenderen at gmail.com
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Aug 20 12:29:18 2008 New Revision: 35482 URL:
http://svn.reactos.org/svn/reactos?rev=35482&view=rev
Log: - Implement SHParseDisplayName by Paul paulvgenderen at
gmail.com
Modified: trunk/reactos/dll/win32/shell32/shellord.c Modified: trunk/reactos/dll/win32/shell32/shellord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellord…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellord.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shellord.c [iso-8859-1] Wed Aug 20 12:29:18 2008 @@ -2128,3 +2128,29 @@ return TRUE; } +/************************************************************************* + * SHParseDisplayName [shell version 6.0] + */ +HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, +LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut) +{ + IShellFolder * psfDesktop; + HRESULT hr=E_FAIL; + ULONG dwAttr=sfgaoIn; + + if (!pszName || !ppidl || !psfgaoOut) + return E_INVALIDARG; + + hr = SHGetDesktopFolder(&psfDesktop); + if (FAILED(hr)) + return hr; + + hr = IShellFolder_ParseDisplayName(psfDesktop, (HWND)NULL, pbc, (LPOLESTR)pszName, (ULONG *)NULL, ppidl, &dwAttr); + + IShellFolder_Release(psfDesktop); + + if (SUCCEEDED(hr)) + *psfgaoOut = dwAttr; + + return hr; +}
16 years, 2 months
1
0
0
0
[cgutman] 35481: - Fix handling of cancelled IRPs
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 20 12:29:01 2008 New Revision: 35481 URL:
http://svn.reactos.org/svn/reactos?rev=35481&view=rev
Log: - Fix handling of cancelled IRPs Modified: branches/aicom-network-fixes/drivers/network/afd/afd/listen.c branches/aicom-network-fixes/drivers/network/afd/afd/read.c branches/aicom-network-fixes/drivers/network/afd/afd/write.c Modified: branches/aicom-network-fixes/drivers/network/afd/afd/listen.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/listen.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/listen.c [iso-8859-1] Wed Aug 20 12:29:01 2008 @@ -87,14 +87,14 @@ PAFD_FCB FCB = (PAFD_FCB)Context; PAFD_TDI_OBJECT_QELT Qelt; + if( Irp->Cancel ) { + if( FCB ) FCB->ListenIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->ListenIrp.InFlightRequest = NULL; - - if( Irp->Cancel ) { - SocketStateUnlock( FCB ); - return STATUS_SUCCESS; - } if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); Modified: branches/aicom-network-fixes/drivers/network/afd/afd/read.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/read.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/read.c [iso-8859-1] Wed Aug 20 12:29:01 2008 @@ -233,6 +233,11 @@ ASSERT_IRQL(APC_LEVEL); + if( Irp->Cancel ) { + if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->ReceiveIrp.InFlightRequest = NULL; @@ -448,11 +453,14 @@ AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); + if( Irp->Cancel ) { + if( FCB ) FCB->ReceiveIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; FCB->ReceiveIrp.InFlightRequest = NULL; - - if( !SocketAcquireStateLock( FCB ) ) return STATUS_UNSUCCESSFUL; if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); Modified: branches/aicom-network-fixes/drivers/network/afd/afd/write.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/write.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/write.c [iso-8859-1] Wed Aug 20 12:29:01 2008 @@ -40,6 +40,11 @@ ASSERT_IRQL(APC_LEVEL); + if( Irp->Cancel ) { + if( FCB ) FCB->SendIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + if( !SocketAcquireStateLock( FCB ) ) return Status; FCB->SendIrp.InFlightRequest = NULL; @@ -169,6 +174,11 @@ Irp->IoStatus.Status, Irp->IoStatus.Information)); + if( Irp->Cancel ) { + if( FCB ) FCB->SendIrp.InFlightRequest = NULL; + return STATUS_CANCELLED; + } + /* It's ok if the FCB already died */ if( !SocketAcquireStateLock( FCB ) ) return STATUS_SUCCESS;
16 years, 2 months
1
0
0
0
[cgutman] 35480: - Don't forget about ConnectIrp (This fix was lost in the merge) - Don't destroy the same socket twice - Don't unlock the same socket twice - Don't destroy a socket with pending IRPs
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 20 09:56:12 2008 New Revision: 35480 URL:
http://svn.reactos.org/svn/reactos?rev=35480&view=rev
Log: - Don't forget about ConnectIrp (This fix was lost in the merge) - Don't destroy the same socket twice - Don't unlock the same socket twice - Don't destroy a socket with pending IRPs Modified: branches/aicom-network-fixes/drivers/network/afd/afd/main.c Modified: branches/aicom-network-fixes/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/main.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/main.c [iso-8859-1] Wed Aug 20 09:56:12 2008 @@ -208,18 +208,18 @@ InFlightRequest[0] = FCB->ListenIrp; InFlightRequest[1] = FCB->ReceiveIrp; InFlightRequest[2] = FCB->SendIrp; + InFlightRequest[3] = FCB->ConnectIrp; /* Return early here because we might be called in the mean time. */ if( !(FCB->Critical || FCB->ListenIrp.InFlightRequest || FCB->ReceiveIrp.InFlightRequest || - FCB->SendIrp.InFlightRequest) ) { + FCB->SendIrp.InFlightRequest || + FCB->ConnectIrp.InFlightRequest) ) { AFD_DbgPrint(MIN_TRACE,("Leaving socket alive (%x %x %x)\n", FCB->ListenIrp.InFlightRequest, FCB->ReceiveIrp.InFlightRequest, FCB->SendIrp.InFlightRequest)); - SocketStateUnlock(FCB); - DestroySocket(FCB); Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -242,12 +242,13 @@ } FCB->PendingClose = Irp; + DestroySocket( FCB ); + Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); } - DestroySocket( FCB ); AFD_DbgPrint(MID_TRACE, ("Returning success.\n")); return Irp->IoStatus.Status;
16 years, 2 months
1
0
0
0
[cgutman] 35479: - Fix build
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 20 09:48:42 2008 New Revision: 35479 URL:
http://svn.reactos.org/svn/reactos?rev=35479&view=rev
Log: - Fix build Modified: branches/aicom-network-fixes/drivers/network/afd/afd/main.c Modified: branches/aicom-network-fixes/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/main.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/main.c [iso-8859-1] Wed Aug 20 09:48:42 2008 @@ -187,7 +187,7 @@ PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; - if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp, FALSE); + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); AFD_DbgPrint(MID_TRACE, ("AfdClose(DeviceObject %p Irp %p)\n", DeviceObject, Irp));
16 years, 2 months
1
0
0
0
[cgutman] 35478: - The rest of the merge - This will most likely need fixing later
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 20 09:43:33 2008 New Revision: 35478 URL:
http://svn.reactos.org/svn/reactos?rev=35478&view=rev
Log: - The rest of the merge - This will most likely need fixing later Modified: branches/aicom-network-fixes/drivers/network/afd/afd/main.c branches/aicom-network-fixes/drivers/network/afd/afd/read.c branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c Modified: branches/aicom-network-fixes/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/main.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/main.c [iso-8859-1] Wed Aug 20 09:43:33 2008 @@ -153,52 +153,7 @@ } VOID DestroySocket( PAFD_FCB FCB ) { - UINT i; - BOOLEAN ReturnEarly = FALSE; - PAFD_IN_FLIGHT_REQUEST InFlightRequest[IN_FLIGHT_REQUESTS]; - AFD_DbgPrint(MIN_TRACE,("Called (%x)\n", FCB)); - - if( !SocketAcquireStateLock( FCB ) ) return; - - FCB->State = SOCKET_STATE_CLOSED; - - InFlightRequest[0] = &FCB->ListenIrp; - InFlightRequest[1] = &FCB->ReceiveIrp; - InFlightRequest[2] = &FCB->SendIrp; - InFlightRequest[3] = &FCB->ConnectIrp; - - /* Return early here because we might be called in the mean time. */ - if( FCB->Critical || - FCB->ListenIrp.InFlightRequest || - FCB->ReceiveIrp.InFlightRequest || - FCB->SendIrp.InFlightRequest || - FCB->ConnectIrp.InFlightRequest ) { - AFD_DbgPrint(MIN_TRACE,("Leaving socket alive (%x %x %x %x)\n", - FCB->ListenIrp.InFlightRequest, - FCB->ReceiveIrp.InFlightRequest, - FCB->SendIrp.InFlightRequest, - FCB->ConnectIrp.InFlightRequest)); - ReturnEarly = TRUE; - } - - /* After PoolReeval, this FCB should not be involved in any outstanding - * poll requests */ - - /* Cancel our pending requests */ - for( i = 0; i < IN_FLIGHT_REQUESTS; i++ ) { - if( InFlightRequest[i]->InFlightRequest ) { - AFD_DbgPrint(MID_TRACE,("Cancelling in flight irp %d (%x)\n", - i, InFlightRequest[i]->InFlightRequest)); - InFlightRequest[i]->InFlightRequest->IoStatus.Status = STATUS_CANCELLED; - InFlightRequest[i]->InFlightRequest->IoStatus.Information = 0; - IoCancelIrp( InFlightRequest[i]->InFlightRequest ); - } - } - - SocketStateUnlock( FCB ); - - if( ReturnEarly ) return; if( FCB->Recv.Window ) ExFreePool( FCB->Recv.Window ); @@ -227,8 +182,12 @@ AfdCloseSocket(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp) { + UINT i; + AFD_IN_FLIGHT_REQUEST InFlightRequest[IN_FLIGHT_REQUESTS]; PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; + + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp, FALSE); AFD_DbgPrint(MID_TRACE, ("AfdClose(DeviceObject %p Irp %p)\n", DeviceObject, Irp)); @@ -242,15 +201,56 @@ if( FCB->EventSelect ) ObDereferenceObject( FCB->EventSelect ); FileObject->FsContext = NULL; + + FCB->State = SOCKET_STATE_CLOSED; + SocketStateUnlock(FCB); + + InFlightRequest[0] = FCB->ListenIrp; + InFlightRequest[1] = FCB->ReceiveIrp; + InFlightRequest[2] = FCB->SendIrp; + + /* Return early here because we might be called in the mean time. */ + if( !(FCB->Critical || + FCB->ListenIrp.InFlightRequest || + FCB->ReceiveIrp.InFlightRequest || + FCB->SendIrp.InFlightRequest) ) { + AFD_DbgPrint(MIN_TRACE,("Leaving socket alive (%x %x %x)\n", + FCB->ListenIrp.InFlightRequest, + FCB->ReceiveIrp.InFlightRequest, + FCB->SendIrp.InFlightRequest)); + SocketStateUnlock(FCB); + DestroySocket(FCB); + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + } + else + { + /* After PoolReeval, this FCB should not be involved in any outstanding + * poll requests */ + + /* Cancel our pending requests */ + for( i = 0; i < IN_FLIGHT_REQUESTS; i++ ) { + NTSTATUS Status = STATUS_NO_SUCH_FILE; + if( InFlightRequest[i].InFlightRequest ) { + AFD_DbgPrint(MID_TRACE,("Cancelling in flight irp %d (%x)\n", + i, InFlightRequest[i].InFlightRequest)); + InFlightRequest[i].InFlightRequest->IoStatus.Status = Status; + InFlightRequest[i].InFlightRequest->IoStatus.Information = 0; + IoCancelIrp( InFlightRequest[i].InFlightRequest ); + } + } + + FCB->PendingClose = Irp; + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + } + DestroySocket( FCB ); - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - AFD_DbgPrint(MID_TRACE, ("Returning success.\n")); - return STATUS_SUCCESS; + return Irp->IoStatus.Status; } static NTSTATUS STDCALL Modified: branches/aicom-network-fixes/drivers/network/afd/afd/read.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/read.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/read.c [iso-8859-1] Wed Aug 20 09:43:33 2008 @@ -242,7 +242,6 @@ if( FCB->State == SOCKET_STATE_CLOSED ) { AFD_DbgPrint(MIN_TRACE,("!!! CLOSED SOCK GOT A RECEIVE COMPLETE !!!\n")); SocketStateUnlock( FCB ); - DestroySocket( FCB ); return STATUS_SUCCESS; } else if( FCB->State == SOCKET_STATE_LISTENING ) { AFD_DbgPrint(MIN_TRACE,("!!! LISTENER GOT A RECEIVE COMPLETE !!!\n")); @@ -453,9 +452,10 @@ FCB->ReceiveIrp.InFlightRequest = NULL; + if( !SocketAcquireStateLock( FCB ) ) return STATUS_UNSUCCESSFUL; + if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); - DestroySocket( FCB ); return STATUS_SUCCESS; } Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Wed Aug 20 09:43:33 2008 @@ -52,34 +52,6 @@ return IRPFinish(Irp, STATUS_CANCELLED); } - - -VOID DispCancelComplete( - PVOID Context) -/* - * FUNCTION: Completes a cancel request - * ARGUMENTS: - * Context = Pointer to context information (FILE_OBJECT) - */ -{ - /*KIRQL OldIrql;*/ - PFILE_OBJECT FileObject; - PTRANSPORT_CONTEXT TranContext; - - TI_DbgPrint(DEBUG_IRP, ("Called.\n")); - - FileObject = (PFILE_OBJECT)Context; - TranContext = (PTRANSPORT_CONTEXT)FileObject->FsContext; - - /* Set the cleanup event */ - KeSetEvent(&TranContext->CleanupEvent, 0, FALSE); - - /* We are expected to release the cancel spin lock */ - /*IoReleaseCancelSpinLock(OldIrql);*/ - - TI_DbgPrint(DEBUG_IRP, ("Leaving.\n")); -} - VOID DispDataRequestComplete( PVOID Context, @@ -155,8 +127,14 @@ TI_DbgPrint(DEBUG_IRP, ("PostCancel: DoDisconnect done\n")); DispDataRequestComplete(DisType->Irp, STATUS_CANCELLED, 0); - - DispCancelComplete(DisType->FileObject); +} + +VOID DispDoPacketCancel( PVOID Data ) { + TI_DbgPrint(DEBUG_IRP, ("Called.\n")); + PIRP *IrpP = (PIRP *)Data, Irp = *IrpP; + Irp->IoStatus.Status = STATUS_CANCELLED; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); } VOID NTAPI DispCancelRequest( @@ -175,6 +153,7 @@ UCHAR MinorFunction; DISCONNECT_TYPE DisType; PVOID WorkItem; + PADDRESS_FILE AddrFile; /*NTSTATUS Status = STATUS_SUCCESS;*/ TI_DbgPrint(DEBUG_IRP, ("Called.\n")); @@ -209,24 +188,23 @@ if( !ChewCreate( &WorkItem, sizeof(DISCONNECT_TYPE), DispDoDisconnect, &DisType ) ) ASSERT(0); - break; + return; case TDI_SEND_DATAGRAM: if (FileObject->FsContext2 != (PVOID)TDI_TRANSPORT_ADDRESS_FILE) { TI_DbgPrint(MIN_TRACE, ("TDI_SEND_DATAGRAM, but no address file.\n")); break; } - - /*DGCancelSendRequest(TranContext->Handle.AddressHandle, Irp);*/ + /* Nothing to do. We don't keep them around. */ break; case TDI_RECEIVE_DATAGRAM: + AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle; if (FileObject->FsContext2 != (PVOID)TDI_TRANSPORT_ADDRESS_FILE) { TI_DbgPrint(MIN_TRACE, ("TDI_RECEIVE_DATAGRAM, but no address file.\n")); break; } - - /*DGCancelReceiveRequest(TranContext->Handle.AddressHandle, Irp);*/ + DGRemoveIRP(AddrFile, Irp); break; default: @@ -235,7 +213,8 @@ } IoReleaseCancelSpinLock(Irp->CancelIrql); - + IoCompleteRequest(Irp, IO_NO_INCREMENT); + TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } @@ -279,9 +258,6 @@ IoReleaseCancelSpinLock(Irp->CancelIrql); DispDataRequestComplete(Irp, STATUS_CANCELLED, 0); - - DispCancelComplete(FileObject); - TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); } @@ -817,7 +793,6 @@ return Status; } - NTSTATUS DispTdiReceiveDatagram( PIRP Irp) /* @@ -834,6 +809,7 @@ TDI_REQUEST Request; NTSTATUS Status; ULONG BytesReceived; + PADDRESS_FILE AddrFile; TI_DbgPrint(DEBUG_IRP, ("Called.\n")); @@ -847,6 +823,8 @@ return STATUS_INVALID_ADDRESS; } + AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle; + /* Initialize a receive request */ Request.Handle.AddressHandle = TranContext->Handle.AddressHandle; Request.RequestNotifyObject = DispDataRequestComplete; @@ -866,21 +844,21 @@ &DataBuffer, &BufferSize ); - Status = DGReceiveDatagram( - Request.Handle.AddressHandle, - DgramInfo->ReceiveDatagramInformation, - DataBuffer, - DgramInfo->ReceiveLength, - DgramInfo->ReceiveFlags, - DgramInfo->ReturnDatagramInformation, - &BytesReceived, - (PDATAGRAM_COMPLETION_ROUTINE)DispDataRequestComplete, - Irp, - Irp); - if (Status != STATUS_PENDING) { - DispDataRequestComplete(Irp, Status, BytesReceived); - } else - IoMarkIrpPending(Irp); + Status = DGReceiveDatagram( + AddrFile, + DgramInfo->ReceiveDatagramInformation, + DataBuffer, + DgramInfo->ReceiveLength, + DgramInfo->ReceiveFlags, + DgramInfo->ReturnDatagramInformation, + &BytesReceived, + (PDATAGRAM_COMPLETION_ROUTINE)DispDataRequestComplete, + Irp, + Irp); + if (Status != STATUS_PENDING) { + DispDataRequestComplete(Irp, Status, BytesReceived); + } else + IoMarkIrpPending(Irp); } TI_DbgPrint(DEBUG_IRP, ("Leaving. Status is (0x%X)\n", Status)); Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Wed Aug 20 09:43:33 2008 @@ -138,7 +138,6 @@ } CP Context->CancelIrps = FALSE; - KeInitializeEvent(&Context->CleanupEvent, NotificationEvent, FALSE); CP IrpSp = IoGetCurrentIrpStackLocation(Irp); IrpSp->FileObject->FsContext = Context; @@ -266,20 +265,11 @@ { PIRP Irp; PIO_STACK_LOCATION IrpSp; - PTRANSPORT_CONTEXT TranContext; - KIRQL OldIrql; Irp = (PIRP)Context; IrpSp = IoGetCurrentIrpStackLocation(Irp); - TranContext = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext; Irp->IoStatus.Status = Status; - - IoAcquireCancelSpinLock(&OldIrql); - - KeSetEvent(&TranContext->CleanupEvent, 0, FALSE); - - IoReleaseCancelSpinLock(OldIrql); } @@ -313,7 +303,6 @@ IoAcquireCancelSpinLock(&OldIrql); Context->CancelIrps = TRUE; - KeResetEvent(&Context->CleanupEvent); IoReleaseCancelSpinLock(OldIrql); @@ -348,16 +337,6 @@ Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; return Irp->IoStatus.Status; - } - - if (Status != STATUS_PENDING) - { - IoAcquireCancelSpinLock(&OldIrql); - KeSetEvent(&Context->CleanupEvent, 0, FALSE); - IoReleaseCancelSpinLock(OldIrql); - - KeWaitForSingleObject(&Context->CleanupEvent, - UserRequest, KernelMode, FALSE, NULL); } Irp->IoStatus.Status = Status;
16 years, 2 months
1
0
0
0
[cgutman] 35477: - Reapply arty's datagram cancellation work - Part 1 of 3
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 20 09:21:08 2008 New Revision: 35477 URL:
http://svn.reactos.org/svn/reactos?rev=35477&view=rev
Log: - Reapply arty's datagram cancellation work - Part 1 of 3 Modified: branches/aicom-network-fixes/drivers/network/afd/afd/lock.c branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c branches/aicom-network-fixes/drivers/network/afd/afd/write.c branches/aicom-network-fixes/drivers/network/afd/include/afd.h Modified: branches/aicom-network-fixes/drivers/network/afd/afd/lock.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/lock.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/lock.c [iso-8859-1] Wed Aug 20 09:21:08 2008 @@ -68,7 +68,7 @@ BOOLEAN Write, BOOLEAN LockAddress ) { UINT i; /* Copy the buffer array so we don't lose it */ - UINT Lock = (LockAddress && AddressLen) ? 2 : 0; + UINT Lock = LockAddress ? 2 : 0; UINT Size = sizeof(AFD_WSABUF) * (Count + Lock); PAFD_WSABUF NewBuf = ExAllocatePool( PagedPool, Size * 2 ); PMDL NewMdl; @@ -80,13 +80,16 @@ _SEH_TRY { RtlCopyMemory( NewBuf, Buf, sizeof(AFD_WSABUF) * Count ); - if( LockAddress ) { + if( LockAddress && AddressLen ) { NewBuf[Count].buf = AddressBuf; NewBuf[Count].len = *AddressLen; Count++; NewBuf[Count].buf = (PVOID)AddressLen; NewBuf[Count].len = sizeof(*AddressLen); Count++; + } else if( LockAddress ) { + RtlZeroMemory(NewBuf, sizeof(*NewBuf) * 2); + Count += 2; } } _SEH_HANDLE { AFD_DbgPrint(MIN_TRACE,("Access violation copying buffer info " Modified: branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/tdiconn.c [iso-8859-1] Wed Aug 20 09:21:08 2008 @@ -172,54 +172,6 @@ return Status; } -NTSTATUS -TdiBuildConnectionInfoPair -( PTDI_CONNECTION_INFO_PAIR ConnectionInfo, - PTRANSPORT_ADDRESS From, PTRANSPORT_ADDRESS To ) - /* - * FUNCTION: Fill a TDI_CONNECTION_INFO_PAIR struct will the two addresses - * given. - * ARGUMENTS: - * ConnectionInfo: The pair - * From: The from address - * To: The to address - * RETURNS: - * Status of the operation - */ -{ - PCHAR LayoutFrame; - UINT SizeOfEntry; - ULONG TdiAddressSize; - PTDI_CONNECTION_INFORMATION FromTdiConn, ToTdiConn; - - /* FIXME: Get from socket information */ - TdiAddressSize = TdiAddressSizeFromType(From->Address[0].AddressType); - SizeOfEntry = TdiAddressSize + sizeof(TDI_CONNECTION_INFORMATION); - - LayoutFrame = (PCHAR)ExAllocatePool(NonPagedPool, 2 * SizeOfEntry); - - if (!LayoutFrame) { - AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); - return STATUS_INSUFFICIENT_RESOURCES; - } - - RtlZeroMemory( LayoutFrame, 2 * SizeOfEntry ); - - FromTdiConn = (PTDI_CONNECTION_INFORMATION)LayoutFrame; - ToTdiConn = (PTDI_CONNECTION_INFORMATION)LayoutFrame + SizeOfEntry; - - if (From != NULL) { - TdiBuildConnectionInfoInPlace( FromTdiConn, From ); - } else { - TdiBuildNullConnectionInfoInPlace( FromTdiConn, - From->Address[0].AddressType ); - } - - TdiBuildConnectionInfoInPlace( ToTdiConn, To ); - - return STATUS_SUCCESS; -} - PTA_ADDRESS TdiGetRemoteAddress( PTDI_CONNECTION_INFORMATION TdiConn ) /* * Convenience function that rounds out the abstraction of Modified: branches/aicom-network-fixes/drivers/network/afd/afd/write.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/afd/write.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/afd/write.c [iso-8859-1] Wed Aug 20 09:21:08 2008 @@ -47,7 +47,6 @@ if( FCB->State == SOCKET_STATE_CLOSED ) { SocketStateUnlock( FCB ); - DestroySocket( FCB ); return STATUS_SUCCESS; } @@ -179,12 +178,6 @@ FCB->SendIrp.InFlightRequest = NULL; /* Request is not in flight any longer */ - if( FCB->State == SOCKET_STATE_CLOSED ) { - SocketStateUnlock( FCB ); - DestroySocket( FCB ); - return STATUS_SUCCESS; - } - SocketStateUnlock( FCB ); return STATUS_SUCCESS; Modified: branches/aicom-network-fixes/drivers/network/afd/include/afd.h URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/afd/include/afd.h [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/afd/include/afd.h [iso-8859-1] Wed Aug 20 09:21:08 2008 @@ -196,6 +196,7 @@ PVOID Context; DWORD PollState; UINT ContextSize; + PIRP PendingClose; LIST_ENTRY PendingIrpList[MAX_FUNCTIONS]; LIST_ENTRY DatagramList; LIST_ENTRY PendingConnections;
16 years, 2 months
1
0
0
0
[janderwald] 35476: - Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowProperti
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Aug 20 08:47:47 2008 New Revision: 35476 URL:
http://svn.reactos.org/svn/reactos?rev=35476&view=rev
Log: - Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release Added: trunk/reactos/dll/win32/shell32/shv_def_cmenu.c (with props) Removed: trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c trunk/reactos/dll/win32/shell32/shv_item_cmenu.c Modified: trunk/reactos/dll/win32/shell32/autocomplete.c trunk/reactos/dll/win32/shell32/cpanelfolder.c trunk/reactos/dll/win32/shell32/dialogs.c trunk/reactos/dll/win32/shell32/drive.c trunk/reactos/dll/win32/shell32/folder_options.c trunk/reactos/dll/win32/shell32/fprop.c trunk/reactos/dll/win32/shell32/pidl.c trunk/reactos/dll/win32/shell32/she_ocmenu.c trunk/reactos/dll/win32/shell32/shell32.rbuild trunk/reactos/dll/win32/shell32/shell32_main.h trunk/reactos/dll/win32/shell32/shfldr_admintools.c trunk/reactos/dll/win32/shell32/shfldr_desktop.c trunk/reactos/dll/win32/shell32/shfldr_fonts.c trunk/reactos/dll/win32/shell32/shfldr_mycomp.c trunk/reactos/dll/win32/shell32/shfldr_mydocuments.c trunk/reactos/dll/win32/shell32/shfldr_netplaces.c trunk/reactos/dll/win32/shell32/shfldr_printers.c trunk/reactos/dll/win32/shell32/shfldr_recyclebin.c trunk/reactos/dll/win32/shell32/shlexec.c trunk/reactos/dll/win32/shell32/shlfileop.c trunk/reactos/dll/win32/shell32/shlfolder.c trunk/reactos/dll/win32/shell32/shlmenu.c trunk/reactos/dll/win32/shell32/shlview.c trunk/reactos/dll/win32/shell32/shv_item_new.c trunk/reactos/dll/win32/shell32/undocshell.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/shell32/autocomplete.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/autocomp…
Modified: trunk/reactos/dll/win32/shell32/cpanelfolder.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/cpanelfo…
Modified: trunk/reactos/dll/win32/shell32/dialogs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs.…
Modified: trunk/reactos/dll/win32/shell32/drive.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drive.c?…
Modified: trunk/reactos/dll/win32/shell32/folder_options.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folder_o…
Modified: trunk/reactos/dll/win32/shell32/fprop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/fprop.c?…
Modified: trunk/reactos/dll/win32/shell32/pidl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.c?r…
Modified: trunk/reactos/dll/win32/shell32/she_ocmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/she_ocme…
Modified: trunk/reactos/dll/win32/shell32/shell32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.…
Modified: trunk/reactos/dll/win32/shell32/shell32_main.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
Modified: trunk/reactos/dll/win32/shell32/shfldr_admintools.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_a…
Modified: trunk/reactos/dll/win32/shell32/shfldr_desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_d…
Modified: trunk/reactos/dll/win32/shell32/shfldr_fonts.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_f…
Modified: trunk/reactos/dll/win32/shell32/shfldr_mycomp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_m…
Modified: trunk/reactos/dll/win32/shell32/shfldr_mydocuments.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_m…
Modified: trunk/reactos/dll/win32/shell32/shfldr_netplaces.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_n…
Modified: trunk/reactos/dll/win32/shell32/shfldr_printers.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_p…
Modified: trunk/reactos/dll/win32/shell32/shfldr_recyclebin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_r…
Modified: trunk/reactos/dll/win32/shell32/shlexec.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlexec.…
Modified: trunk/reactos/dll/win32/shell32/shlfileop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfileo…
Modified: trunk/reactos/dll/win32/shell32/shlfolder.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfolde…
Modified: trunk/reactos/dll/win32/shell32/shlmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlmenu.…
Modified: trunk/reactos/dll/win32/shell32/shlview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
Removed: trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_bg_c…
Added: trunk/reactos/dll/win32/shell32/shv_def_cmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_def_…
Removed: trunk/reactos/dll/win32/shell32/shv_item_cmenu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_item…
Modified: trunk/reactos/dll/win32/shell32/shv_item_new.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_item…
Modified: trunk/reactos/dll/win32/shell32/undocshell.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/undocshe…
16 years, 2 months
1
0
0
0
[cwittich] 35475: add some more settings to the options dialog
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Aug 20 08:45:59 2008 New Revision: 35475 URL:
http://svn.reactos.org/svn/reactos?rev=35475&view=rev
Log: add some more settings to the options dialog Modified: trunk/tools/reactosdbg/RosDBG/SerialTargetSelect.Designer.cs trunk/tools/reactosdbg/RosDBG/SerialTargetSelect.cs trunk/tools/reactosdbg/RosDBG/Settings.cs Modified: trunk/tools/reactosdbg/RosDBG/SerialTargetSelect.Designer.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/SerialTarg…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/SerialTargetSelect.Designer.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/SerialTargetSelect.Designer.cs [iso-8859-1] Wed Aug 20 08:45:59 2008 @@ -38,6 +38,7 @@ // // cPort // + this.cPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cPort.FormattingEnabled = true; this.cPort.Location = new System.Drawing.Point(77, 9); this.cPort.Name = "cPort"; @@ -46,6 +47,7 @@ // // cBaud // + this.cBaud.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cBaud.FormattingEnabled = true; this.cBaud.Items.AddRange(new object[] { "9600", Modified: trunk/tools/reactosdbg/RosDBG/SerialTargetSelect.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/SerialTarg…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/SerialTargetSelect.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/SerialTargetSelect.cs [iso-8859-1] Wed Aug 20 08:45:59 2008 @@ -31,8 +31,21 @@ { cPort.Items.Add(s); } - cPort.SelectedIndex = 0; - cBaud.SelectedIndex = 0; + SelectComboItem(cPort, Settings.ComPort); + SelectComboItem(cBaud, Settings.Baudrate); + } + + private void SelectComboItem(ComboBox obj, string text) + { + obj.SelectedIndex = 0; + foreach (object item in obj.Items) + { + if (item.ToString() == text) + { + obj.SelectedItem = item; + break; + } + } } private void bOK_Click(object sender, EventArgs e) Modified: trunk/tools/reactosdbg/RosDBG/Settings.cs URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Settings.c…
============================================================================== --- trunk/tools/reactosdbg/RosDBG/Settings.cs [iso-8859-1] (original) +++ trunk/tools/reactosdbg/RosDBG/Settings.cs [iso-8859-1] Wed Aug 20 08:45:59 2008 @@ -8,6 +8,7 @@ using System.Configuration; using System.Windows.Forms; using System.Drawing.Design; +using System.IO.Ports; namespace RosDBG { @@ -15,6 +16,29 @@ { public class SettingsPropertyValues : ApplicationSettingsBase { + private SerialConnSettings _serialconnsettings; + + /* Hack to work around a crash (bug in .net?) + * using a TypeConverter in a class which is derived from + * ApplicationSettingsBase results in a crash + */ + [UserScopedSetting, DefaultSettingValue("COM1")] + [Browsable(false)] + public string Port + { + get { return this["Port"].ToString(); } + set { this["Port"] = value; } + } + + [UserScopedSetting, DefaultSettingValue("115200")] + [Browsable(false)] + public string Baudrate + { + get { return this["Baudrate"].ToString(); } + set { this["Baudrate"] = value; } + } + /* end of hack */ + [CategoryAttribute("Directories"), DescriptionAttribute("Directory settings")] [UserScopedSetting, DefaultSettingValue("."), Editor(typeof(DirectoryEditor), typeof(UITypeEditor))] public string SourceDirectory @@ -38,6 +62,13 @@ get { return this["Pipe"].ToString(); } set { this["Pipe"] = value; } } + + [CategoryAttribute("Connection"), DescriptionAttribute("Connection settings")] + public SerialConnSettings Serial + { + get { return new SerialConnSettings(Port, Baudrate, this); } + set { _serialconnsettings = value; } + } public SettingsPropertyValues() { @@ -45,11 +76,66 @@ } } + #region TypeConverter + public class ComPortConverter : StringConverter + { + public override bool GetStandardValuesSupported(ITypeDescriptorContext context) + { + return true; + } + + public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) + { + return true; + } + + public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) + { + return new StandardValuesCollection((string[]) SerialPort.GetPortNames()); + } + } + #endregion + + [TypeConverterAttribute(typeof(ExpandableObjectConverter))] + public class SerialConnSettings + { + private string _Port; + private string _Baudrate; + private SettingsPropertyValues _Parent; + + public SerialConnSettings(string Port, string Baud, SettingsPropertyValues parent) + { + _Port = Port; + _Baudrate = Baud; + _Parent = parent; + } + + public override string ToString() + { + return this.Port + ";" + this.Baudrate; + } + + [TypeConverter(typeof(ComPortConverter))] + public string Port + { + get { return _Port; } + set { _Port = value; _Parent.Port = _Port; } + } + + public string Baudrate + { + get { return _Baudrate; } + set { _Baudrate = value; _Parent.Baudrate = _Baudrate; } + } + } + static SettingsPropertyValues mProperties = new SettingsPropertyValues(); public static string SourceDirectory { get { return mProperties.SourceDirectory; } } public static string OutputDirectory { get { return mProperties.OutputDirectory; } } - public static string Pipe { get { return mProperties.Pipe; } } + public static string Pipe { get { return mProperties.Pipe; } } + public static string ComPort { get { return mProperties.Port; } } + public static string Baudrate { get { return mProperties.Baudrate; } } Settings() {
16 years, 2 months
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
40
...
86
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Results per page:
10
25
50
100
200