if (!Irp->Cancel) {
IoMarkIrpPending(Irp);
IoSetCancelRoutine(Irp, CancelRoutine);
- Context->RefCount++;
IoReleaseCancelSpinLock(OldIrql);
TI_DbgPrint(DEBUG_IRP, ("Leaving (IRP at 0x%X can now be cancelled).\n", Irp));
IoAcquireCancelSpinLock(&OldIrql);
- /* Remove the reference taken by the cancel routine */
- TranContext->RefCount--;
-
- if (TranContext->RefCount == 0) {
- TI_DbgPrint(DEBUG_IRP, ("Setting TranContext->CleanupEvent to signaled.\n"));
- /* Set the cleanup event */
- KeSetEvent(&TranContext->CleanupEvent, 0, FALSE);
- }
-
- TI_DbgPrint(DEBUG_REFCOUNT, ("TranContext->RefCount (%d).\n", TranContext->RefCount));
+ TI_DbgPrint(DEBUG_IRP, ("Setting TranContext->CleanupEvent to signaled.\n"));
+ /* Set the cleanup event */
+ KeSetEvent(&TranContext->CleanupEvent, 0, FALSE);
IoReleaseCancelSpinLock(OldIrql);
TI_DbgPrint(MIN_TRACE, ("Irp->Cancel is FALSE, should be TRUE.\n"));
#endif
- /* Increase reference count to prevent accidential closure
- of the object while inside the cancel routine */
- TranContext->RefCount++;
-
IoReleaseCancelSpinLock(Irp->CancelIrql);
/* Try canceling the request */
break;
}
- DGCancelSendRequest(TranContext->Handle.AddressHandle, Irp);
+ /*DGCancelSendRequest(TranContext->Handle.AddressHandle, Irp);*/
break;
case TDI_RECEIVE_DATAGRAM:
break;
}
- DGCancelReceiveRequest(TranContext->Handle.AddressHandle, Irp);
+ /*DGCancelReceiveRequest(TranContext->Handle.AddressHandle, Irp);*/
break;
default:
TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
}
-
VOID DispDataRequestComplete(
PVOID Context,
NTSTATUS Status,
IoAcquireCancelSpinLock(&OldIrql);
IoSetCancelRoutine(Irp, NULL);
- TranContext->RefCount--;
- TI_DbgPrint(DEBUG_REFCOUNT, ("TranContext->RefCount (%d).\n", TranContext->RefCount));
- if (TranContext->RefCount == 0) {
- TI_DbgPrint(DEBUG_IRP, ("Setting TranContext->CleanupEvent to signaled.\n"));
- KeSetEvent(&TranContext->CleanupEvent, 0, FALSE);
- }
+ KeSetEvent(&TranContext->CleanupEvent, 0, FALSE);
if (Irp->Cancel || TranContext->CancelIrps) {
/* The IRP has been cancelled */
TI_DbgPrint(MID_TRACE, ("No address file object.\n"));
return STATUS_INVALID_PARAMETER;
}
- /* The connection endpoint references the address file object */
- ReferenceObject(AddrFile);
+
Connection->AddressFile = AddrFile;
/* Add connection endpoint to the address file */
/* FIXME: Maybe do this in DispTdiDisassociateAddress() instead? */
ObDereferenceObject(FileObject);
- return Status;
+ return Status;
}
Parameters = (PTDI_REQUEST_KERNEL)&IrpSp->Parameters;
-#if 0
- Status = TCPBind( Connection,
- &Connection->SocketContext,
- Parameters->RequestConnectionInformation );
-
- TI_DbgPrint(MID_TRACE, ("TCP Bind returned %08x\n", Status));
-
- if( NT_SUCCESS(Status) )
-#endif
-
- Status = TCPConnect(
- TranContext->Handle.ConnectionContext,
- Parameters->RequestConnectionInformation,
- Parameters->ReturnConnectionInformation,
- DispDataRequestComplete,
- Irp );
+ Status = TCPConnect(
+ TranContext->Handle.ConnectionContext,
+ Parameters->RequestConnectionInformation,
+ Parameters->ReturnConnectionInformation,
+ DispDataRequestComplete,
+ Irp );
TI_DbgPrint(MAX_TRACE, ("TCP Connect returned %08x\n", Status));
PCONNECTION_ENDPOINT Connection;
PTRANSPORT_CONTEXT TranContext;
PIO_STACK_LOCATION IrpSp;
- KIRQL OldIrql;
TI_DbgPrint(DEBUG_IRP, ("Called.\n"));
return STATUS_INVALID_PARAMETER;
}
- /* Remove the reference put on the address file object */
- KeAcquireSpinLock(&Connection->Lock, &OldIrql);
- DereferenceObject(Connection->AddressFile);
- KeReleaseSpinLock(&Connection->Lock, OldIrql);
-
return STATUS_SUCCESS;
}
return STATUS_BUFFER_OVERFLOW;
}
- /* FIXME: Is this count really the one we should return? */
- AddressInfo->ActivityCount = AddrFile->RefCount;
-
Address = (PTA_IP_ADDRESS)&AddressInfo->Address;
Address->TAAddressCount = 1;
Address->Address[0].AddressLength = TDI_ADDRESS_LENGTH_IP;
return STATUS_BUFFER_OVERFLOW;
}
- /* FIXME: Is this count really the one we should return? */
- AddressInfo->ActivityCount = AddrFile->RefCount;
-
Address = (PTA_IP_ADDRESS)&AddressInfo->Address;
Address->TAAddressCount = 1;
Address->Address[0].AddressLength = TDI_ADDRESS_LENGTH_IP;
Irp);
if (Status != STATUS_PENDING)
{
+ ASSERT(0);
DispDataRequestComplete(Irp, Status, BytesReceived);
}
}
Parameters = (PTDI_REQUEST_KERNEL_SET_EVENT)&IrpSp->Parameters;
Status = STATUS_SUCCESS;
- KeAcquireSpinLock(&AddrFile->Lock, &OldIrql);
+ TcpipAcquireSpinLock(&AddrFile->Lock, &OldIrql);
/* Set the event handler. if an event handler is associated with
a specific event, it's flag (RegisteredXxxHandler) is TRUE.
Status = STATUS_INVALID_PARAMETER;
}
- KeReleaseSpinLock(&AddrFile->Lock, OldIrql);
+ TcpipReleaseSpinLock(&AddrFile->Lock, OldIrql);
return Status;
}