PTDI_REQUEST_KERNEL_QUERY_INFORMATION Parameters;
PTRANSPORT_CONTEXT TranContext;
PIO_STACK_LOCATION IrpSp;
+ NTSTATUS Status;
TI_DbgPrint(DEBUG_IRP, ("Called.\n"));
IrpSp = IoGetCurrentIrpStackLocation(Irp);
Parameters = (PTDI_REQUEST_KERNEL_QUERY_INFORMATION)&IrpSp->Parameters;
+ TcpipRecursiveMutexEnter( &TCPLock, TRUE );
+
TranContext = IrpSp->FileObject->FsContext;
if (!TranContext) {
TI_DbgPrint(MID_TRACE, ("Bad transport context.\n"));
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_INVALID_PARAMETER;
}
(FIELD_OFFSET(TDI_ADDRESS_INFO, Address.Address[0].Address) +
sizeof(TDI_ADDRESS_IP))) {
TI_DbgPrint(MID_TRACE, ("MDL buffer too small.\n"));
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_BUFFER_TOO_SMALL;
}
RtlZeroMemory(
&Address->Address[0].Address[0].sin_zero,
sizeof(Address->Address[0].Address[0].sin_zero));
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_SUCCESS;
case TDI_CONNECTION_FILE:
RtlZeroMemory(
&Address->Address[0].Address[0].sin_zero,
sizeof(Address->Address[0].Address[0].sin_zero));
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_SUCCESS;
default:
TI_DbgPrint(MIN_TRACE, ("Invalid transport context\n"));
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_INVALID_PARAMETER;
}
if (!AddrFile) {
TI_DbgPrint(MID_TRACE, ("No address file object.\n"));
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_INVALID_PARAMETER;
}
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_SUCCESS;
}
(FIELD_OFFSET(TDI_CONNECTION_INFORMATION, RemoteAddress) +
sizeof(PVOID))) {
TI_DbgPrint(MID_TRACE, ("MDL buffer too small (ptr).\n"));
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_BUFFER_TOO_SMALL;
}
default:
TI_DbgPrint(MIN_TRACE, ("Invalid transport context\n"));
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_INVALID_PARAMETER;
}
if (!Endpoint) {
TI_DbgPrint(MID_TRACE, ("No connection object.\n"));
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_INVALID_PARAMETER;
}
- return TCPGetSockAddress( Endpoint, AddressInfo->RemoteAddress, TRUE );
+ Status = TCPGetSockAddress( Endpoint, AddressInfo->RemoteAddress, TRUE );
+
+ TcpipRecursiveMutexLeave(&TCPLock);
+ return Status;
}
}
+ TcpipRecursiveMutexLeave(&TCPLock);
return STATUS_NOT_IMPLEMENTED;
}
"Proto %d\n",
Connection, Family, Type, Proto));
- TcpipRecursiveMutexEnter( &TCPLock, TRUE );
Status = TCPTranslateError( OskitTCPSocket( Connection,
&Connection->SocketContext,
Family,
TI_DbgPrint(DEBUG_TCP,("Connection->SocketContext %x\n",
Connection->SocketContext));
- TcpipRecursiveMutexLeave( &TCPLock );
-
return Status;
}
return STATUS_NETWORK_UNREACHABLE;
}
- TcpipRecursiveMutexEnter( &TCPLock, TRUE );
-
if (Connection->State & SEL_FIN)
{
- TcpipRecursiveMutexLeave( &TCPLock );
return STATUS_REMOTE_DISCONNECT;
}
}
}
- TcpipRecursiveMutexLeave( &TCPLock );
-
return Status;
}
TI_DbgPrint(DEBUG_TCP,("started\n"));
- TcpipRecursiveMutexEnter( &TCPLock, TRUE );
-
switch( Flags & (TDI_DISCONNECT_ABORT | TDI_DISCONNECT_RELEASE) ) {
case 0:
case TDI_DISCONNECT_ABORT:
Status = TCPTranslateError
( OskitTCPShutdown( Connection->SocketContext, Flags ) );
- TcpipRecursiveMutexLeave( &TCPLock );
-
TI_DbgPrint(DEBUG_TCP,("finished %x\n", Status));
return Status;
TI_DbgPrint(DEBUG_TCP,("TCPClose started\n"));
- TcpipRecursiveMutexEnter( &TCPLock, TRUE );
-
/* Make our code remove all pending IRPs */
Connection->State |= SEL_FIN;
DrainSignals();
Status = TCPTranslateError( OskitTCPClose( Connection->SocketContext ) );
- TcpipRecursiveMutexLeave( &TCPLock );
-
TI_DbgPrint(DEBUG_TCP,("TCPClose finished %x\n", Status));
return Status;
ASSERT_KM_POINTER(Connection->SocketContext);
- TcpipRecursiveMutexEnter( &TCPLock, TRUE );
-
/* Closing */
if (Connection->State & SEL_FIN)
{
- TcpipRecursiveMutexLeave( &TCPLock );
*BytesReceived = 0;
return STATUS_REMOTE_DISCONNECT;
}
Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) );
if( !Bucket ) {
TI_DbgPrint(DEBUG_TCP,("Failed to allocate bucket\n"));
- TcpipRecursiveMutexLeave( &TCPLock );
return STATUS_NO_MEMORY;
}
*BytesReceived = Received;
}
- TcpipRecursiveMutexLeave( &TCPLock );
-
TI_DbgPrint(DEBUG_TCP,("Status %x\n", Status));
return Status;
ASSERT_KM_POINTER(Connection->SocketContext);
- TcpipRecursiveMutexEnter( &TCPLock, TRUE );
-
TI_DbgPrint(DEBUG_TCP,("Connection = %x\n", Connection));
TI_DbgPrint(DEBUG_TCP,("Connection->SocketContext = %x\n",
Connection->SocketContext));
/* Closing */
if (Connection->State & SEL_FIN)
{
- TcpipRecursiveMutexLeave( &TCPLock );
*BytesSent = 0;
return STATUS_REMOTE_DISCONNECT;
}
Bucket = exAllocatePool( NonPagedPool, sizeof(*Bucket) );
if( !Bucket ) {
TI_DbgPrint(DEBUG_TCP,("Failed to allocate bucket\n"));
- TcpipRecursiveMutexLeave( &TCPLock );
return STATUS_NO_MEMORY;
}
*BytesSent = Sent;
}
- TcpipRecursiveMutexLeave( &TCPLock );
-
TI_DbgPrint(DEBUG_TCP,("Status %x\n", Status));
return Status;
OSK_UI16 LocalPort, RemotePort;
PTA_IP_ADDRESS AddressIP = (PTA_IP_ADDRESS)Address;
- TcpipRecursiveMutexEnter( &TCPLock, TRUE );
-
OskitTCPGetAddress
( Connection->SocketContext,
&LocalAddress, &LocalPort,
AddressIP->Address[0].Address[0].sin_port = GetRemote ? RemotePort : LocalPort;
AddressIP->Address[0].Address[0].in_addr = GetRemote ? RemoteAddress : LocalAddress;
- TcpipRecursiveMutexLeave( &TCPLock );
-
return STATUS_SUCCESS;
}