mirror of
https://github.com/reactos/reactos.git
synced 2024-09-13 06:11:59 +00:00
[TCPIP]
Backup commit svn path=/branches/GSoC_2011/TcpIpDriver/; revision=52432
This commit is contained in:
parent
474c5138f8
commit
b8daab7cfb
|
@ -14,4 +14,4 @@ add_subdirectory(storage)
|
|||
add_subdirectory(usb)
|
||||
add_subdirectory(video)
|
||||
add_subdirectory(wdm)
|
||||
add_subdirectory(wmi)
|
||||
add_subdirectory(wmi)
|
|
@ -41,9 +41,9 @@ BucketCompletionWorker(PVOID Context)
|
|||
|
||||
Complete(Bucket->Request.RequestContext, Bucket->Status, Bucket->Information);
|
||||
|
||||
ExFreePoolWithTag(Bucket, TDI_BUCKET_TAG);
|
||||
|
||||
DereferenceObject(Bucket->AssociatedEndpoint);
|
||||
|
||||
ExFreePoolWithTag(Bucket, TDI_BUCKET_TAG);
|
||||
}
|
||||
|
||||
static
|
||||
|
|
|
@ -302,6 +302,18 @@ NTSTATUS TCPConnect
|
|||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
connaddr.addr = RemoteAddress.Address.IPv4Address;
|
||||
|
||||
Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG );
|
||||
if( !Bucket )
|
||||
{
|
||||
UnlockObject(Connection, OldIrql);
|
||||
return STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
Bucket->Request.RequestNotifyObject = (PVOID)Complete;
|
||||
Bucket->Request.RequestContext = Context;
|
||||
|
||||
InsertTailList( &Connection->ConnectRequest, &Bucket->Entry );
|
||||
|
||||
Status = TCPTranslateError(LibTCPConnect(Connection->SocketContext,
|
||||
&connaddr,
|
||||
|
@ -311,7 +323,7 @@ NTSTATUS TCPConnect
|
|||
|
||||
if (Status == STATUS_PENDING)
|
||||
{
|
||||
Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG );
|
||||
/*Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG );
|
||||
if( !Bucket )
|
||||
{
|
||||
UnlockObject(Connection, OldIrql);
|
||||
|
@ -321,7 +333,7 @@ NTSTATUS TCPConnect
|
|||
Bucket->Request.RequestNotifyObject = (PVOID)Complete;
|
||||
Bucket->Request.RequestContext = Context;
|
||||
|
||||
InsertTailList( &Connection->ConnectRequest, &Bucket->Entry );
|
||||
InsertTailList( &Connection->ConnectRequest, &Bucket->Entry );*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -390,6 +402,9 @@ NTSTATUS TCPReceiveData
|
|||
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Called for %d bytes (on socket %x)\n",
|
||||
ReceiveLength, Connection->SocketContext));
|
||||
|
||||
DbgPrint("[IP, TCPReceiveData] Called for %d bytes (on Connection->SocketContext = 0x%x)\n",
|
||||
ReceiveLength, Connection->SocketContext);
|
||||
|
||||
LockObject(Connection, &OldIrql);
|
||||
|
||||
/* Freed in TCPSocketState */
|
||||
|
@ -412,6 +427,7 @@ NTSTATUS TCPReceiveData
|
|||
UnlockObject(Connection, OldIrql);
|
||||
|
||||
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Leaving. Status = STATUS_PENDING\n"));
|
||||
DbgPrint("[IP, TCPReceiveData] Leaving. Status = STATUS_PENDING\n");
|
||||
|
||||
return STATUS_PENDING;
|
||||
}
|
||||
|
@ -437,6 +453,7 @@ NTSTATUS TCPSendData
|
|||
TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Connection = %x\n", Connection));
|
||||
TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Connection->SocketContext = %x\n",
|
||||
Connection->SocketContext));
|
||||
DbgPrint("[IP, TCPSendData] Called\n");
|
||||
|
||||
Status = TCPTranslateError(LibTCPSend(Connection->SocketContext,
|
||||
BufferData,
|
||||
|
@ -476,6 +493,8 @@ NTSTATUS TCPSendData
|
|||
|
||||
TI_DbgPrint(DEBUG_TCP, ("[IP, TCPSendData] Leaving. Status = %x\n", Status));
|
||||
|
||||
DbgPrint("[IP, TCPSendData] Leaving. Status = %x\n", Status);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
|
|
@ -494,9 +494,10 @@ LibTCPConnectCallback(void *arg)
|
|||
tcp_recv(msg->Pcb, InternalRecvEventHandler);
|
||||
tcp_sent(msg->Pcb, InternalSendEventHandler);
|
||||
|
||||
msg->Error = tcp_connect(msg->Pcb, msg->IpAddress, ntohs(msg->Port), InternalConnectEventHandler);
|
||||
if (msg->Error == ERR_OK)
|
||||
msg->Error = ERR_INPROGRESS;
|
||||
//if (msg->Error == ERR_OK)
|
||||
// msg->Error = ERR_INPROGRESS;
|
||||
err_t Error = tcp_connect(msg->Pcb, msg->IpAddress, ntohs(msg->Port), InternalConnectEventHandler);
|
||||
msg->Error = Error == ERR_OK ? ERR_INPROGRESS : Error;
|
||||
|
||||
KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE);
|
||||
|
||||
|
@ -527,8 +528,6 @@ LibTCPConnect(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port)
|
|||
if (WaitForEventSafely(&msg->Event))
|
||||
{
|
||||
ret = msg->Error;
|
||||
if (pcb->state != CLOSED && ret == ERR_INPROGRESS)
|
||||
ret = ERR_OK;
|
||||
}
|
||||
else
|
||||
ret = ERR_CLSD;
|
||||
|
|
Loading…
Reference in a new issue