X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fdrivers%2Fnetwork%2Ftcpip%2Ftcpip%2Fdispatch.c;fp=reactos%2Fdrivers%2Fnetwork%2Ftcpip%2Ftcpip%2Fdispatch.c;h=65e0f96f52c37add786711aad26709cc7fb7800c;hp=75c1cfba41dde55f24de7f0b09cbccec2a23dd54;hb=0a3dc4735f9acc13288684dd590472ed70c41e9e;hpb=6e4f110888e6cb7fb615f222e27a476c23952a20 diff --git a/reactos/drivers/network/tcpip/tcpip/dispatch.c b/reactos/drivers/network/tcpip/tcpip/dispatch.c index 75c1cfba41d..65e0f96f52c 100644 --- a/reactos/drivers/network/tcpip/tcpip/dispatch.c +++ b/reactos/drivers/network/tcpip/tcpip/dispatch.c @@ -444,11 +444,9 @@ NTSTATUS DispTdiDisassociateAddress( * Status of operation */ { - PCONNECTION_ENDPOINT Connection, LastConnection; + PCONNECTION_ENDPOINT Connection; PTRANSPORT_CONTEXT TranContext; PIO_STACK_LOCATION IrpSp; - KIRQL OldIrql; - NTSTATUS Status; TI_DbgPrint(DEBUG_IRP, ("Called.\n")); @@ -468,52 +466,9 @@ NTSTATUS DispTdiDisassociateAddress( return STATUS_INVALID_PARAMETER; } - LockObject(Connection, &OldIrql); - - if (!Connection->AddressFile) { - UnlockObject(Connection, OldIrql); - TI_DbgPrint(MID_TRACE, ("No address file is asscociated.\n")); - return STATUS_INVALID_PARAMETER; - } - - LockObjectAtDpcLevel(Connection->AddressFile); + /* NO-OP because we need the address to deallocate the port when the connection closes */ - /* Unlink this connection from the address file */ - if (Connection->AddressFile->Connection == Connection) - { - Connection->AddressFile->Connection = Connection->Next; - DereferenceObject(Connection); - Status = STATUS_SUCCESS; - } - else - { - LastConnection = Connection->AddressFile->Connection; - while (LastConnection->Next != Connection && LastConnection->Next != NULL) - LastConnection = LastConnection->Next; - if (LastConnection->Next == Connection) - { - LastConnection->Next = Connection->Next; - DereferenceObject(Connection); - Status = STATUS_SUCCESS; - } - else - { - Status = STATUS_INVALID_PARAMETER; - } - } - - UnlockObjectFromDpcLevel(Connection->AddressFile); - - if (Status == STATUS_SUCCESS) - { - /* Remove the address file from this connection */ - DereferenceObject(Connection->AddressFile); - Connection->AddressFile = NULL; - } - - UnlockObject(Connection, OldIrql); - - return Status; + return STATUS_SUCCESS; } @@ -653,6 +608,7 @@ NTSTATUS DispTdiListen( Status = STATUS_NO_MEMORY; if( NT_SUCCESS(Status) ) { + ReferenceObject(Connection->AddressFile); Connection->AddressFile->Listener->AddressFile = Connection->AddressFile;