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
December
November
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
November 2014
----- 2024 -----
December 2024
November 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
18 participants
373 discussions
Start a n
N
ew thread
[jgardou] 65365: [LWIP] - In a last surge of violence, fix build.
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 10 18:00:28 2014 New Revision: 65365 URL:
http://svn.reactos.org/svn/reactos?rev=65365&view=rev
Log: [LWIP] - In a last surge of violence, fix build. Removed: branches/tcpip_revolution/lib/drivers/lwip/src/include/rosip.h branches/tcpip_revolution/lib/drivers/lwip/src/rosip.c branches/tcpip_revolution/lib/drivers/lwip/src/rostcp.c Modified: branches/tcpip_revolution/lib/drivers/lwip/CMakeLists.txt branches/tcpip_revolution/lib/drivers/lwip/src/sys_arch.c Modified: branches/tcpip_revolution/lib/drivers/lwip/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/lw…
============================================================================== --- branches/tcpip_revolution/lib/drivers/lwip/CMakeLists.txt [iso-8859-1] (original) +++ branches/tcpip_revolution/lib/drivers/lwip/CMakeLists.txt [iso-8859-1] Mon Nov 10 18:00:28 2014 @@ -10,8 +10,6 @@ src/include/ipv4) list(APPEND SOURCE - src/rosip.c - src/rostcp.c src/rosmem.c src/sys_arch.c src/api/api_lib.c Removed: branches/tcpip_revolution/lib/drivers/lwip/src/include/rosip.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/lw…
============================================================================== --- branches/tcpip_revolution/lib/drivers/lwip/src/include/rosip.h [iso-8859-1] (original) +++ branches/tcpip_revolution/lib/drivers/lwip/src/include/rosip.h (removed) @@ -1,117 +0,0 @@ -#ifndef _ROS_IP_H_ -#define _ROS_IP_H_ - -#include "lwip/tcp.h" -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" -#include "tcpip.h" - -#ifndef LWIP_TAG - #define LWIP_TAG 'PIwl' -#endif - -typedef struct tcp_pcb* PTCP_PCB; - -typedef struct _QUEUE_ENTRY -{ - struct pbuf *p; - ULONG Offset; - LIST_ENTRY ListEntry; -} QUEUE_ENTRY, *PQUEUE_ENTRY; - -struct lwip_callback_msg -{ - /* Synchronization */ - KEVENT Event; - - /* Input */ - union { - struct { - PVOID Arg; - } Socket; - struct { - PCONNECTION_ENDPOINT Connection; - struct ip_addr *IpAddress; - u16_t Port; - } Bind; - struct { - PCONNECTION_ENDPOINT Connection; - u8_t Backlog; - } Listen; - struct { - PCONNECTION_ENDPOINT Connection; - void *Data; - u16_t DataLength; - } Send; - struct { - PCONNECTION_ENDPOINT Connection; - struct ip_addr *IpAddress; - u16_t Port; - } Connect; - struct { - PCONNECTION_ENDPOINT Connection; - int shut_rx; - int shut_tx; - } Shutdown; - struct { - PCONNECTION_ENDPOINT Connection; - int Callback; - } Close; - } Input; - - /* Output */ - union { - struct { - struct tcp_pcb *NewPcb; - } Socket; - struct { - err_t Error; - } Bind; - struct { - struct tcp_pcb *NewPcb; - } Listen; - struct { - err_t Error; - u32_t Information; - } Send; - struct { - err_t Error; - } Connect; - struct { - err_t Error; - } Shutdown; - struct { - err_t Error; - } Close; - } Output; -}; - -NTSTATUS LibTCPGetDataFromConnectionQueue(PCONNECTION_ENDPOINT Connection, PUCHAR RecvBuffer, UINT RecvLen, UINT *Received); - -/* External TCP event handlers */ -extern void TCPConnectEventHandler(void *arg, const err_t err); -extern void TCPAcceptEventHandler(void *arg, PTCP_PCB newpcb); -extern void TCPSendEventHandler(void *arg, const u16_t space); -extern void TCPFinEventHandler(void *arg, const err_t err); -extern void TCPRecvEventHandler(void *arg); - -/* TCP functions */ -PTCP_PCB LibTCPSocket(void *arg); -err_t LibTCPBind(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port); -PTCP_PCB LibTCPListen(PCONNECTION_ENDPOINT Connection, const u8_t backlog); -err_t LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t len, u32_t *sent, const int safe); -err_t LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port); -err_t LibTCPShutdown(PCONNECTION_ENDPOINT Connection, const int shut_rx, const int shut_tx); -err_t LibTCPClose(PCONNECTION_ENDPOINT Connection, const int safe, const int callback); - -err_t LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port); -err_t LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port); -void LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg); -void LibTCPSetNoDelay(PTCP_PCB pcb, BOOLEAN Set); - -/* IP functions */ -void LibIPInsertPacket(void *ifarg, const void *const data, const u32_t size); -void LibIPInitialize(void); -void LibIPShutdown(void); - -#endif Removed: branches/tcpip_revolution/lib/drivers/lwip/src/rosip.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/lw…
============================================================================== --- branches/tcpip_revolution/lib/drivers/lwip/src/rosip.c [iso-8859-1] (original) +++ branches/tcpip_revolution/lib/drivers/lwip/src/rosip.c (removed) @@ -1,46 +0,0 @@ -#include "lwip/sys.h" -#include "lwip/netif.h" -#include "lwip/tcpip.h" - -#include "rosip.h" - -#include <debug.h> - -typedef struct netif* PNETIF; - -void -LibIPInsertPacket(void *ifarg, - const void *const data, - const u32_t size) -{ - struct pbuf *p; - - ASSERT(ifarg); - ASSERT(data); - ASSERT(size > 0); - - p = pbuf_alloc(PBUF_RAW, size, PBUF_RAM); - if (p) - { - ASSERT(p->tot_len == p->len); - ASSERT(p->len == size); - - RtlCopyMemory(p->payload, data, p->len); - - ((PNETIF)ifarg)->input(p, (PNETIF)ifarg); - } -} - -void -LibIPInitialize(void) -{ - /* This completes asynchronously */ - tcpip_init(NULL, NULL); -} - -void -LibIPShutdown(void) -{ - /* This is synchronous */ - sys_shutdown(); -} Removed: branches/tcpip_revolution/lib/drivers/lwip/src/rostcp.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/lw…
============================================================================== --- branches/tcpip_revolution/lib/drivers/lwip/src/rostcp.c [iso-8859-1] (original) +++ branches/tcpip_revolution/lib/drivers/lwip/src/rostcp.c (removed) @@ -1,842 +0,0 @@ -#include "lwip/sys.h" -#include "lwip/netif.h" -#include "lwip/tcpip.h" - -#include "rosip.h" - -#include <debug.h> - -static const char * const tcp_state_str[] = { - "CLOSED", - "LISTEN", - "SYN_SENT", - "SYN_RCVD", - "ESTABLISHED", - "FIN_WAIT_1", - "FIN_WAIT_2", - "CLOSE_WAIT", - "CLOSING", - "LAST_ACK", - "TIME_WAIT" -}; - -/* The way that lwIP does multi-threading is really not ideal for our purposes but - * we best go along with it unless we want another unstable TCP library. lwIP uses - * a thread called the "tcpip thread" which is the only one allowed to call raw API - * functions. Since this is the case, for each of our LibTCP* functions, we queue a request - * for a callback to "tcpip thread" which calls our LibTCP*Callback functions. Yes, this is - * a lot of unnecessary thread swapping and it could definitely be faster, but I don't want - * to going messing around in lwIP because I have no desire to create another mess like oskittcp */ - -extern KEVENT TerminationEvent; -extern NPAGED_LOOKASIDE_LIST MessageLookasideList; -extern NPAGED_LOOKASIDE_LIST QueueEntryLookasideList; - -/* Required for ERR_T to NTSTATUS translation in receive error handling */ -NTSTATUS TCPTranslateError(const err_t err); - -void -LibTCPDumpPcb(PVOID SocketContext) -{ - struct tcp_pcb *pcb = (struct tcp_pcb*)SocketContext; - unsigned int addr = ntohl(pcb->remote_ip.addr); - - DbgPrint("\tState: %s\n", tcp_state_str[pcb->state]); - DbgPrint("\tRemote: (%d.%d.%d.%d, %d)\n", - (addr >> 24) & 0xFF, - (addr >> 16) & 0xFF, - (addr >> 8) & 0xFF, - addr & 0xFF, - pcb->remote_port); -} - -static -void -LibTCPEmptyQueue(PCONNECTION_ENDPOINT Connection) -{ - PLIST_ENTRY Entry; - PQUEUE_ENTRY qp = NULL; - - ReferenceObject(Connection); - - while (!IsListEmpty(&Connection->PacketQueue)) - { - Entry = RemoveHeadList(&Connection->PacketQueue); - qp = CONTAINING_RECORD(Entry, QUEUE_ENTRY, ListEntry); - - /* We're in the tcpip thread here so this is safe */ - pbuf_free(qp->p); - - ExFreeToNPagedLookasideList(&QueueEntryLookasideList, qp); - } - - DereferenceObject(Connection); -} - -void LibTCPEnqueuePacket(PCONNECTION_ENDPOINT Connection, struct pbuf *p) -{ - PQUEUE_ENTRY qp; - - qp = (PQUEUE_ENTRY)ExAllocateFromNPagedLookasideList(&QueueEntryLookasideList); - qp->p = p; - qp->Offset = 0; - - ExInterlockedInsertTailList(&Connection->PacketQueue, &qp->ListEntry, &Connection->Lock); -} - -PQUEUE_ENTRY LibTCPDequeuePacket(PCONNECTION_ENDPOINT Connection) -{ - PLIST_ENTRY Entry; - PQUEUE_ENTRY qp = NULL; - - if (IsListEmpty(&Connection->PacketQueue)) return NULL; - - Entry = RemoveHeadList(&Connection->PacketQueue); - - qp = CONTAINING_RECORD(Entry, QUEUE_ENTRY, ListEntry); - - return qp; -} - -NTSTATUS LibTCPGetDataFromConnectionQueue(PCONNECTION_ENDPOINT Connection, PUCHAR RecvBuffer, UINT RecvLen, UINT *Received) -{ - PQUEUE_ENTRY qp; - struct pbuf* p; - NTSTATUS Status; - UINT ReadLength, PayloadLength, Offset, Copied; - KIRQL OldIrql; - - (*Received) = 0; - - LockObject(Connection, &OldIrql); - - if (!IsListEmpty(&Connection->PacketQueue)) - { - while ((qp = LibTCPDequeuePacket(Connection)) != NULL) - { - p = qp->p; - - /* Calculate the payload length first */ - PayloadLength = p->tot_len; - PayloadLength -= qp->Offset; - Offset = qp->Offset; - - /* Check if we're reading the whole buffer */ - ReadLength = MIN(PayloadLength, RecvLen); - ASSERT(ReadLength != 0); - if (ReadLength != PayloadLength) - { - /* Save this one for later */ - qp->Offset += ReadLength; - InsertHeadList(&Connection->PacketQueue, &qp->ListEntry); - qp = NULL; - } - - UnlockObject(Connection, OldIrql); - - Copied = pbuf_copy_partial(p, RecvBuffer, ReadLength, Offset); - ASSERT(Copied == ReadLength); - - LockObject(Connection, &OldIrql); - - /* Update trackers */ - RecvLen -= ReadLength; - RecvBuffer += ReadLength; - (*Received) += ReadLength; - - if (qp != NULL) - { - /* Use this special pbuf free callback function because we're outside tcpip thread */ - pbuf_free_callback(qp->p); - - ExFreeToNPagedLookasideList(&QueueEntryLookasideList, qp); - } - else - { - /* If we get here, it means we've filled the buffer */ - ASSERT(RecvLen == 0); - } - - ASSERT((*Received) != 0); - Status = STATUS_SUCCESS; - - if (!RecvLen) - break; - } - } - else - { - if (Connection->ReceiveShutdown) - Status = Connection->ReceiveShutdownStatus; - else - Status = STATUS_PENDING; - } - - UnlockObject(Connection, OldIrql); - - return Status; -} - -static -BOOLEAN -WaitForEventSafely(PRKEVENT Event) -{ - PVOID WaitObjects[] = {Event, &TerminationEvent}; - - if (KeWaitForMultipleObjects(2, - WaitObjects, - WaitAny, - Executive, - KernelMode, - FALSE, - NULL, - NULL) == STATUS_WAIT_0) - { - /* Signalled by the caller's event */ - return TRUE; - } - else /* if KeWaitForMultipleObjects() == STATUS_WAIT_1 */ - { - /* Signalled by our termination event */ - return FALSE; - } -} - -static -err_t -InternalSendEventHandler(void *arg, PTCP_PCB pcb, const u16_t space) -{ - /* Make sure the socket didn't get closed */ - if (!arg) return ERR_OK; - - TCPSendEventHandler(arg, space); - - return ERR_OK; -} - -static -err_t -InternalRecvEventHandler(void *arg, PTCP_PCB pcb, struct pbuf *p, const err_t err) -{ - PCONNECTION_ENDPOINT Connection = arg; - - /* Make sure the socket didn't get closed */ - if (!arg) - { - if (p) - pbuf_free(p); - - return ERR_OK; - } - - if (p) - { - LibTCPEnqueuePacket(Connection, p); - - tcp_recved(pcb, p->tot_len); - - TCPRecvEventHandler(arg); - } - else if (err == ERR_OK) - { - /* Complete pending reads with 0 bytes to indicate a graceful closure, - * but note that send is still possible in this state so we don't close the - * whole socket here (by calling tcp_close()) as that would violate TCP specs - */ - Connection->ReceiveShutdown = TRUE; - Connection->ReceiveShutdownStatus = STATUS_SUCCESS; - - /* If we already did a send shutdown, we're in TIME_WAIT so we can't use this PCB anymore */ - if (Connection->SendShutdown) - { - Connection->SocketContext = NULL; - tcp_arg(pcb, NULL); - } - - /* Indicate the graceful close event */ - TCPRecvEventHandler(arg); - - /* If the PCB is gone, clean up the connection */ - if (Connection->SendShutdown) - { - TCPFinEventHandler(Connection, ERR_CLSD); - } - } - - return ERR_OK; -} - -/* This function MUST return an error value that is not ERR_ABRT or ERR_OK if the connection - * is not accepted to avoid leaking the new PCB */ -static -err_t -InternalAcceptEventHandler(void *arg, PTCP_PCB newpcb, const err_t err) -{ - /* Make sure the socket didn't get closed */ - if (!arg) - return ERR_CLSD; - - TCPAcceptEventHandler(arg, newpcb); - - /* Set in LibTCPAccept (called from TCPAcceptEventHandler) */ - if (newpcb->callback_arg) - return ERR_OK; - else - return ERR_CLSD; -} - -static -err_t -InternalConnectEventHandler(void *arg, PTCP_PCB pcb, const err_t err) -{ - /* Make sure the socket didn't get closed */ - if (!arg) - return ERR_OK; - - TCPConnectEventHandler(arg, err); - - return ERR_OK; -} - -static -void -InternalErrorEventHandler(void *arg, const err_t err) -{ - PCONNECTION_ENDPOINT Connection = arg; - - /* Make sure the socket didn't get closed */ - if (!arg || Connection->SocketContext == NULL) return; - - /* The PCB is dead now */ - Connection->SocketContext = NULL; - - /* Give them one shot to receive the remaining data */ - Connection->ReceiveShutdown = TRUE; - Connection->ReceiveShutdownStatus = TCPTranslateError(err); - TCPRecvEventHandler(Connection); - - /* Terminate the connection */ - TCPFinEventHandler(Connection, err); -} - -static -void -LibTCPSocketCallback(void *arg) -{ - struct lwip_callback_msg *msg = arg; - - ASSERT(msg); - - msg->Output.Socket.NewPcb = tcp_new(); - - if (msg->Output.Socket.NewPcb) - { - tcp_arg(msg->Output.Socket.NewPcb, msg->Input.Socket.Arg); - tcp_err(msg->Output.Socket.NewPcb, InternalErrorEventHandler); - } - - KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE); -} - -struct tcp_pcb * -LibTCPSocket(void *arg) -{ - struct lwip_callback_msg *msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList); - struct tcp_pcb *ret; - - if (msg) - { - KeInitializeEvent(&msg->Event, NotificationEvent, FALSE); - msg->Input.Socket.Arg = arg; - - tcpip_callback_with_block(LibTCPSocketCallback, msg, 1); - - if (WaitForEventSafely(&msg->Event)) - ret = msg->Output.Socket.NewPcb; - else - ret = NULL; - - ExFreeToNPagedLookasideList(&MessageLookasideList, msg); - - return ret; - } - - return NULL; -} - -static -void -LibTCPBindCallback(void *arg) -{ - struct lwip_callback_msg *msg = arg; - PTCP_PCB pcb = msg->Input.Bind.Connection->SocketContext; - - ASSERT(msg); - - if (!msg->Input.Bind.Connection->SocketContext) - { - msg->Output.Bind.Error = ERR_CLSD; - goto done; - } - - /* We're guaranteed that the local address is valid to bind at this point */ - pcb->so_options |= SOF_REUSEADDR; - - msg->Output.Bind.Error = tcp_bind(pcb, - msg->Input.Bind.IpAddress, - ntohs(msg->Input.Bind.Port)); - -done: - KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE); -} - -err_t -LibTCPBind(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port) -{ - struct lwip_callback_msg *msg; - err_t ret; - - msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList); - if (msg) - { - KeInitializeEvent(&msg->Event, NotificationEvent, FALSE); - msg->Input.Bind.Connection = Connection; - msg->Input.Bind.IpAddress = ipaddr; - msg->Input.Bind.Port = port; - - tcpip_callback_with_block(LibTCPBindCallback, msg, 1); - - if (WaitForEventSafely(&msg->Event)) - ret = msg->Output.Bind.Error; - else - ret = ERR_CLSD; - - ExFreeToNPagedLookasideList(&MessageLookasideList, msg); - - return ret; - } - - return ERR_MEM; -} - -static -void -LibTCPListenCallback(void *arg) -{ - struct lwip_callback_msg *msg = arg; - - ASSERT(msg); - - if (!msg->Input.Listen.Connection->SocketContext) - { - msg->Output.Listen.NewPcb = NULL; - goto done; - } - - msg->Output.Listen.NewPcb = tcp_listen_with_backlog((PTCP_PCB)msg->Input.Listen.Connection->SocketContext, msg->Input.Listen.Backlog); - - if (msg->Output.Listen.NewPcb) - { - tcp_accept(msg->Output.Listen.NewPcb, InternalAcceptEventHandler); - } - -done: - KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE); -} - -PTCP_PCB -LibTCPListen(PCONNECTION_ENDPOINT Connection, const u8_t backlog) -{ - struct lwip_callback_msg *msg; - PTCP_PCB ret; - - msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList); - if (msg) - { - KeInitializeEvent(&msg->Event, NotificationEvent, FALSE); - msg->Input.Listen.Connection = Connection; - msg->Input.Listen.Backlog = backlog; - - tcpip_callback_with_block(LibTCPListenCallback, msg, 1); - - if (WaitForEventSafely(&msg->Event)) - ret = msg->Output.Listen.NewPcb; - else - ret = NULL; - - ExFreeToNPagedLookasideList(&MessageLookasideList, msg); - - return ret; - } - - return NULL; -} - -static -void -LibTCPSendCallback(void *arg) -{ - struct lwip_callback_msg *msg = arg; - PTCP_PCB pcb = msg->Input.Send.Connection->SocketContext; - ULONG SendLength; - UCHAR SendFlags; - - ASSERT(msg); - - if (!msg->Input.Send.Connection->SocketContext) - { - msg->Output.Send.Error = ERR_CLSD; - goto done; - } - - if (msg->Input.Send.Connection->SendShutdown) - { - msg->Output.Send.Error = ERR_CLSD; - goto done; - } - - SendFlags = TCP_WRITE_FLAG_COPY; - SendLength = msg->Input.Send.DataLength; - if (tcp_sndbuf(pcb) == 0) - { - /* No buffer space so return pending */ - msg->Output.Send.Error = ERR_INPROGRESS; - goto done; - } - else if (tcp_sndbuf(pcb) < SendLength) - { - /* We've got some room so let's send what we can */ - SendLength = tcp_sndbuf(pcb); - - /* Don't set the push flag */ - SendFlags |= TCP_WRITE_FLAG_MORE; - } - - msg->Output.Send.Error = tcp_write(pcb, - msg->Input.Send.Data, - SendLength, - SendFlags); - if (msg->Output.Send.Error == ERR_OK) - { - /* Queued successfully so try to send it */ - tcp_output((PTCP_PCB)msg->Input.Send.Connection->SocketContext); - msg->Output.Send.Information = SendLength; - } - else if (msg->Output.Send.Error == ERR_MEM) - { - /* The queue is too long */ - msg->Output.Send.Error = ERR_INPROGRESS; - } - -done: - KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE); -} - -err_t -LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t len, u32_t *sent, const int safe) -{ - err_t ret; - struct lwip_callback_msg *msg; - - msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList); - if (msg) - { - KeInitializeEvent(&msg->Event, NotificationEvent, FALSE); - msg->Input.Send.Connection = Connection; - msg->Input.Send.Data = dataptr; - msg->Input.Send.DataLength = len; - - if (safe) - LibTCPSendCallback(msg); - else - tcpip_callback_with_block(LibTCPSendCallback, msg, 1); - - if (WaitForEventSafely(&msg->Event)) - ret = msg->Output.Send.Error; - else - ret = ERR_CLSD; - - if (ret == ERR_OK) - *sent = msg->Output.Send.Information; - else - *sent = 0; - - ExFreeToNPagedLookasideList(&MessageLookasideList, msg); - - return ret; - } - - return ERR_MEM; -} - -static -void -LibTCPConnectCallback(void *arg) -{ - struct lwip_callback_msg *msg = arg; - err_t Error; - - ASSERT(arg); - - if (!msg->Input.Connect.Connection->SocketContext) - { - msg->Output.Connect.Error = ERR_CLSD; - goto done; - } - - tcp_recv((PTCP_PCB)msg->Input.Connect.Connection->SocketContext, InternalRecvEventHandler); - tcp_sent((PTCP_PCB)msg->Input.Connect.Connection->SocketContext, InternalSendEventHandler); - - Error = tcp_connect((PTCP_PCB)msg->Input.Connect.Connection->SocketContext, - msg->Input.Connect.IpAddress, ntohs(msg->Input.Connect.Port), - InternalConnectEventHandler); - - msg->Output.Connect.Error = Error == ERR_OK ? ERR_INPROGRESS : Error; - -done: - KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE); -} - -err_t -LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port) -{ - struct lwip_callback_msg *msg; - err_t ret; - - msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList); - if (msg) - { - KeInitializeEvent(&msg->Event, NotificationEvent, FALSE); - msg->Input.Connect.Connection = Connection; - msg->Input.Connect.IpAddress = ipaddr; - msg->Input.Connect.Port = port; - - tcpip_callback_with_block(LibTCPConnectCallback, msg, 1); - - if (WaitForEventSafely(&msg->Event)) - { - ret = msg->Output.Connect.Error; - } - else - ret = ERR_CLSD; - - ExFreeToNPagedLookasideList(&MessageLookasideList, msg); - - return ret; - } - - return ERR_MEM; -} - -static -void -LibTCPShutdownCallback(void *arg) -{ - struct lwip_callback_msg *msg = arg; - PTCP_PCB pcb = msg->Input.Shutdown.Connection->SocketContext; - - if (!msg->Input.Shutdown.Connection->SocketContext) - { - msg->Output.Shutdown.Error = ERR_CLSD; - goto done; - } - - /* LwIP makes the (questionable) assumption that SHUTDOWN_RDWR is equivalent to tcp_close(). - * This assumption holds even if the shutdown calls are done separately (even through multiple - * WinSock shutdown() calls). This assumption means that lwIP has the right to deallocate our - * PCB without telling us if we shutdown TX and RX. To avoid these problems, we'll clear the - * socket context if we have called shutdown for TX and RX. - */ - if (msg->Input.Shutdown.shut_rx) { - msg->Output.Shutdown.Error = tcp_shutdown(pcb, TRUE, FALSE); - } - if (msg->Input.Shutdown.shut_tx) { - msg->Output.Shutdown.Error = tcp_shutdown(pcb, FALSE, TRUE); - } - - if (!msg->Output.Shutdown.Error) - { - if (msg->Input.Shutdown.shut_rx) - { - msg->Input.Shutdown.Connection->ReceiveShutdown = TRUE; - msg->Input.Shutdown.Connection->ReceiveShutdownStatus = STATUS_FILE_CLOSED; - } - - if (msg->Input.Shutdown.shut_tx) - msg->Input.Shutdown.Connection->SendShutdown = TRUE; - - if (msg->Input.Shutdown.Connection->ReceiveShutdown && - msg->Input.Shutdown.Connection->SendShutdown) - { - /* The PCB is not ours anymore */ - msg->Input.Shutdown.Connection->SocketContext = NULL; - tcp_arg(pcb, NULL); - TCPFinEventHandler(msg->Input.Shutdown.Connection, ERR_CLSD); - } - } - -done: - KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE); -} - -err_t -LibTCPShutdown(PCONNECTION_ENDPOINT Connection, const int shut_rx, const int shut_tx) -{ - struct lwip_callback_msg *msg; - err_t ret; - - msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList); - if (msg) - { - KeInitializeEvent(&msg->Event, NotificationEvent, FALSE); - - msg->Input.Shutdown.Connection = Connection; - msg->Input.Shutdown.shut_rx = shut_rx; - msg->Input.Shutdown.shut_tx = shut_tx; - - tcpip_callback_with_block(LibTCPShutdownCallback, msg, 1); - - if (WaitForEventSafely(&msg->Event)) - ret = msg->Output.Shutdown.Error; - else - ret = ERR_CLSD; - - ExFreeToNPagedLookasideList(&MessageLookasideList, msg); - - return ret; - } - - return ERR_MEM; -} - -static -void -LibTCPCloseCallback(void *arg) -{ - struct lwip_callback_msg *msg = arg; - PTCP_PCB pcb = msg->Input.Close.Connection->SocketContext; - - /* Empty the queue even if we're already "closed" */ - LibTCPEmptyQueue(msg->Input.Close.Connection); - - /* Check if we've already been closed */ - if (msg->Input.Close.Connection->Closing) - { - msg->Output.Close.Error = ERR_OK; - goto done; - } - - /* Enter "closing" mode if we're doing a normal close */ - if (msg->Input.Close.Callback) - msg->Input.Close.Connection->Closing = TRUE; - - /* Check if the PCB was already "closed" but the client doesn't know it yet */ - if (!msg->Input.Close.Connection->SocketContext) - { - msg->Output.Close.Error = ERR_OK; - goto done; - } - - /* Clear the PCB pointer and stop callbacks */ - msg->Input.Close.Connection->SocketContext = NULL; - tcp_arg(pcb, NULL); - - /* This may generate additional callbacks but we don't care, - * because they're too inconsistent to rely on */ - msg->Output.Close.Error = tcp_close(pcb); - - if (msg->Output.Close.Error) - { - /* Restore the PCB pointer */ - msg->Input.Close.Connection->SocketContext = pcb; - msg->Input.Close.Connection->Closing = FALSE; - } - else if (msg->Input.Close.Callback) - { - TCPFinEventHandler(msg->Input.Close.Connection, ERR_CLSD); - } - -done: - KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE); -} - -err_t -LibTCPClose(PCONNECTION_ENDPOINT Connection, const int safe, const int callback) -{ - err_t ret; - struct lwip_callback_msg *msg; - - msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList); - if (msg) - { - KeInitializeEvent(&msg->Event, NotificationEvent, FALSE); - - msg->Input.Close.Connection = Connection; - msg->Input.Close.Callback = callback; - - if (safe) - LibTCPCloseCallback(msg); - else - tcpip_callback_with_block(LibTCPCloseCallback, msg, 1); - - if (WaitForEventSafely(&msg->Event)) - ret = msg->Output.Close.Error; - else - ret = ERR_CLSD; - - ExFreeToNPagedLookasideList(&MessageLookasideList, msg); - - return ret; - } - - return ERR_MEM; -} - -void -LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg) -{ - ASSERT(arg); - - tcp_arg(pcb, NULL); - tcp_recv(pcb, InternalRecvEventHandler); - tcp_sent(pcb, InternalSendEventHandler); - tcp_err(pcb, InternalErrorEventHandler); - tcp_arg(pcb, arg); - - tcp_accepted(listen_pcb); -} - -err_t -LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port) -{ - if (!pcb) - return ERR_CLSD; - - *ipaddr = pcb->local_ip; - *port = pcb->local_port; - - return ERR_OK; -} - -err_t -LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr * const ipaddr, u16_t * const port) -{ - if (!pcb) - return ERR_CLSD; - - *ipaddr = pcb->remote_ip; - *port = pcb->remote_port; - - return ERR_OK; -} - -void -LibTCPSetNoDelay( - PTCP_PCB pcb, - BOOLEAN Set) -{ - if (Set) - pcb->flags |= TF_NODELAY; - else - pcb->flags &= ~TF_NODELAY; -} Modified: branches/tcpip_revolution/lib/drivers/lwip/src/sys_arch.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/lw…
============================================================================== --- branches/tcpip_revolution/lib/drivers/lwip/src/sys_arch.c [iso-8859-1] (original) +++ branches/tcpip_revolution/lib/drivers/lwip/src/sys_arch.c [iso-8859-1] Mon Nov 10 18:00:28 2014 @@ -3,8 +3,6 @@ #include "lwip/tcp.h" #include "lwip/pbuf.h" #include "lwip/err.h" - -#include "rosip.h" #include <debug.h> @@ -315,22 +313,6 @@ KeQuerySystemTime(&StartTime); KeInitializeEvent(&TerminationEvent, NotificationEvent, FALSE); - - ExInitializeNPagedLookasideList(&MessageLookasideList, - NULL, - NULL, - 0, - sizeof(struct lwip_callback_msg), - LWIP_TAG, - 0); - - ExInitializeNPagedLookasideList(&QueueEntryLookasideList, - NULL, - NULL, - 0, - sizeof(QUEUE_ENTRY), - LWIP_TAG, - 0); } void
10 years, 1 month
1
0
0
0
[jgardou] 65364: [IP] - Violently rip off this too.
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 10 18:00:24 2014 New Revision: 65364 URL:
http://svn.reactos.org/svn/reactos?rev=65364&view=rev
Log: [IP] - Violently rip off this too. Removed: branches/tcpip_revolution/lib/drivers/ip/CMakeLists.txt branches/tcpip_revolution/lib/drivers/ip/network/address.c branches/tcpip_revolution/lib/drivers/ip/network/arp.c branches/tcpip_revolution/lib/drivers/ip/network/checksum.c branches/tcpip_revolution/lib/drivers/ip/network/i386/checksum.S branches/tcpip_revolution/lib/drivers/ip/network/icmp.c branches/tcpip_revolution/lib/drivers/ip/network/interface.c branches/tcpip_revolution/lib/drivers/ip/network/ip.c branches/tcpip_revolution/lib/drivers/ip/network/loopback.c branches/tcpip_revolution/lib/drivers/ip/network/neighbor.c branches/tcpip_revolution/lib/drivers/ip/network/ports.c branches/tcpip_revolution/lib/drivers/ip/network/receive.c branches/tcpip_revolution/lib/drivers/ip/network/router.c branches/tcpip_revolution/lib/drivers/ip/network/routines.c branches/tcpip_revolution/lib/drivers/ip/network/transmit.c branches/tcpip_revolution/lib/drivers/ip/precomp.h branches/tcpip_revolution/lib/drivers/ip/transport/datagram/datagram.c branches/tcpip_revolution/lib/drivers/ip/transport/rawip/rawip.c branches/tcpip_revolution/lib/drivers/ip/transport/tcp/accept.c branches/tcpip_revolution/lib/drivers/ip/transport/tcp/event.c branches/tcpip_revolution/lib/drivers/ip/transport/tcp/if.c branches/tcpip_revolution/lib/drivers/ip/transport/tcp/tcp.c branches/tcpip_revolution/lib/drivers/ip/transport/udp/udp.c Modified: branches/tcpip_revolution/lib/drivers/CMakeLists.txt [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/tcpip_revolution/lib/drivers/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/CM…
Removed: branches/tcpip_revolution/lib/drivers/ip/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/address.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/arp.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/checksum.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/i386/checksum.S URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/icmp.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/interface.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/ip.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/loopback.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/neighbor.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/ports.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/receive.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/router.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/routines.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/network/transmit.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/transport/datagram/datagram.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/transport/rawip/rawip.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/transport/tcp/accept.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/transport/tcp/event.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/transport/tcp/if.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/transport/tcp/tcp.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
Removed: branches/tcpip_revolution/lib/drivers/ip/transport/udp/udp.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/ip…
10 years, 1 month
1
0
0
0
[jgardou] 65363: [LWIP] - enable SNMP, UDP, ICMP and loopback interface support.
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 10 18:00:13 2014 New Revision: 65363 URL:
http://svn.reactos.org/svn/reactos?rev=65363&view=rev
Log: [LWIP] - enable SNMP, UDP, ICMP and loopback interface support. Modified: branches/tcpip_revolution/lib/drivers/lwip/CMakeLists.txt branches/tcpip_revolution/lib/drivers/lwip/src/include/lwipopts.h Modified: branches/tcpip_revolution/lib/drivers/lwip/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/lw…
============================================================================== --- branches/tcpip_revolution/lib/drivers/lwip/CMakeLists.txt [iso-8859-1] (original) +++ branches/tcpip_revolution/lib/drivers/lwip/CMakeLists.txt [iso-8859-1] Mon Nov 10 18:00:13 2014 @@ -56,6 +56,7 @@ src/core/snmp/mib2.c src/core/snmp/msg_in.c src/core/snmp/msg_out.c + src/netif/etharp.c precomp.h) add_library(lwip ${SOURCE}) @@ -66,4 +67,5 @@ if(LTCG) add_compile_flags("-fno-builtin-malloc -fno-builtin-free") endif() + add_compile_flags("-Wno-address") endif() Modified: branches/tcpip_revolution/lib/drivers/lwip/src/include/lwipopts.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/lw…
============================================================================== --- branches/tcpip_revolution/lib/drivers/lwip/src/include/lwipopts.h [iso-8859-1] (original) +++ branches/tcpip_revolution/lib/drivers/lwip/src/include/lwipopts.h [iso-8859-1] Mon Nov 10 18:00:13 2014 @@ -14,7 +14,7 @@ #define MEM_ALIGNMENT 4 -#define LWIP_ARP 0 +#define LWIP_ARP 1 #define ARP_QUEUEING 0 @@ -30,21 +30,21 @@ #define IP_SOF_BROADCAST_RECV 1 -#define LWIP_ICMP 0 - -#define LWIP_RAW 0 +#define LWIP_ICMP 1 + +#define LWIP_RAW 1 #define LWIP_DHCP 0 #define LWIP_AUTOIP 0 -#define LWIP_SNMP 0 +#define LWIP_SNMP 1 #define LWIP_IGMP 0 #define LWIP_DNS 0 -#define LWIP_UDP 0 +#define LWIP_UDP 1 #define LWIP_UDPLITE 0 @@ -96,6 +96,8 @@ #define PPPOS_SUPPORT 0 +#define LWIP_NETIF_LOOPBACK 1 + /* --------------------------------------- ---------- Debugging options ---------- @@ -203,4 +205,4 @@ /** * TCPIP_DEBUG: Enable debugging in tcpip.c. */ -#define TCPIP_DEBUG LWIP_DBG_OFF +#define TCPIP_DEBUG LWIP_DBG_OFF
10 years, 1 month
1
0
0
0
[jgardou] 65362: [TCPIP] Start a new implementation using lwip *for real*. The goal being to let lwip do all the dirty work for us, taking the full power of it, including TCP, ICMP, SNMP, UDP, raw ...
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 10 18:00:09 2014 New Revision: 65362 URL:
http://svn.reactos.org/svn/reactos?rev=65362&view=rev
Log: [TCPIP] Start a new implementation using lwip *for real*. The goal being to let lwip do all the dirty work for us, taking the full power of it, including TCP, ICMP, SNMP, UDP, raw IP, etc. Commmit what I got so far, including: - registering the tcp/ip protocol to NDIS - Creating the loopback/adapter interface as wrappers around lwip_netif structures. - Querying a few pieces of information from the said interface. - Sending and receiving raw/UDP diagrams through lwip (not quite working yet, but soon). - Registering entities "instances". Added: branches/tcpip_revolution/drivers/network/tcpip/CMakeLists.txt (with props) branches/tcpip_revolution/drivers/network/tcpip/address.c (with props) branches/tcpip_revolution/drivers/network/tcpip/address.h (with props) branches/tcpip_revolution/drivers/network/tcpip/connection.c (with props) branches/tcpip_revolution/drivers/network/tcpip/entities.c (with props) branches/tcpip_revolution/drivers/network/tcpip/entities.h (with props) branches/tcpip_revolution/drivers/network/tcpip/information.c (with props) branches/tcpip_revolution/drivers/network/tcpip/information.h (with props) branches/tcpip_revolution/drivers/network/tcpip/interface.c (with props) branches/tcpip_revolution/drivers/network/tcpip/interface.h (with props) branches/tcpip_revolution/drivers/network/tcpip/main.c (with props) branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.c (with props) branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.h (with props) branches/tcpip_revolution/drivers/network/tcpip/precomp.h (with props) branches/tcpip_revolution/drivers/network/tcpip/stubs.c (with props) branches/tcpip_revolution/drivers/network/tcpip/tcp.c (with props) branches/tcpip_revolution/drivers/network/tcpip/tcp.h (with props) branches/tcpip_revolution/drivers/network/tcpip/tcpip.rc (with props) branches/tcpip_revolution/drivers/network/tcpip/tcpip.spec (with props) Added: branches/tcpip_revolution/drivers/network/tcpip/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/CMakeLists.txt (added) +++ branches/tcpip_revolution/drivers/network/tcpip/CMakeLists.txt [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,31 @@ + +include_directories( + ${REACTOS_SOURCE_DIR}/lib/drivers/lwip/src/include + ${REACTOS_SOURCE_DIR}/lib/drivers/lwip/src/include/ipv4) + +add_definitions(-DNDIS51) + +spec2def(tcpip.sys tcpip.spec) + +list(APPEND SOURCE + address.c + entities.c + information.c + interface.c + main.c + ndis_lwip.c + tcp.c + stubs.c + precomp.h +) + +add_library(tcpip SHARED + ${SOURCE} + tcpip.rc + ${CMAKE_CURRENT_BINARY_DIR}/tcpip.def) + +target_link_libraries(tcpip lwip ${PSEH_LIB} libcntpr) +set_module_type(tcpip kernelmodedriver) +add_importlibs(tcpip ndis ntoskrnl hal) +add_pch(tcpip precomp.h SOURCE) +add_cd_file(TARGET tcpip DESTINATION reactos/system32/drivers FOR all) Propchange: branches/tcpip_revolution/drivers/network/tcpip/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/tcpip_revolution/drivers/network/tcpip/address.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/address.c (added) +++ branches/tcpip_revolution/drivers/network/tcpip/address.c [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,584 @@ +/* + * PROJECT: ReactOS tcpip.sys + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: drivers/network/tcpip/address.c + * PURPOSE: tcpip.sys: addresses abstraction + */ + +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + +typedef struct +{ + LIST_ENTRY ListEntry; + TDI_ADDRESS_IP RemoteAddress; + PIRP Irp; + PVOID Buffer; + ULONG BufferLength; + PTDI_CONNECTION_INFORMATION ReturnInfo; +} RECEIVE_DATAGRAM_REQUEST; + +/* The pool tags we will use for all of our allocation */ +#define TAG_ADDRESS_FILE 'FrdA' + +/* The list of shared addresses */ +static KSPIN_LOCK AddressListLock; +static LIST_ENTRY AddressListHead; + +void +TcpIpInitializeAddresses(void) +{ + KeInitializeSpinLock(&AddressListLock); + InitializeListHead(&AddressListHead); +} + +static +BOOLEAN +AddrIsUnspecified( + _In_ PTDI_ADDRESS_IP Address) +{ + return ((Address->in_addr == 0) || (Address->in_addr == 0xFFFFFFFF)); +} + +static +BOOLEAN +ReceiveDatagram( + ADDRESS_FILE* AddressFile, + struct pbuf *p, + ip_addr_t *addr, + u16_t port, + BOOLEAN MustFree) +{ + KIRQL OldIrql; + LIST_ENTRY* ListEntry; + RECEIVE_DATAGRAM_REQUEST* Request; + ip_addr_t RequestAddr; + BOOLEAN Result = FALSE; + + /* Block any cancellation that could occur */ + IoAcquireCancelSpinLock(&OldIrql); + KeAcquireSpinLockAtDpcLevel(&AddressFile->RequestLock); + + ListEntry = AddressFile->RequestListHead.Flink; + while (ListEntry != &AddressFile->RequestListHead) + { + Request = CONTAINING_RECORD(ListEntry, RECEIVE_DATAGRAM_REQUEST, ListEntry); + ListEntry = ListEntry->Flink; + + ip4_addr_set_u32(&RequestAddr, Request->RemoteAddress.in_addr); + + if ((RequestAddr.addr == IPADDR_ANY) || + (ip_addr_cmp(&RequestAddr, addr) && + ((Request->RemoteAddress.sin_port == port) || !port))) + { + PTA_IP_ADDRESS ReturnAddress; + + /* We found a request for this one */ + IoSetCancelRoutine(Request->Irp, NULL); + RemoveEntryList(&Request->ListEntry); + + KeReleaseSpinLockFromDpcLevel(&AddressFile->RequestLock); + IoReleaseCancelSpinLock(OldIrql); + + /* Return what we have to */ + pbuf_copy_partial(p, Request->Buffer, Request->BufferLength, 0); + ReturnAddress = Request->ReturnInfo->RemoteAddress; + ReturnAddress->Address->AddressLength = TDI_ADDRESS_LENGTH_IP; + ReturnAddress->Address->AddressType = TDI_ADDRESS_TYPE_IP; + ReturnAddress->Address->Address->sin_port = port; + ReturnAddress->Address->Address->in_addr = ip4_addr_get_u32(addr); + RtlZeroMemory(ReturnAddress->Address->Address->sin_zero, + sizeof(ReturnAddress->Address->Address->sin_zero)); + + Request->Irp->IoStatus.Status = STATUS_SUCCESS; + + Result = TRUE; + + IoCompleteRequest(Request->Irp, IO_NETWORK_INCREMENT); + + ExFreePoolWithTag(Request, TAG_ADDRESS_FILE); + + /* Restart from the beginning of the list */ + IoAcquireCancelSpinLock(&OldIrql); + KeAcquireSpinLockAtDpcLevel(&AddressFile->RequestLock); + ListEntry = AddressFile->RequestListHead.Flink; + } + } + + KeReleaseSpinLockFromDpcLevel(&AddressFile->RequestLock); + IoReleaseCancelSpinLock(OldIrql); + if (Result || MustFree) + pbuf_free(p); + + return Result; +} + +static +void +lwip_udp_ReceiveDatagram_callback( + void *arg, + struct udp_pcb *pcb, + struct pbuf *p, + ip_addr_t *addr, + u16_t port) +{ + UNREFERENCED_PARAMETER(pcb); + + ReceiveDatagram(arg, p, addr, port, TRUE); +} + +static +u8_t +lwip_raw_ReceiveDatagram_callback( + void *arg, + struct raw_pcb *pcb, + struct pbuf *p, + ip_addr_t *addr) +{ + UNREFERENCED_PARAMETER(pcb); + + return ReceiveDatagram(arg, p, addr, 0, FALSE); +} + +NTSTATUS +TcpIpCreateAddress( + _Inout_ PIRP Irp, + _Inout_ PTDI_ADDRESS_IP Address, + _In_ IPPROTO Protocol +) +{ + PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); + ADDRESS_FILE *AddressFile; + LIST_ENTRY* ListEntry; + KIRQL OldIrql; + USHORT Port = 1; + + /* See if this port is already taken, and find a free one if needed. */ + KeAcquireSpinLock(&AddressListLock, &OldIrql); + + ListEntry = AddressListHead.Flink; + while (ListEntry != &AddressListHead) + { + AddressFile = CONTAINING_RECORD(ListEntry, ADDRESS_FILE, ListEntry); + + if (Address->sin_port) + { + if ((AddressFile->Protocol == Protocol) && + (AddressFile->Address.sin_port == Address->sin_port)) + { + if (IrpSp->Parameters.Create.ShareAccess) + { + /* Good, we found the shared address we were looking for */ + InterlockedIncrement(&AddressFile->RefCount); + KeReleaseSpinLock(&AddressListLock, OldIrql); + goto Success; + } + + KeReleaseSpinLock(&AddressListLock, OldIrql); + return STATUS_ADDRESS_ALREADY_EXISTS; + } + } + else if ((AddressFile->Address.sin_port == Port) + && AddressFile->Protocol == Protocol) + { + Port++; + if (Port == 0) + { + /* Oh no. Already 65535 ports occupied! */ + DPRINT1("No more free ports for protocol %d!\n", Protocol); + KeReleaseSpinLock(&AddressListLock, OldIrql); + return STATUS_TOO_MANY_ADDRESSES; + } + + /* We must start anew to check again the previous entries in the list */ + ListEntry = &AddressListHead; + } + ListEntry = ListEntry->Flink; + } + + if (!AddrIsUnspecified(Address)) + { + /* Find the local interface for this address */ + struct netif* lwip_netif = netif_list; + ip_addr_t IpAddr; + + ip4_addr_set_u32(&IpAddr, AddressFile->Address.in_addr); + while (lwip_netif) + { + if (ip_addr_cmp(&IpAddr, &lwip_netif->ip_addr)) + { + break; + } + lwip_netif = lwip_netif->next; + } + + if (!lwip_netif) + { + DPRINT1("Cound not find an interface for address 0x08x\n", AddressFile->Address.in_addr); + KeReleaseSpinLock(&AddressListLock, OldIrql); + return STATUS_INVALID_ADDRESS; + } + } + + /* Allocate our new address file */ + AddressFile = ExAllocatePoolWithTag(NonPagedPool, sizeof(*AddressFile), TAG_ADDRESS_FILE); + if (!AddressFile) + { + return STATUS_NO_MEMORY; + } + + RtlZeroMemory(AddressFile, sizeof(*AddressFile)); + AddressFile->RefCount = 1; + RtlCopyMemory(&AddressFile->Address, Address, sizeof(*Address)); + AddressFile->Protocol = Protocol; + if (!Address->sin_port) + AddressFile->Address.sin_port = Port; + + /* Initialize the datagram request stuff */ + KeInitializeSpinLock(&AddressFile->RequestLock); + InitializeListHead(&AddressFile->RequestListHead); + + /* Give it an entity ID and open a PCB is needed. */ + switch (Protocol) + { + case IPPROTO_TCP: + InsertEntityInstance(CO_TL_ENTITY, &AddressFile->Instance); + break; + case IPPROTO_UDP: + { + ip_addr_t IpAddr; + ip4_addr_set_u32(&IpAddr, AddressFile->Address.in_addr); + InsertEntityInstance(CL_TL_ENTITY, &AddressFile->Instance); + AddressFile->lwip_udp_pcb = udp_new(); + udp_bind(AddressFile->lwip_udp_pcb, &IpAddr, AddressFile->Address.sin_port); + ip_set_option(AddressFile->lwip_udp_pcb, SOF_BROADCAST); + /* Register our recv handler to lwip */ + udp_recv( + AddressFile->lwip_udp_pcb, + lwip_udp_ReceiveDatagram_callback, + AddressFile); + break; + } + default: + { + ip_addr_t IpAddr; + ip4_addr_set_u32(&IpAddr, AddressFile->Address.in_addr); + if (Protocol == IPPROTO_ICMP) + InsertEntityInstance(ER_ENTITY, &AddressFile->Instance); + else + InsertEntityInstance(CL_TL_ENTITY, &AddressFile->Instance); + AddressFile->lwip_raw_pcb = raw_new(Protocol); + raw_bind(AddressFile->lwip_raw_pcb, &IpAddr); + ip_set_option(AddressFile->lwip_raw_pcb, SOF_BROADCAST); + /* Register our recv handler for lwip */ + raw_recv( + AddressFile->lwip_raw_pcb, + lwip_raw_ReceiveDatagram_callback, + AddressFile); + break; + } + } + + /* Insert it into the list. */ + InsertTailList(&AddressListHead, &AddressFile->ListEntry); + KeReleaseSpinLock(&AddressListLock, OldIrql); + +Success: + IrpSp->FileObject->FsContext = AddressFile; + IrpSp->FileObject->FsContext2 = (PVOID)TDI_TRANSPORT_ADDRESS_FILE; + return STATUS_SUCCESS; +} + +NTSTATUS +TcpIpCloseAddress( + _Inout_ ADDRESS_FILE* AddressFile +) +{ + KIRQL OldIrql; + + /* Lock the global address list */ + KeAcquireSpinLock(&AddressListLock, &OldIrql); + + if (InterlockedDecrement(&AddressFile->RefCount) != 0) + { + /* There are still some open handles for this address */ + KeReleaseSpinLock(&AddressListLock, OldIrql); + return STATUS_SUCCESS; + } + + /* Remove from the list and free the structure */ + RemoveEntryList(&AddressFile->ListEntry); + KeReleaseSpinLock(&AddressListLock, OldIrql); + + RemoveEntityInstance(&AddressFile->Instance); + ExFreePoolWithTag(AddressFile, TAG_ADDRESS_FILE); + + + return STATUS_SUCCESS; +} + +static +NTSTATUS +ExtractAddressFromList( + _In_ PTRANSPORT_ADDRESS AddressList, + _Out_ PTDI_ADDRESS_IP Address) +{ + PTA_ADDRESS CurrentAddress; + INT i; + + CurrentAddress = &AddressList->Address[0]; + + /* We can only use IP addresses. Search the list until we find one */ + for (i = 0; i < AddressList->TAAddressCount; i++) + { + if (CurrentAddress->AddressType == TDI_ADDRESS_TYPE_IP) + { + if (CurrentAddress->AddressLength == TDI_ADDRESS_LENGTH_IP) + { + /* This is an IPv4 address */ + RtlCopyMemory(Address, &CurrentAddress->Address[0], CurrentAddress->AddressLength); + return STATUS_SUCCESS; + } + } + CurrentAddress = (PTA_ADDRESS)&CurrentAddress->Address[CurrentAddress->AddressLength]; + } + return STATUS_INVALID_ADDRESS; +} + +static +VOID +NTAPI +CancelReceiveDatagram( + _Inout_ struct _DEVICE_OBJECT* DeviceObject, + _Inout_ _IRQL_uses_cancel_ struct _IRP *Irp) +{ + PIO_STACK_LOCATION IrpSp; + ADDRESS_FILE* AddressFile; + RECEIVE_DATAGRAM_REQUEST* Request; + KIRQL OldIrql; + LIST_ENTRY* ListEntry; + + IoReleaseCancelSpinLock(Irp->CancelIrql); + + IrpSp = IoGetCurrentIrpStackLocation(Irp); + AddressFile = IrpSp->FileObject->FsContext; + + /* Find this IRP in the list of requests */ + KeAcquireSpinLock(&AddressFile->RequestLock, &OldIrql); + ListEntry = AddressFile->RequestListHead.Flink; + while (ListEntry != &AddressFile->RequestListHead) + { + Request = CONTAINING_RECORD(ListEntry, RECEIVE_DATAGRAM_REQUEST, ListEntry); + if (Request->Irp == Irp) + break; + ListEntry = ListEntry->Flink; + } + + /* We must have found it */ + NT_ASSERT(ListEntry != &AddressFile->RequestListHead); + + RemoveEntryList(&Request->ListEntry); + KeReleaseSpinLock(&AddressFile->RequestLock, OldIrql); + + Irp->IoStatus.Status = STATUS_CANCELLED; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + + ExFreePoolWithTag(Request, TAG_ADDRESS_FILE); +} + + +NTSTATUS +TcpIpReceiveDatagram( + _Inout_ PIRP Irp) +{ + PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); + ADDRESS_FILE *AddressFile; + RECEIVE_DATAGRAM_REQUEST* Request = NULL; + PTDI_REQUEST_KERNEL_RECEIVEDG RequestInfo; + NTSTATUS Status; + KIRQL OldIrql; + + /* Check this is really an address file */ + if ((ULONG_PTR)IrpSp->FileObject->FsContext2 != TDI_TRANSPORT_ADDRESS_FILE) + { + Status = STATUS_FILE_INVALID; + goto Failure; + } + + /* Get the address file */ + AddressFile = IrpSp->FileObject->FsContext; + + if (AddressFile->Protocol == IPPROTO_TCP) + { + /* TCP has no such thing as datagrams */ + DPRINT1("Received TDI_RECEIVE_DATAGRAM for a TCP adress file.\n"); + Status = STATUS_INVALID_ADDRESS; + goto Failure; + } + + /* Queue the request */ + Request = ExAllocatePoolWithTag(NonPagedPool, sizeof(*Request), TAG_ADDRESS_FILE); + if (!Request) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto Failure; + } + RtlZeroMemory(Request, sizeof(*Request)); + Request->Irp = Irp; + + /* Get details about what we should be receiving */ + RequestInfo = (PTDI_REQUEST_KERNEL_RECEIVEDG)&IrpSp->Parameters; + + /* Get the address */ + if (RequestInfo->ReceiveDatagramInformation->RemoteAddressLength != 0) + { + Status = ExtractAddressFromList( + RequestInfo->ReceiveDatagramInformation->RemoteAddress, + &Request->RemoteAddress); + if (!NT_SUCCESS(Status)) + goto Failure; + } + + /* Get the buffer */ + Request->Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress); + Request->BufferLength = MmGetMdlByteCount(Irp->MdlAddress); + + Request->ReturnInfo = RequestInfo->ReturnDatagramInformation; + + /* Prepare for potential cancellation */ + IoAcquireCancelSpinLock(&OldIrql); + IoSetCancelRoutine(Irp, CancelReceiveDatagram); + IoReleaseCancelSpinLock(OldIrql); + + /* Mark pending */ + Irp->IoStatus.Status = STATUS_PENDING; + IoMarkIrpPending(Irp); + + /* We're ready to go */ + ExInterlockedInsertTailList( + &AddressFile->RequestListHead, + &Request->ListEntry, + &AddressFile->RequestLock); + + return STATUS_PENDING; + +Failure: + if (Request) + ExFreePoolWithTag(Request, TAG_ADDRESS_FILE); + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + return Status; +} + + +NTSTATUS +TcpIpSendDatagram( + _Inout_ PIRP Irp) +{ + PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); + ADDRESS_FILE *AddressFile; + PTDI_REQUEST_KERNEL_SENDDG RequestInfo; + NTSTATUS Status; + ip_addr_t IpAddr; + u16_t Port; + PVOID Buffer; + ULONG BufferLength; + struct pbuf* p = NULL; + err_t lwip_error; + + /* Check this is really an address file */ + if ((ULONG_PTR)IrpSp->FileObject->FsContext2 != TDI_TRANSPORT_ADDRESS_FILE) + { + Status = STATUS_FILE_INVALID; + goto Finish; + } + + /* Get the address file */ + AddressFile = IrpSp->FileObject->FsContext; + + if (AddressFile->Protocol == IPPROTO_TCP) + { + /* TCP has no such thing as datagrams */ + DPRINT1("Received TDI_SEND_DATAGRAM for a TCP adress file.\n"); + Status = STATUS_INVALID_ADDRESS; + goto Finish; + } + + /* Get details about what we should be receiving */ + RequestInfo = (PTDI_REQUEST_KERNEL_SENDDG)&IrpSp->Parameters; + + /* Get the address */ + if (RequestInfo->SendDatagramInformation->RemoteAddressLength != 0) + { + TDI_ADDRESS_IP Address; + Status = ExtractAddressFromList( + RequestInfo->SendDatagramInformation->RemoteAddress, + &Address); + if (!NT_SUCCESS(Status)) + goto Finish; + ip4_addr_set_u32(&IpAddr, Address.in_addr); + Port = Address.sin_port; + } + else + { + ip_addr_set_any(&IpAddr); + Port = 0; + } + + /* Get the buffer */ + Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress); + BufferLength = MmGetMdlByteCount(Irp->MdlAddress); + p = pbuf_alloc(PBUF_RAW, BufferLength, PBUF_REF); + if (!p) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto Finish; + } + p->payload = Buffer; + + /* Send it for real */ + switch (AddressFile->Protocol) + { + case IPPROTO_UDP: + lwip_error = udp_sendto(AddressFile->lwip_udp_pcb, p, &IpAddr, Port); + break; + default: + lwip_error = raw_sendto(AddressFile->lwip_raw_pcb, p, &IpAddr); + break; + } + + switch (lwip_error) + { + case ERR_OK: + Status = STATUS_SUCCESS; + Irp->IoStatus.Information = BufferLength; + break; + case ERR_MEM: + case ERR_BUF: + DPRINT1("Received ERR_MEM from lwip.\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + case ERR_RTE: + DPRINT1("Received ERR_RTE from lwip.\n"); + Status = STATUS_INVALID_ADDRESS; + break; + case ERR_VAL: + DPRINT1("Received ERR_VAL from lwip.\n"); + Status = STATUS_INVALID_PARAMETER; + break; + default: + DPRINT1("Received error %d from lwip.\n", lwip_error); + Status = STATUS_UNEXPECTED_NETWORK_ERROR; + } + +Finish: + if (p) + pbuf_free(p); + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + return Status; +} Propchange: branches/tcpip_revolution/drivers/network/tcpip/address.c ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/address.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/address.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/address.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/address.h (added) +++ branches/tcpip_revolution/drivers/network/tcpip/address.h [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,41 @@ + +#pragma once + +typedef struct +{ + LIST_ENTRY ListEntry; + LONG RefCount; + IPPROTO Protocol; + TDI_ADDRESS_IP Address; + TCPIP_INSTANCE Instance; + KSPIN_LOCK RequestLock; + LIST_ENTRY RequestListHead; + union + { + struct raw_pcb* lwip_raw_pcb; + struct udp_pcb* lwip_udp_pcb; + }; +} ADDRESS_FILE; + +void +TcpIpInitializeAddresses(void); + +NTSTATUS +TcpIpCreateAddress( + _Inout_ PIRP Irp, + _In_ PTDI_ADDRESS_IP Address, + _In_ IPPROTO Protocol +); + +NTSTATUS +TcpIpCloseAddress( + _Inout_ ADDRESS_FILE* AddressFile +); + +NTSTATUS +TcpIpReceiveDatagram( + _Inout_ PIRP Irp); + +NTSTATUS +TcpIpSendDatagram( + _Inout_ PIRP Irp); Propchange: branches/tcpip_revolution/drivers/network/tcpip/address.h ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/address.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/address.h ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/connection.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/connection.c (added) +++ branches/tcpip_revolution/drivers/network/tcpip/connection.c [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,12 @@ +/* + * PROJECT: ReactOS tcpip.sys + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: drivers/network/tcpip/address.c + * PURPOSE: tcpip.sys: addresses abstraction + */ + +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + Propchange: branches/tcpip_revolution/drivers/network/tcpip/connection.c ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/connection.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/connection.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/entities.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/entities.c (added) +++ branches/tcpip_revolution/drivers/network/tcpip/entities.c [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,322 @@ +/* + * PROJECT: ReactOS tcpip.sys + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: drivers/network/tcpip/address.c + * PURPOSE: tcpip.sys: entity list implementation + */ + +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + +#define TAG_ENTITIES 'nIpI' + +static const ULONG EntityList[] = { + AT_ENTITY, + CL_NL_ENTITY, + CO_NL_ENTITY, + CL_TL_ENTITY, + CO_TL_ENTITY, + ER_ENTITY, + IF_ENTITY +}; + +static LIST_ENTRY AtInstancesListHead; +static LIST_ENTRY ClNlInstancesListHead; +static LIST_ENTRY CoNlInstancesListHead; +static LIST_ENTRY ClTlInstancesListHead; +static LIST_ENTRY CoTlInstancesListHead; +static LIST_ENTRY ErInstancesListHead; +static LIST_ENTRY IfInstancesListHead; + +/* The corresponding locks */ +static KSPIN_LOCK AtInstanceLock; +static KSPIN_LOCK ClNlInstanceLock; +static KSPIN_LOCK CoNlInstanceLock; +static KSPIN_LOCK ClTlInstanceLock; +static KSPIN_LOCK CoTlInstanceLock; +static KSPIN_LOCK ErInstanceLock; +static KSPIN_LOCK IfInstanceLock; + +/* We keep track of those just for the sake of speed, + * as our network stack thinks it's clever to get the entity list often */ +static ULONG InstanceCount; + +static +PLIST_ENTRY +GetInstanceListHeadAcquireLock( + _In_ ULONG Entity, + _Out_ PKIRQL OldIrql +) +{ + switch (Entity) + { + case AT_ENTITY: + KeAcquireSpinLock(&AtInstanceLock, OldIrql); + return &AtInstancesListHead; + case CL_NL_ENTITY: + KeAcquireSpinLock(&ClNlInstanceLock, OldIrql); + return &ClNlInstancesListHead; + case CO_NL_ENTITY: + KeAcquireSpinLock(&CoNlInstanceLock, OldIrql); + return &CoNlInstancesListHead; + case CL_TL_ENTITY: + KeAcquireSpinLock(&ClTlInstanceLock, OldIrql); + return &ClTlInstancesListHead; + case CO_TL_ENTITY: + KeAcquireSpinLock(&CoTlInstanceLock, OldIrql); + return &CoTlInstancesListHead; + case ER_ENTITY: + KeAcquireSpinLock(&ErInstanceLock, OldIrql); + return &ErInstancesListHead; + case IF_ENTITY: + KeAcquireSpinLock(&IfInstanceLock, OldIrql); + return &IfInstancesListHead; + default: + DPRINT1("Got unknown entity ID %x\n", Entity); + return NULL; + } +} + +static +void +AcquireEntityLock( + _In_ ULONG Entity, + _Out_ KIRQL* OldIrql) +{ + switch (Entity) + { + case AT_ENTITY: + KeAcquireSpinLock(&AtInstanceLock, OldIrql); + return; + case CL_NL_ENTITY: + KeAcquireSpinLock(&ClNlInstanceLock, OldIrql); + return; + case CO_NL_ENTITY: + KeAcquireSpinLock(&CoNlInstanceLock, OldIrql); + return; + case CL_TL_ENTITY: + KeAcquireSpinLock(&ClTlInstanceLock, OldIrql); + return; + case CO_TL_ENTITY: + KeAcquireSpinLock(&CoTlInstanceLock, OldIrql); + return; + case ER_ENTITY: + KeAcquireSpinLock(&ErInstanceLock, OldIrql); + return; + case IF_ENTITY: + KeAcquireSpinLock(&IfInstanceLock, OldIrql); + return; + default: + DPRINT1("Got unknown entity ID %x\n", Entity); + ASSERT(FALSE); + } +} + +static +void +ReleaseEntityLock( + _In_ ULONG Entity, + _In_ KIRQL OldIrql) +{ + switch (Entity) + { + case AT_ENTITY: + KeReleaseSpinLock(&AtInstanceLock, OldIrql); + return; + case CL_NL_ENTITY: + KeReleaseSpinLock(&ClNlInstanceLock, OldIrql); + return; + case CO_NL_ENTITY: + KeReleaseSpinLock(&CoNlInstanceLock, OldIrql); + return; + case CL_TL_ENTITY: + KeReleaseSpinLock(&ClTlInstanceLock, OldIrql); + return; + case CO_TL_ENTITY: + KeReleaseSpinLock(&CoTlInstanceLock, OldIrql); + return; + case ER_ENTITY: + KeReleaseSpinLock(&ErInstanceLock, OldIrql); + return; + case IF_ENTITY: + KeReleaseSpinLock(&IfInstanceLock, OldIrql); + return; + default: + DPRINT1("Got unknown entity ID %x\n", Entity); + ASSERT(FALSE); + } +} + +VOID +TcpIpInitializeEntities(void) +{ + /* Initialize the locks */ + KeInitializeSpinLock(&AtInstanceLock); + KeInitializeSpinLock(&ClNlInstanceLock); + KeInitializeSpinLock(&CoNlInstanceLock); + KeInitializeSpinLock(&ClTlInstanceLock); + KeInitializeSpinLock(&CoTlInstanceLock); + KeInitializeSpinLock(&ErInstanceLock); + KeInitializeSpinLock(&IfInstanceLock); + + /* And the list heads */ + InitializeListHead(&AtInstancesListHead); + InitializeListHead(&ClNlInstancesListHead); + InitializeListHead(&CoNlInstancesListHead); + InitializeListHead(&ClTlInstancesListHead); + InitializeListHead(&CoTlInstancesListHead); + InitializeListHead(&ErInstancesListHead); + InitializeListHead(&IfInstancesListHead); + + /* We don't have anything for now */ + InstanceCount = 0; +} + +NTSTATUS +QueryEntityList( + _In_ TDIEntityID ID, + _In_ PVOID Context, + _Out_opt_ PVOID OutBuffer, + _Inout_ ULONG* BufferSize) +{ + KIRQL OldIrql; + TDIEntityID* Entity = OutBuffer; + ULONG RemainingSize = *BufferSize, TotalSize = 0; + TCPIP_INSTANCE* Instance; + LIST_ENTRY* ListHead; + LIST_ENTRY* ListEntry; + ULONG i; + + UNREFERENCED_PARAMETER(ID); + UNREFERENCED_PARAMETER(Context); + + DPRINT("Gathering the entity list.\n"); + + if (!OutBuffer) + { + *BufferSize = InstanceCount * sizeof(TDIEntityID); + return STATUS_SUCCESS; + } + + /* Go through the bitmaps */ + for (i = 0; i < sizeof(EntityList)/sizeof(EntityList[0]); i++) + { + ListHead = GetInstanceListHeadAcquireLock(EntityList[i], &OldIrql); + + ListEntry = ListHead->Flink; + while(ListEntry != ListHead) + { + if (RemainingSize < sizeof(TDIEntityID)) + { + *BufferSize = InstanceCount * sizeof(TDIEntityID); + ReleaseEntityLock(EntityList[i], OldIrql); + return STATUS_BUFFER_OVERFLOW; + } + + Instance = CONTAINING_RECORD(ListEntry, TCPIP_INSTANCE, ListEntry); + + *Entity++ = Instance->InstanceId; + RemainingSize -= sizeof(*Entity); + TotalSize += sizeof(*Entity); + + ListEntry = ListEntry->Flink; + } + + ReleaseEntityLock(EntityList[i], OldIrql); + } + + *BufferSize = TotalSize; + return STATUS_SUCCESS; +} + +VOID +InsertEntityInstance( + _In_ ULONG Entity, + _Out_ TCPIP_INSTANCE* OutInstance) +{ + KIRQL OldIrql; + LIST_ENTRY* ListHead; + LIST_ENTRY* ListEntry; + TCPIP_INSTANCE* Instance; + ULONG InstanceId = 1; + + ListHead = GetInstanceListHeadAcquireLock(Entity, &OldIrql); + NT_ASSERT(ListHead); + + ListEntry = ListHead->Flink; + + /* Find an instance number for this guy */ + while (ListEntry != ListHead) + { + Instance = CONTAINING_RECORD(ListEntry, TCPIP_INSTANCE, ListEntry); + + if (Instance->InstanceId.tei_instance != InstanceId) + break; + InstanceId++; + ListEntry = ListEntry->Flink; + } + + OutInstance->InstanceId.tei_entity = Entity; + OutInstance->InstanceId.tei_instance = InstanceId; + + /* Keep this list sorted */ + InsertHeadList(ListEntry, &OutInstance->ListEntry); + + ReleaseEntityLock(Entity, OldIrql); + + InterlockedIncrement((LONG*)&InstanceCount); +} + +void +RemoveEntityInstance( + _In_ TCPIP_INSTANCE* Instance) +{ + KIRQL OldIrql; + + AcquireEntityLock(Instance->InstanceId.tei_entity, &OldIrql); + + RemoveEntryList(&Instance->ListEntry); + + ReleaseEntityLock(Instance->InstanceId.tei_entity, OldIrql); + + InterlockedDecrement((LONG*)&InstanceCount); +} + +NTSTATUS +GetInstance( + _In_ TDIEntityID ID, + _Out_ TCPIP_INSTANCE** OutInstance) +{ + KIRQL OldIrql; + LIST_ENTRY *ListHead, *ListEntry; + TCPIP_INSTANCE* Instance; + + ListHead = GetInstanceListHeadAcquireLock(ID.tei_entity, &OldIrql); + NT_ASSERT(ListHead != NULL); + + ListEntry = ListHead->Flink; + while (ListEntry != ListHead) + { + Instance = CONTAINING_RECORD(ListEntry, TCPIP_INSTANCE, ListEntry); + + NT_ASSERT(Instance->InstanceId.tei_entity == ID.tei_entity); + if (Instance->InstanceId.tei_instance == ID.tei_instance) + { + *OutInstance = Instance; + ReleaseEntityLock(ID.tei_entity, OldIrql); + return STATUS_SUCCESS; + } + + /* The list is sorted, so we can cut the loop a bit */ + if (ID.tei_instance < Instance->InstanceId.tei_instance) + break; + + ListEntry = ListEntry->Flink; + } + + ReleaseEntityLock(ID.tei_entity, OldIrql); + /* Maybe we could find a more descriptive status */ + return STATUS_INVALID_PARAMETER; +} Propchange: branches/tcpip_revolution/drivers/network/tcpip/entities.c ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/entities.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/entities.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/entities.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/entities.h (added) +++ branches/tcpip_revolution/drivers/network/tcpip/entities.h [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,33 @@ + +#pragma once + +typedef struct +{ + TDIEntityID InstanceId; + LIST_ENTRY ListEntry; +} TCPIP_INSTANCE; + +VOID +TcpIpInitializeEntities(void); + +VOID +InsertEntityInstance( + _In_ ULONG Entity, + _Out_ TCPIP_INSTANCE* OutInstance); + +void +RemoveEntityInstance( + _In_ TCPIP_INSTANCE* Instance); + +NTSTATUS +GetInstance( + _In_ TDIEntityID, + _Out_ TCPIP_INSTANCE** Instance); + +/* IOCTL_TCP_QUERY_INFORMATION_EX handler */ +NTSTATUS +QueryEntityList( + _In_ TDIEntityID ID, + _In_ PVOID Context, + _Out_opt_ PVOID OutBuffer, + _Inout_ ULONG* BufferSize); Propchange: branches/tcpip_revolution/drivers/network/tcpip/entities.h ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/entities.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/entities.h ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/information.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/information.c (added) +++ branches/tcpip_revolution/drivers/network/tcpip/information.c [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,179 @@ +/* + * PROJECT: ReactOS tcpip.sys + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: drivers/network/tcpip/address.c + * PURPOSE: tcpip.sys: TCP_QUERY_INFORMATION_EX and TCP_SET_INFORMATION_EX ioctls implementation + */ + +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + +typedef NTSTATUS (*QUERY_INFO_HANDLER)( + _In_ TDIEntityID ID, + _In_ PVOID Context, + _Out_opt_ PVOID OutBuffer, + _Inout_ ULONG* BufferSize); + +static +struct +{ + ULONG Entity, Class, Type, Id; + QUERY_INFO_HANDLER Handler; + +} InfoHandlers[] = +{ + { GENERIC_ENTITY, INFO_CLASS_GENERIC, INFO_TYPE_PROVIDER, ENTITY_LIST_ID, QueryEntityList }, + { IF_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_STATS_ID, QueryInterfaceEntry}, + { CL_NL_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_ADDRTABLE_ENTRY_ID, QueryInterfaceAddrTable}, + { (ULONG)-1, (ULONG)-1, (ULONG)-1, (ULONG)-1, NULL } +}; + + +NTSTATUS +TcpIpQueryInformation( + _Inout_ PIRP Irp +) +{ + PIO_STACK_LOCATION IrpSp; + TCP_REQUEST_QUERY_INFORMATION_EX* Query; + QUERY_INFO_HANDLER Handler = NULL; + PMDL QueryMdl = NULL, OutputMdl = NULL; + BOOL QueryLocked = FALSE, OutputLocked = FALSE; + ULONG OutputBufferLength; + PVOID OutputBuffer = NULL; + NTSTATUS Status; + ULONG i; + + IrpSp = IoGetCurrentIrpStackLocation(Irp); + + /* Check input buffer size */ + if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < sizeof(TCP_REQUEST_QUERY_INFORMATION_EX)) + return STATUS_INVALID_PARAMETER; + + /* Get the input buffer */ + Query = IrpSp->Parameters.DeviceIoControl.Type3InputBuffer; + QueryMdl = IoAllocateMdl(Query, sizeof(*Query), FALSE, TRUE, NULL); + if (!QueryMdl) + return STATUS_INSUFFICIENT_RESOURCES; + + _SEH2_TRY + { + MmProbeAndLockPages(QueryMdl, Irp->RequestorMode, IoReadAccess); + QueryLocked = TRUE; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + goto Cleanup; + } _SEH2_END + + /* Get the outputbuffer, if any */ + OutputBufferLength = IrpSp->Parameters.DeviceIoControl.OutputBufferLength; + if (OutputBufferLength) + { + OutputBuffer = Irp->UserBuffer; + OutputMdl = IoAllocateMdl(OutputBuffer, OutputBufferLength, FALSE, TRUE, NULL); + if (!OutputMdl) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto Cleanup; + } + + _SEH2_TRY + { + MmProbeAndLockPages(OutputMdl, Irp->RequestorMode, IoWriteAccess); + OutputLocked = TRUE; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + goto Cleanup; + } + _SEH2_END + } + + /* Find the handler for this particular query */ + for (i = 0; InfoHandlers[i].Handler != NULL; i++) + { + if ((InfoHandlers[i].Entity == Query->ID.toi_entity.tei_entity) && + (InfoHandlers[i].Class == Query->ID.toi_class) && + (InfoHandlers[i].Type == Query->ID.toi_type) && + (InfoHandlers[i].Id == Query->ID.toi_id)) + { + Handler = InfoHandlers[i].Handler; + break; + } + } + + if (!Handler) + { + DPRINT1("TCPIP - Unknown query: entity 0x%x, class 0x%x, type 0x%x, Id 0x%x.\n", + Query->ID.toi_entity.tei_entity, Query->ID.toi_class, Query->ID.toi_type, Query->ID.toi_id); + Status = STATUS_NOT_IMPLEMENTED; + goto Cleanup; + } + + Status = Handler(Query->ID.toi_entity, Query->Context, OutputBuffer, &OutputBufferLength); + + Irp->IoStatus.Information = OutputBufferLength; + +Cleanup: + if (QueryMdl) + { + if (QueryLocked) + MmUnlockPages(QueryMdl); + IoFreeMdl(QueryMdl); + } + if (OutputMdl) + { + if (OutputLocked) + MmUnlockPages(OutputMdl); + IoFreeMdl(OutputMdl); + } + return Status; +} + +NTSTATUS +TcpIpQueryKernelInformation( + _Inout_ PIRP Irp +) +{ + PIO_STACK_LOCATION IrpSp; + PTDI_REQUEST_KERNEL_QUERY_INFORMATION Query; + NTSTATUS Status; + + IrpSp = IoGetCurrentIrpStackLocation(Irp); + Query = (PTDI_REQUEST_KERNEL_QUERY_INFORMATION)&IrpSp->Parameters; + + /* See what we are queried */ + switch (Query->QueryType) + { + case TDI_QUERY_MAX_DATAGRAM_INFO: + { + PTDI_MAX_DATAGRAM_INFO MaxDatagramInfo; + + if (MmGetMdlByteCount(Irp->MdlAddress) < sizeof(*MaxDatagramInfo)) + { + DPRINT1("MDL buffer too small.\n"); + Status = STATUS_BUFFER_TOO_SMALL; + break; + } + + MaxDatagramInfo = MmGetSystemAddressForMdl(Irp->MdlAddress); + + MaxDatagramInfo->MaxDatagramSize = 0xFFFF; + + Status = STATUS_SUCCESS; + break; + } + default: + DPRINT1("Unknown query: 0x%08x.\n", Query->QueryType); + return STATUS_NOT_IMPLEMENTED; + } + + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + return Status; +} Propchange: branches/tcpip_revolution/drivers/network/tcpip/information.c ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/information.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/information.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/information.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/information.h (added) +++ branches/tcpip_revolution/drivers/network/tcpip/information.h [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,12 @@ + +#pragma once + +NTSTATUS +TcpIpQueryInformation( + _In_ PIRP Irp +); + +NTSTATUS +TcpIpQueryKernelInformation( + _In_ PIRP Irp +); Propchange: branches/tcpip_revolution/drivers/network/tcpip/information.h ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/information.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/information.h ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/interface.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/interface.c (added) +++ branches/tcpip_revolution/drivers/network/tcpip/interface.c [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,230 @@ +/* + * PROJECT: ReactOS tcpip.sys + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: drivers/network/tcpip/interface.c + * PURPOSE: tcpip.sys: ndis <-> lwip bridge implementation + */ + +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + +TCPIP_INTERFACE* LoopbackInterface; + +static +VOID +GetInterfaceOperStatus( + _In_ TCPIP_INTERFACE* Interface, + _Out_ ULONG* OperStatus) +{ + NDIS_STATUS Status; + NDIS_REQUEST Request; + NDIS_MEDIA_STATE MediaState; + + if (Interface->NdisContext == NULL) + { + /* This is the looback interface */ + *OperStatus = MIB_IF_OPER_STATUS_CONNECTED; + return; + } + + /* Get the connection status from NDIS */ + Request.RequestType = NdisRequestQueryInformation; + Request.DATA.QUERY_INFORMATION.Oid = OID_GEN_MEDIA_CONNECT_STATUS; + Request.DATA.QUERY_INFORMATION.InformationBuffer = &MediaState; + Request.DATA.QUERY_INFORMATION.InformationBufferLength = sizeof(ULONG); + NdisRequest(&Status, Interface->NdisContext, &Request); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Could not get connection status from the NIC driver. Status 0x%08x\n", Status); + *OperStatus = MIB_IF_OPER_STATUS_NON_OPERATIONAL; + return; + } + + switch(MediaState) + { + case NdisMediaStateConnected: + *OperStatus = MIB_IF_OPER_STATUS_CONNECTED; + break; + case NdisMediaStateDisconnected: + *OperStatus = MIB_IF_OPER_STATUS_DISCONNECTED; + break; + default: + DPRINT1("Got unknown media state from NIC driver: %d.\n", MediaState); + *OperStatus = MIB_IF_OPER_STATUS_NON_OPERATIONAL; + } +} + +NTSTATUS +QueryInterfaceEntry( + _In_ TDIEntityID ID, + _In_ PVOID Context, + _Out_opt_ PVOID OutBuffer, + _Inout_ ULONG* BufferSize) +{ + TCPIP_INSTANCE* Instance; + TCPIP_INTERFACE* Interface; + NTSTATUS Status; + IFEntry* IfEntry = OutBuffer; + ULONG NeededSize; + + NT_ASSERT(ID.tei_entity == IF_ENTITY); + + Status = GetInstance(ID, &Instance); + if (!NT_SUCCESS(Status)) + return Status; + + Interface = CONTAINING_RECORD(Instance, TCPIP_INTERFACE, IfInstance); + + NeededSize = FIELD_OFFSET(IFEntry, if_descr) + + RTL_FIELD_SIZE(IFEntry, if_descr[0]) * (Interface->DeviceName.Length / 2 + 1); + + if (!OutBuffer) + { + *BufferSize = NeededSize; + return STATUS_SUCCESS; + } + + if (*BufferSize < NeededSize) + { + *BufferSize = NeededSize; + return STATUS_BUFFER_OVERFLOW; + } + + /* Fill in the data from our interface */ + IfEntry->if_index = Interface->lwip_netif.num; + IfEntry->if_type = (Interface->lwip_netif.flags & NETIF_FLAG_ETHARP) ? + IF_TYPE_ETHERNET_CSMACD : IF_TYPE_SOFTWARE_LOOPBACK; + IfEntry->if_mtu = Interface->lwip_netif.mtu; + IfEntry->if_speed = Interface->Speed; + IfEntry->if_physaddrlen = Interface->lwip_netif.hwaddr_len; + RtlCopyMemory(IfEntry->if_physaddr, Interface->lwip_netif.hwaddr, IfEntry->if_physaddrlen); + IfEntry->if_adminstatus = MIB_IF_ADMIN_STATUS_UP; + GetInterfaceOperStatus(Interface, &IfEntry->if_operstatus); + + // FIXME: Fill those + IfEntry->if_lastchange = 0; + IfEntry->if_inoctets = 0; + IfEntry->if_inucastpkts = 0; + IfEntry->if_innucastpkts = 0; + IfEntry->if_inerrors = 0; + IfEntry->if_inunknownprotos = 0; + IfEntry->if_outoctets = 0; + IfEntry->if_outucastpkts = 0; + IfEntry->if_outnucastpkts = 0; + IfEntry->if_outdiscards = 0; + IfEntry->if_outerrors = 0; + IfEntry->if_outqlen = 0; + + /* Set name */ + RtlUnicodeToMultiByteN( + (PCHAR)&IfEntry->if_descr[0], + *BufferSize - FIELD_OFFSET(IFEntry, if_descr), + &IfEntry->if_descrlen, + Interface->DeviceName.Buffer, + Interface->DeviceName.Length); + + *BufferSize = NeededSize; + + return STATUS_SUCCESS; +} + +NTSTATUS +QueryInterfaceAddrTable( + _In_ TDIEntityID ID, + _In_ PVOID Context, + _Out_opt_ PVOID OutBuffer, + _Inout_ ULONG* BufferSize) +{ + TCPIP_INSTANCE* Instance; + TCPIP_INTERFACE* Interface; + NTSTATUS Status; + IPAddrEntry* AddrEntry = OutBuffer; + + NT_ASSERT(ID.tei_entity == CL_NL_ENTITY); + + Status = GetInstance(ID, &Instance); + if (!NT_SUCCESS(Status)) + return Status; + + Interface = CONTAINING_RECORD(Instance, TCPIP_INTERFACE, ClNlInstance); + + // FIXME: return more than 'one' address + if (!OutBuffer) + { + *BufferSize = sizeof(IPAddrEntry); + return STATUS_SUCCESS; + } + + if (*BufferSize < sizeof(IPAddrEntry)) + { + *BufferSize = sizeof(IPAddrEntry); + return STATUS_BUFFER_OVERFLOW; + } + + AddrEntry->iae_addr = Interface->lwip_netif.ip_addr.addr; + AddrEntry->iae_index = Interface->lwip_netif.num; + AddrEntry->iae_mask = Interface->lwip_netif.netmask.addr; + _BitScanReverse(&AddrEntry->iae_bcastaddr, AddrEntry->iae_addr | ~AddrEntry->iae_mask); + /* FIXME: set those */ + AddrEntry->iae_reasmsize = 0; + AddrEntry->iae_context = 0; + AddrEntry->iae_pad = 0; + + return STATUS_SUCCESS; +} + +/* callback provided to lwip for initializing the loopback interface */ +static +err_t +lwip_netif_loopback_init(struct netif *netif) +{ + NETIF_INIT_SNMP(netif, snmp_ifType_softwareLoopback, 0); + + netif->name[0] = 'l'; + netif->name[1] = 'o'; + netif->output = netif_loop_output; + return ERR_OK; +} + +NTSTATUS +TcpIpCreateLoopbackInterface(void) +{ + err_t lwip_error; + struct ip_addr IpAddr, SubnetMask, GatewayAddr; + + LoopbackInterface = ExAllocatePoolWithTag(NonPagedPool, sizeof(*LoopbackInterface), TAG_INTERFACE); + if (!LoopbackInterface) + return STATUS_INSUFFICIENT_RESOURCES; + RtlZeroMemory(LoopbackInterface, sizeof(*LoopbackInterface)); + + /* Add it to lwip stack */ + IP4_ADDR(&GatewayAddr, 127,0,0,1); + IP4_ADDR(&IpAddr, 127,0,0,1); + IP4_ADDR(&SubnetMask, 255,0,0,0); + lwip_error = netifapi_netif_add( + &LoopbackInterface->lwip_netif, + &IpAddr, + &SubnetMask, + &GatewayAddr, + LoopbackInterface, + lwip_netif_loopback_init, + tcpip_input); + if (lwip_error != ERR_OK) + { + ExFreePoolWithTag(LoopbackInterface, TAG_INTERFACE); + return STATUS_INSUFFICIENT_RESOURCES; + } + + netifapi_netif_set_up(&LoopbackInterface->lwip_netif); + + /* Add this interface into the entities DB */ + InsertEntityInstance(CL_NL_ENTITY, &LoopbackInterface->ClNlInstance); + InsertEntityInstance(IF_ENTITY, &LoopbackInterface->IfInstance); + InsertEntityInstance(AT_ENTITY, &LoopbackInterface->AtInstance); + + RtlInitUnicodeString(&LoopbackInterface->DeviceName, L"Loopback"); + + return STATUS_SUCCESS; +} Propchange: branches/tcpip_revolution/drivers/network/tcpip/interface.c ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/interface.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/interface.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/interface.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/interface.h (added) +++ branches/tcpip_revolution/drivers/network/tcpip/interface.h [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,35 @@ + +#pragma once + +#define TAG_INTERFACE 'fIpI' + +typedef struct +{ + struct netif lwip_netif; + TCPIP_INSTANCE IfInstance; + TCPIP_INSTANCE AtInstance; + TCPIP_INSTANCE ClNlInstance; + UNICODE_STRING DeviceName; + NDIS_HANDLE NdisContext; + UINT MediumIndex; + ULONG Speed; +} TCPIP_INTERFACE; + +extern TCPIP_INTERFACE* LoopbackInterface; + +NTSTATUS +TcpIpCreateLoopbackInterface(void); + +NTSTATUS +QueryInterfaceEntry( + _In_ TDIEntityID ID, + _In_ PVOID Context, + _Out_opt_ PVOID OutBuffer, + _Inout_ ULONG* BufferSize); + +NTSTATUS +QueryInterfaceAddrTable( + _In_ TDIEntityID ID, + _In_ PVOID Context, + _Out_opt_ PVOID OutBuffer, + _Inout_ ULONG* BufferSize); Propchange: branches/tcpip_revolution/drivers/network/tcpip/interface.h ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/interface.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/interface.h ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/main.c (added) +++ branches/tcpip_revolution/drivers/network/tcpip/main.c [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,505 @@ +/* + * PROJECT: ReactOS tcpip.sys + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: drivers/network/tcpip/main.c + * PURPOSE: tcpip.sys driver entry + */ + +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + +/* DriverEntry, DriverUnload and dispatch routines declaration */ +DRIVER_INITIALIZE DriverEntry; +static DRIVER_UNLOAD TcpIpUnload; +static DRIVER_DISPATCH TcpIpCreate; +static DRIVER_DISPATCH TcpIpClose; +static DRIVER_DISPATCH TcpIpDispatchInternal; +static DRIVER_DISPATCH TcpIpDispatch; +#ifdef ALLOC_PRAGMA +#pragma alloc_text(INIT, DriverEntry) +#pragma alloc_text(PAGE, TcpIpUnload) +#pragma alloc_text(PAGE, TcpIpCreate) +#pragma alloc_text(PAGE, TcpIpClose) +#pragma alloc_text(PAGE, TcpIpDispatchInternal) +#pragma alloc_text(PAGE, TcpIpDispatch) +#endif + +/* Our device objects. TCP, UPD, IP, and RAW */ +PDEVICE_OBJECT TcpDeviceObject = NULL; +PDEVICE_OBJECT UdpDeviceObject = NULL; +PDEVICE_OBJECT IpDeviceObject = NULL; +PDEVICE_OBJECT RawIpDeviceObject = NULL; + +/* And the corresponding device names */ +#define DD_TCP_DEVICE_NAME L"\\Device\\Tcp" +#define DD_UDP_DEVICE_NAME L"\\Device\\Udp" +#define DD_IP_DEVICE_NAME L"\\Device\\Ip" +#define DD_RAWIP_DEVICE_NAME L"\\Device\\RawIp" + +/* This is a small utility which get the IPPROTO_* constant from the device object this driver was passed */ +static +IPPROTO +ProtocolFromIrp( + _In_ PDEVICE_OBJECT DeviceObject, + _In_ PIO_STACK_LOCATION IrpSp) +{ + UNICODE_STRING ProtocolName; + PWCHAR Name; + ULONG Value; + NTSTATUS Status; + + if (DeviceObject == TcpDeviceObject) + return IPPROTO_TCP; + if (DeviceObject == UdpDeviceObject) + return IPPROTO_UDP; + if (DeviceObject == IpDeviceObject) + return IPPROTO_RAW; + + /* Get it from the IRP file object */ + Name = IrpSp->FileObject->FileName.Buffer; + + if (*Name++ != L'\\') + { + DPRINT1("Could not deduce protocol from file name %wZ.\n", &IrpSp->FileObject->FileName); + return (IPPROTO)-1; + } + + RtlInitUnicodeString(&ProtocolName, Name); + Status = RtlUnicodeStringToInteger(&ProtocolName, 10, &Value); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Could not deduce protocol from file name %wZ.\n", &IrpSp->FileObject->FileName); + return (IPPROTO)-1; + } + + if (Value >= IPPROTO_RESERVED_MAX) + { + DPRINT1("Could not deduce protocol from file name %wZ.\n", &IrpSp->FileObject->FileName); + return (IPPROTO)-1; + } + + return (IPPROTO)Value; +} + +NTSTATUS +NTAPI +DriverEntry( + _In_ struct _DRIVER_OBJECT *DriverObject, + _In_ PUNICODE_STRING RegistryPath +) +{ + UNICODE_STRING IpDeviceName = RTL_CONSTANT_STRING(DD_IP_DEVICE_NAME); + UNICODE_STRING RawIpDeviceName = RTL_CONSTANT_STRING(DD_RAWIP_DEVICE_NAME); + UNICODE_STRING UdpDeviceName = RTL_CONSTANT_STRING(DD_UDP_DEVICE_NAME); + UNICODE_STRING TcpDeviceName = RTL_CONSTANT_STRING(DD_TCP_DEVICE_NAME); + NTSTATUS Status; + + /* Initialize the lwip library */ + tcpip_init(NULL, NULL); + + /* Create the device objects */ + Status = IoCreateDevice( + DriverObject, + 0, + &IpDeviceName, + FILE_DEVICE_NETWORK, + 0, + FALSE, + &IpDeviceObject); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Could not create device object. Status: 0x%08x\n", Status); + goto Failure; + } + + Status = IoCreateDevice( + DriverObject, + 0, + &UdpDeviceName, + FILE_DEVICE_NETWORK, + 0, + FALSE, + &UdpDeviceObject); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Could not create device object. Status: 0x%08x\n", Status); + goto Failure; + } + + Status = IoCreateDevice( + DriverObject, + 0, + &TcpDeviceName, + FILE_DEVICE_NETWORK, + 0, + FALSE, + &TcpDeviceObject); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Could not create device object. Status: 0x%08x\n", Status); + goto Failure; + } + + Status = IoCreateDevice( + DriverObject, + 0, + &RawIpDeviceName, + FILE_DEVICE_NETWORK, + 0, + FALSE, + &RawIpDeviceObject); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Could not create device object. Status: 0x%08x\n", Status); + goto Failure; + } + + /* Use direct I/O with this devices */ + IpDeviceObject->Flags |= DO_DIRECT_IO; + RawIpDeviceObject->Flags |= DO_DIRECT_IO; + UdpDeviceObject->Flags |= DO_DIRECT_IO; + TcpDeviceObject->Flags |= DO_DIRECT_IO; + + /* Set driver object entry points */ + DriverObject->MajorFunction[IRP_MJ_CREATE] = TcpIpCreate; + DriverObject->MajorFunction[IRP_MJ_CLOSE] = TcpIpClose; + DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = TcpIpDispatchInternal; + DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = TcpIpDispatch; + DriverObject->DriverUnload = TcpIpUnload; + + /* Initialize various parts of the driver */ + TcpIpInitializeAddresses(); + TcpIpInitializeTcp(); + TcpIpInitializeEntities(); + Status = TcpIpRegisterNdisProtocol(); + if (!NT_SUCCESS(Status)) + goto Failure; + + /* Create the loopback interface */ + Status = TcpIpCreateLoopbackInterface(); + if (!NT_SUCCESS(Status)) + goto Failure; + + return STATUS_SUCCESS; + +Failure: + TcpIpUnregisterNdisProtocol(); + + if (IpDeviceObject) + IoDeleteDevice(IpDeviceObject); + if (TcpDeviceObject) + IoDeleteDevice(TcpDeviceObject); + if (UdpDeviceObject) + IoDeleteDevice(UdpDeviceObject); + if (RawIpDeviceObject) + IoDeleteDevice(RawIpDeviceObject); + + return Status; +} + +static +NTSTATUS +NTAPI +TcpIpCreate( + _Inout_ struct _DEVICE_OBJECT *DeviceObject, + _Inout_ struct _IRP *Irp +) +{ + NTSTATUS Status; + PFILE_FULL_EA_INFORMATION FileInfo; + IPPROTO Protocol; + PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); + + /* Grab the info describing the file */ + FileInfo = Irp->AssociatedIrp.SystemBuffer; + + if (!FileInfo) + { + /* Caller just wants a control channel. We don't need any structure for this kind of "file" */ + IrpSp->FileObject->FsContext = NULL; + IrpSp->FileObject->FsContext2 = (PVOID)TDI_CONTROL_CHANNEL_FILE; + Status = STATUS_SUCCESS; + goto Quickie; + } + + /* Validate it */ + switch (FileInfo->EaNameLength) + { + case TDI_TRANSPORT_ADDRESS_LENGTH: + { + PTA_IP_ADDRESS Address; + + if (strncmp(&FileInfo->EaName[0], TdiTransportAddress, TDI_TRANSPORT_ADDRESS_LENGTH) != 0) + { + DPRINT1("TCPIP: Should maybe open file %*s.\n", FileInfo->EaNameLength, &FileInfo->EaName[0]); + Status = STATUS_INVALID_PARAMETER; + goto Quickie; + } + /* Get the address info right after the file name info */ + Address = (PTA_IP_ADDRESS)(&FileInfo->EaName[FileInfo->EaNameLength + 1]); + + /* Validate it */ + if ((FileInfo->EaValueLength < sizeof(*Address)) || + (Address->TAAddressCount != 1) || + (Address->Address[0].AddressLength < TDI_ADDRESS_LENGTH_IP) || + (Address->Address[0].AddressType != TDI_ADDRESS_TYPE_IP)) + { + Status = STATUS_INVALID_PARAMETER; + goto Quickie; + } + + /* Get the protocol this address will be created for. */ + Protocol = ProtocolFromIrp(DeviceObject, IrpSp); + if (Protocol == (IPPROTO)-1) + { + Status = STATUS_INVALID_PARAMETER; + goto Quickie; + } + + /* All good. */ + Status = TcpIpCreateAddress(Irp, &Address->Address[0].Address[0], Protocol); + break; + } + + case TDI_CONNECTION_CONTEXT_LENGTH: + if (strncmp(&FileInfo->EaName[0], TdiConnectionContext, TDI_CONNECTION_CONTEXT_LENGTH) != 0) + { + DPRINT1("TCPIP: Should maybe open file %*s.\n", FileInfo->EaNameLength, &FileInfo->EaName[0]); + return STATUS_INVALID_PARAMETER; + } + DPRINT1("Should create a connection!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + default: + DPRINT1("TCPIP: Should open file %*s.\n", FileInfo->EaNameLength, &FileInfo->EaName[0]); + Status = STATUS_INVALID_PARAMETER; + } + +Quickie: + Irp->IoStatus.Status = Status; + if (Status == STATUS_PENDING) + { + IoMarkIrpPending(Irp); + } + else + { + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + } + + return Status; +} + +static +NTSTATUS +NTAPI +TcpIpClose( + _Inout_ struct _DEVICE_OBJECT *DeviceObject, + _Inout_ struct _IRP *Irp +) +{ + PIO_STACK_LOCATION IrpSp; + NTSTATUS Status; + ULONG_PTR FileType; + + IrpSp = IoGetCurrentIrpStackLocation(Irp); + + FileType = (ULONG_PTR)IrpSp->FileObject->FsContext2; + + switch (FileType) + { + case TDI_TRANSPORT_ADDRESS_FILE: + if (!IrpSp->FileObject->FsContext) + { + DPRINT1("TCPIP: Got a close request without a file to close!\n"); + Status = STATUS_INVALID_PARAMETER; + goto Quickie; + } + Status = TcpIpCloseAddress(IrpSp->FileObject->FsContext); + break; + case TDI_CONTROL_CHANNEL_FILE: + /* We didn't allocate anything for this. */ + Status = STATUS_SUCCESS; + break; + default: + DPRINT1("TCPIP: Should close file %Iu.\n", FileType); + Status = STATUS_INVALID_PARAMETER; + break; + } + +Quickie: + Irp->IoStatus.Status = Status; + + return Irp->IoStatus.Status; +} + +static +NTSTATUS +NTAPI +TcpIpDispatchInternal( + _Inout_ struct _DEVICE_OBJECT *DeviceObject, + _Inout_ struct _IRP *Irp +) +{ + NTSTATUS Status; + PIO_STACK_LOCATION IrpSp; + + IrpSp = IoGetCurrentIrpStackLocation(Irp); + + switch (IrpSp->MinorFunction) + { + case TDI_RECEIVE: + DPRINT1("TCPIP: TDI_RECEIVE!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case TDI_RECEIVE_DATAGRAM: + return TcpIpReceiveDatagram(Irp); + + case TDI_SEND: + DPRINT1("TCPIP: TDI_SEND!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case TDI_SEND_DATAGRAM: + return TcpIpSendDatagram(Irp); + + case TDI_ACCEPT: + DPRINT1("TCPIP: TDI_ACCEPT!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case TDI_LISTEN: + DPRINT1("TCPIP: TDI_LISTEN!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case TDI_CONNECT: + DPRINT1("TCPIP: TDI_CONNECT!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case TDI_DISCONNECT: + DPRINT1("TCPIP: TDI_DISCONNECT!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case TDI_ASSOCIATE_ADDRESS: + DPRINT1("TCPIP: TDI_ASSOCIATE_ADDRESS!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case TDI_DISASSOCIATE_ADDRESS: + DPRINT1("TCPIP: TDI_DISASSOCIATE_ADDRESS!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case TDI_QUERY_INFORMATION: + return TcpIpQueryKernelInformation(Irp); + + case TDI_SET_INFORMATION: + DPRINT1("TCPIP: TDI_SET_INFORMATION!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case TDI_SET_EVENT_HANDLER: + DPRINT1("TCPIP: TDI_SET_EVENT_HANDLER!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case TDI_ACTION: + DPRINT1("TDI_ACTION!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + /* An unsupported IOCTL code was submitted */ + default: + DPRINT1("TCPIP: Unknown internal IOCTL: 0x%x.\n", IrpSp->MinorFunction); + Status = STATUS_NOT_IMPLEMENTED; + } + + Irp->IoStatus.Status = Status; + if (Status == STATUS_PENDING) + { + IoMarkIrpPending(Irp); + } + else + { + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + } + + return Status; +} + +static +NTSTATUS +NTAPI +TcpIpDispatch( + _Inout_ struct _DEVICE_OBJECT *DeviceObject, + _Inout_ struct _IRP *Irp +) +{ + NTSTATUS Status; + PIO_STACK_LOCATION IrpSp; + + IrpSp = IoGetCurrentIrpStackLocation(Irp); + + Irp->IoStatus.Information = 0; + + switch (IrpSp->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_TCP_QUERY_INFORMATION_EX: + Status = TcpIpQueryInformation(Irp); + break; + + case IOCTL_TCP_SET_INFORMATION_EX: + DPRINT1("TCPIP: Should handle IOCTL_TCP_SET_INFORMATION_EX.\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case IOCTL_SET_IP_ADDRESS: + DPRINT1("TCPIP: Should handle IOCTL_SET_IP_ADDRESS.\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case IOCTL_DELETE_IP_ADDRESS: + DPRINT1("TCPIP: Should handle IOCTL_DELETE_IP_ADDRESS.\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + default: + DPRINT1("TCPIP: Unknown IOCTL 0x%#x\n", IrpSp->Parameters.DeviceIoControl.IoControlCode); + Status = STATUS_NOT_IMPLEMENTED; + break; + } + + DPRINT("TCPIP dispatched with status 0x%08x.\n", Status); + + Irp->IoStatus.Status = Status; + if (Status == STATUS_PENDING) + { + IoMarkIrpPending(Irp); + } + else + { + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + } + + return Status; +} + +static +VOID +NTAPI +TcpIpUnload( + _In_ struct _DRIVER_OBJECT *DriverObject +) +{ + IoDeleteDevice(IpDeviceObject); + IoDeleteDevice(RawIpDeviceObject); + IoDeleteDevice(UdpDeviceObject); + IoDeleteDevice(TcpDeviceObject); + TcpIpUnregisterNdisProtocol(); +} Propchange: branches/tcpip_revolution/drivers/network/tcpip/main.c ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/main.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/main.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.c (added) +++ branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.c [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,339 @@ +/* + * PROJECT: ReactOS tcpip.sys + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: drivers/network/tcpip/ndis_proto.c + * PURPOSE: tcpip.sys: ndis protocol bindings + */ + +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + +// FIXME: Maybe more in the future ? +static NDIS_MEDIUM NdisMediaArray[] = { NdisMedium802_3 }; + +/* The handle we got from NDIS for this protocol */ +static NDIS_HANDLE NdisHandle; + +/* Initializes the various values lwip will need */ +static +NDIS_STATUS +InitializeInterface( + _Inout_ TCPIP_INTERFACE* Interface) +{ + NDIS_STATUS Status; + NDIS_REQUEST Request; + UINT MTU; + NDIS_OID QueryAddrOid; + UINT PacketFilter; + + /* Add this interface into the entities DB */ + InsertEntityInstance(CL_NL_ENTITY, &Interface->ClNlInstance); + InsertEntityInstance(IF_ENTITY, &Interface->IfInstance); + InsertEntityInstance(AT_ENTITY, &Interface->AtInstance); + + /* Get the MTU from the NIC */ + Request.RequestType = NdisRequestQueryInformation; + Request.DATA.QUERY_INFORMATION.Oid = OID_GEN_MAXIMUM_FRAME_SIZE; + Request.DATA.QUERY_INFORMATION.InformationBuffer = &MTU; + Request.DATA.QUERY_INFORMATION.InformationBufferLength = sizeof(UINT); + NdisRequest(&Status, Interface->NdisContext, &Request); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Could not get MTU from the NIC driver!\n"); + return Status; + } + Interface->lwip_netif.mtu = MTU; + + /* Setup media type related data. */ + switch (NdisMediaArray[Interface->MediumIndex]) + { + case NdisMedium802_3: + Interface->lwip_netif.hwaddr_len = ETHARP_HWADDR_LEN; + QueryAddrOid = OID_802_3_CURRENT_ADDRESS; + PacketFilter = NDIS_PACKET_TYPE_BROADCAST | NDIS_PACKET_TYPE_DIRECTED | NDIS_PACKET_TYPE_MULTICAST; + break; + default: + /* This is currently impossible */ + DPRINT1("Unknown medium!\n"); + NT_ASSERT(FALSE); + return NDIS_STATUS_UNSUPPORTED_MEDIA; + } + + /* Get the address */ + Request.RequestType = NdisRequestQueryInformation; + Request.DATA.QUERY_INFORMATION.Oid = QueryAddrOid; + Request.DATA.QUERY_INFORMATION.InformationBuffer = &Interface->lwip_netif.hwaddr[0]; + Request.DATA.QUERY_INFORMATION.InformationBufferLength = NETIF_MAX_HWADDR_LEN; + NdisRequest(&Status, Interface->NdisContext, &Request); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Could not get HW address from the NIC driver!\n"); + return Status; + } + + /* Get the link speed */ + Request.RequestType = NdisRequestQueryInformation; + Request.DATA.QUERY_INFORMATION.Oid = OID_GEN_LINK_SPEED; + Request.DATA.QUERY_INFORMATION.InformationBuffer = &Interface->Speed; + Request.DATA.QUERY_INFORMATION.InformationBufferLength = sizeof(ULONG); + NdisRequest(&Status, Interface->NdisContext, &Request); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Could not get link speed NIC driver!\n"); + /* Good old 10Mb/s as default */ + Interface->Speed = 100000; + } + /* NDIS drivers give it in 100bps unit */ + Interface->Speed *= 100; + + /* Set the packet filter */ + Request.RequestType = NdisRequestSetInformation; + Request.DATA.SET_INFORMATION.Oid = OID_GEN_CURRENT_PACKET_FILTER; + Request.DATA.SET_INFORMATION.InformationBuffer = &PacketFilter; + Request.DATA.SET_INFORMATION.InformationBufferLength = sizeof(PacketFilter); + NdisRequest(&Status, Interface->NdisContext, &Request); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Could not get HW address from the NIC driver!\n"); + return Status; + } + + return NDIS_STATUS_SUCCESS; +} + +/* The various callbacks we will give to NDIS */ +static +VOID +NTAPI +ProtocolOpenAdapterComplete( + _In_ NDIS_HANDLE ProtocolBindingContext, + _In_ NDIS_STATUS Status, + _In_ NDIS_STATUS OpenErrorStatus) +{ + TCPIP_INTERFACE* Interface = (TCPIP_INTERFACE*)ProtocolBindingContext; + + if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(Interface, TAG_INTERFACE); + return; + } + + Status = InitializeInterface(Interface); + if (!NT_SUCCESS(Status)) + { + /* Unbind the interface and that's all */ + NdisCloseAdapter(&Status, Interface->NdisContext); + } +} + +static +VOID +NTAPI +ProtocolCloseAdapterComplete( + _In_ NDIS_HANDLE ProtocolBindingContext, + _In_ NDIS_STATUS Status) +{ + UNIMPLEMENTED +} + +static +VOID +NTAPI +ProtocolResetComplete( + _In_ NDIS_HANDLE ProtocolBindingContext, + _In_ NDIS_STATUS Status) +{ + UNIMPLEMENTED +} + +static +VOID +NTAPI +ProtocolRequestComplete( + _In_ NDIS_HANDLE ProtocolBindingContext, + _In_ PNDIS_REQUEST NdisRequest, + _In_ NDIS_STATUS Status) +{ + UNIMPLEMENTED +} + +static +VOID +NTAPI +ProtocolReceiveComplete( + _In_ NDIS_HANDLE ProtocolBindingContext) +{ + UNIMPLEMENTED +} + +static +VOID +NTAPI +ProtocolStatusComplete( + _In_ NDIS_HANDLE ProtocolBindingContext) +{ + UNIMPLEMENTED +} + +/* bridge between NDIS and lwip: send data to the adapter */ +static +err_t +lwip_netif_linkoutput( + struct netif *netif, + struct pbuf *p) +{ + UNIMPLEMENTED + return ERR_OK; +} + +/* lwip interface initialisation function */ +static +err_t +lwip_netif_init( + struct netif* lwip_netif) +{ + /* Set output callbacks */ + lwip_netif->output = etharp_output; + lwip_netif->linkoutput = lwip_netif_linkoutput; + + /* We use ARP and broadcasting */ + lwip_netif->flags |= NETIF_FLAG_ETHARP | NETIF_FLAG_BROADCAST; + + /* Let's say we're ethernet */ + lwip_netif->name[0] = 'e'; + lwip_netif->name[1] = 'n'; + + return ERR_OK; +} + +static +VOID +NTAPI +ProtocolBindAdapter( + _Out_ PNDIS_STATUS Status, + _In_ NDIS_HANDLE BindContext, + _In_ PNDIS_STRING DeviceName, + _In_ PVOID SystemSpecific1, + _In_ PVOID SystemSpecific2) +{ + TCPIP_INTERFACE* Interface; + NDIS_STATUS OpenErrorStatus; + UNICODE_STRING RealDeviceName; + struct ip_addr IpAddr, SubnetMask, GatewayAddr; + err_t lwip_error; + + /* The device name comes in the \Device\AdapterName form */ + RealDeviceName.Buffer = DeviceName->Buffer + 8; + RealDeviceName.Length = DeviceName->Length - (8 * sizeof(WCHAR)); + RealDeviceName.MaximumLength = DeviceName->MaximumLength - (8 * sizeof(WCHAR)); + + /* Allocate an interface for this NIC */ + Interface = ExAllocatePoolWithTag(PagedPool, + sizeof(*Interface) + RealDeviceName.MaximumLength, + TAG_INTERFACE); + if (!Interface) + { + DPRINT1("Could not allocate an interface structure!\n"); + *Status = NDIS_STATUS_RESOURCES; + return; + } + + /* Copy the device name */ + RtlInitEmptyUnicodeString(&Interface->DeviceName, (PWSTR)(Interface + 1), RealDeviceName.MaximumLength); + RtlCopyUnicodeString(&Interface->DeviceName, &RealDeviceName); + + /* Add the interface to the lwip list */ + ip_addr_set_zero(&IpAddr); + ip_addr_set_zero(&SubnetMask); + ip_addr_set_zero(&GatewayAddr); + lwip_error = netifapi_netif_add( + &Interface->lwip_netif, + &IpAddr, + &SubnetMask, + &GatewayAddr, + Interface, + lwip_netif_init, + ethernet_input); + if (lwip_error != ERR_OK) + { + DPRINT1("netifapi_netif_add failed with error %d.\n", lwip_error); + *Status = NDIS_STATUS_RESOURCES; + return; + } + + /* Get a adapter handle from NDIS */ + NdisOpenAdapter( + Status, + &OpenErrorStatus, + &Interface->NdisContext, + &Interface->MediumIndex, + NdisMediaArray, + sizeof(NdisMediaArray) / sizeof(NdisMediaArray[0]), + NdisHandle, + Interface, + DeviceName, + 0, + NULL); + if (*Status == NDIS_STATUS_PENDING) + { + /* Silently return, as the binding will be finished in the async call */ + return; + } + + if (*Status != NDIS_STATUS_SUCCESS) + { + DPRINT1("NdisOpenAdapter failed with status 0x%08x.\n", *Status); + ExFreePoolWithTag(Interface, TAG_INTERFACE); + return; + } + + /* Finish the bind request in sync */ + *Status = InitializeInterface(Interface); +} + +static +VOID +NTAPI +ProtocolUnbindAdapter( + _Out_ PNDIS_STATUS Status, + _In_ NDIS_HANDLE ProtocolBindingContext, + _In_ NDIS_HANDLE UnbindContext) +{ + UNIMPLEMENTED +} + +NTSTATUS +TcpIpRegisterNdisProtocol(void) +{ + NDIS_STATUS Status; + NDIS_PROTOCOL_CHARACTERISTICS ProtocolCharacteristics; + + /* Simply fill in the structure and pass it to the NDIS driver. */ + RtlZeroMemory(&ProtocolCharacteristics, sizeof(ProtocolCharacteristics)); + ProtocolCharacteristics.MajorNdisVersion = NDIS_PROTOCOL_MAJOR_VERSION; + ProtocolCharacteristics.MinorNdisVersion = NDIS_PROTOCOL_MINOR_VERSION; + ProtocolCharacteristics.Reserved = 0; + ProtocolCharacteristics.OpenAdapterCompleteHandler = ProtocolOpenAdapterComplete; + ProtocolCharacteristics.CloseAdapterCompleteHandler = ProtocolCloseAdapterComplete; + ProtocolCharacteristics.ResetCompleteHandler = ProtocolResetComplete; + ProtocolCharacteristics.RequestCompleteHandler = ProtocolRequestComplete; + ProtocolCharacteristics.ReceiveCompleteHandler = ProtocolReceiveComplete; + ProtocolCharacteristics.StatusCompleteHandler = ProtocolStatusComplete; + ProtocolCharacteristics.BindAdapterHandler = ProtocolBindAdapter; + ProtocolCharacteristics.UnbindAdapterHandler = ProtocolUnbindAdapter; + RtlInitUnicodeString(&ProtocolCharacteristics.Name, L"TcpIp"); + + NdisRegisterProtocol(&Status, &NdisHandle, &ProtocolCharacteristics, sizeof(ProtocolCharacteristics)); + + return Status; +} + +void +TcpIpUnregisterNdisProtocol(void) +{ + NDIS_STATUS Status; + + NdisDeregisterProtocol(&Status, NdisHandle); +} Propchange: branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.c ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.h (added) +++ branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.h [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,8 @@ + +#pragma once + +NTSTATUS +TcpIpRegisterNdisProtocol(void); + +void +TcpIpUnregisterNdisProtocol(void); Propchange: branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.h ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/ndis_lwip.h ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/precomp.h (added) +++ branches/tcpip_revolution/drivers/network/tcpip/precomp.h [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,34 @@ + +#ifndef __TCPIP_PRECOMP_H__ +#define __TCPIP_PRECOMP_H__ + +#include <ntifs.h> +#include <windef.h> +#include <tdi.h> +#include <tdiinfo.h> +#include <tdikrnl.h> +#include <tcpioctl.h> +#include <ndis.h> +#include <ipifcons.h> + +typedef unsigned short u_short; +#include <ws2def.h> + +#include <rtlfuncs.h> + +#include <pseh/pseh2.h> + +#include <lwip/tcpip.h> +#include <lwip/snmp.h> +#include <lwip/raw.h> +#include <lwip/udp.h> +#include <netif/etharp.h> + +#include "entities.h" +#include "address.h" +#include "information.h" +#include "interface.h" +#include "ndis_lwip.h" +#include "tcp.h" + +#endif /* __TCPIP_PRECOMP_H__ */ Propchange: branches/tcpip_revolution/drivers/network/tcpip/precomp.h ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/precomp.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/precomp.h ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/stubs.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/stubs.c (added) +++ branches/tcpip_revolution/drivers/network/tcpip/stubs.c [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,42 @@ +/* + * PROJECT: ReactOS tcpip.sys + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: drivers/network/tcpip/main.c + * PURPOSE: tcpip.sys unimplemented functions + */ + +#include "precomp.h" + +#define NDEBUG +#include <debug.h> + +VOID +NTAPI +IPAddInterface( + ULONG Unknown0, + ULONG Unknown1, + ULONG Unknown2, + ULONG Unknown3, + ULONG Unknown4) +{ + UNIMPLEMENTED +} + + +VOID +NTAPI +IPDelInterface( + ULONG Unknown0) +{ + UNIMPLEMENTED +} + + +VOID +NTAPI +LookupRoute( + ULONG Unknown0, + ULONG Unknown1) +{ + UNIMPLEMENTED +} Propchange: branches/tcpip_revolution/drivers/network/tcpip/stubs.c ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/stubs.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/stubs.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/tcp.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/tcp.c (added) +++ branches/tcpip_revolution/drivers/network/tcpip/tcp.c [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,64 @@ +/* + * PROJECT: ReactOS tcpip.sys + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: drivers/network/tcpip/main.c + * PURPOSE: tcpip.sys TCP functionality + */ + +#include "precomp.h" + +#include <intsafe.h> + +#define NDEBUG +#include <debug.h> + +static KSPIN_LOCK PortBitmapSpinlock; +static RTL_BITMAP PortBitmap; +static ULONG PortBitmapBuffer[(USHORT_MAX + 1) / 32]; +static USHORT PortNumberHint = 1; + +void +TcpIpInitializeTcp(void) +{ + /* Initialize the port stuff */ + KeInitializeSpinLock(&PortBitmapSpinlock); + RtlInitializeBitMap(&PortBitmap, PortBitmapBuffer, USHORT_MAX + 1); + RtlClearAllBits(&PortBitmap); + /* Reserve the port 0 */ + RtlSetBit(&PortBitmap, 0); +} + +BOOLEAN +AllocateTcpPort( + _Inout_ USHORT* PortNumber, + _In_ BOOLEAN Shared) +{ + KIRQL OldIrql; + ULONG_PTR Bit; + + KeAcquireSpinLock(&PortBitmapSpinlock, &OldIrql); + + if (*PortNumber) + { + if (RtlCheckBit(&PortBitmap, *PortNumber)) + { + if (!Shared) + *PortNumber = 0; + KeReleaseSpinLock(&PortBitmapSpinlock, OldIrql); + return TRUE; + } + + RtlSetBit(&PortBitmap, *PortNumber); + KeReleaseSpinLock(&PortBitmapSpinlock, OldIrql); + return FALSE; + } + + Bit = RtlFindClearBitsAndSet(&PortBitmap, 1, PortNumberHint); + if (Bit == ULONG_PTR_MAX) + *PortNumber = 0; + else + *PortNumber = Bit; + PortNumberHint = *PortNumber; + return FALSE; +} + Propchange: branches/tcpip_revolution/drivers/network/tcpip/tcp.c ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/tcp.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/tcp.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/tcp.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/tcp.h (added) +++ branches/tcpip_revolution/drivers/network/tcpip/tcp.h [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,10 @@ + +#pragma once + +void +TcpIpInitializeTcp(void); + +BOOLEAN +AllocateTcpPort( + _Inout_ USHORT* PortNumber, + _In_ BOOLEAN Shared); Propchange: branches/tcpip_revolution/drivers/network/tcpip/tcp.h ------------------------------------------------------------------------------ charset = UTF-8 Propchange: branches/tcpip_revolution/drivers/network/tcpip/tcp.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/tcpip_revolution/drivers/network/tcpip/tcp.h ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: branches/tcpip_revolution/drivers/network/tcpip/tcpip.rc URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/tcpip.rc (added) +++ branches/tcpip_revolution/drivers/network/tcpip/tcpip.rc [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,5 @@ +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "TCP/IP protocol driver" +#define REACTOS_STR_INTERNAL_NAME "tcpip" +#define REACTOS_STR_ORIGINAL_FILENAME "tcpip.sys" +#include <reactos/version.rc> Propchange: branches/tcpip_revolution/drivers/network/tcpip/tcpip.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/tcpip_revolution/drivers/network/tcpip/tcpip.spec URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/tcpip.spec (added) +++ branches/tcpip_revolution/drivers/network/tcpip/tcpip.spec [iso-8859-1] Mon Nov 10 18:00:09 2014 @@ -0,0 +1,25 @@ +;FreeIprBuff +;GetIFAndLink +@ stdcall IPAddInterface(long long long long long) +;IPAllocBuff +@ stdcall IPDelInterface(long) +;IPDelayedNdisReEnumerateBindings +;IPDeregisterARP +;IPDisableSniffer +;IPEnableSniffer +;IPFreeBuff +;IPGetAddrType +;IPGetBestInterface +;IPGetInfo +;IPInjectPkt +;IPProxyNdisRequest +;IPRegisterARP +;IPRegisterProtocol +;IPSetIPSecStatus +;IPTransmit +@ stdcall LookupRoute(long long) +;LookupRouteInformation +;SendICMPErr +;SetIPSecPtr +;UnSetIPSecPtr +;UnSetIPSecSendPtr Propchange: branches/tcpip_revolution/drivers/network/tcpip/tcpip.spec ------------------------------------------------------------------------------ svn:eol-style = native
10 years, 1 month
1
0
0
0
[pschweitzer] 65361: [FASTFAT] - Store IO VPB in our VCB for later use - Prepare a spare VPB in our VCB for dismount swapout
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Mon Nov 10 17:42:51 2014 New Revision: 65361 URL:
http://svn.reactos.org/svn/reactos?rev=65361&view=rev
Log: [FASTFAT] - Store IO VPB in our VCB for later use - Prepare a spare VPB in our VCB for dismount swapout Modified: trunk/reactos/drivers/filesystems/fastfat/fsctl.c trunk/reactos/drivers/filesystems/fastfat/vfat.h Modified: trunk/reactos/drivers/filesystems/fastfat/fsctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] Mon Nov 10 17:42:51 2014 @@ -521,6 +521,14 @@ /* Initialize this resource early ... it's used in VfatCleanup */ ExInitializeResourceLite(&DeviceExt->DirResource); + DeviceExt->IoVPB = DeviceObject->Vpb; + DeviceExt->SpareVPB = ExAllocatePoolWithTag(NonPagedPool, sizeof(VPB), TAG_VFAT); + if (DeviceExt->SpareVPB == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto ByeBye; + } + DeviceExt->FATFileObject = IoCreateStreamFileObject(NULL, DeviceExt->StorageDevice); Fcb = vfatNewFCB(DeviceExt, &NameU); if (Fcb == NULL) @@ -622,6 +630,8 @@ /* Cleanup */ if (DeviceExt && DeviceExt->FATFileObject) ObDereferenceObject (DeviceExt->FATFileObject); + if (DeviceExt && DeviceExt->SpareVPB) + ExFreePoolWithTag(DeviceExt->SpareVPB, TAG_VFAT); if (Fcb) vfatDestroyFCB(Fcb); if (Ccb) Modified: trunk/reactos/drivers/filesystems/fastfat/vfat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] Mon Nov 10 17:42:51 2014 @@ -299,6 +299,10 @@ /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */ ULONG OpenHandleCount; + + /* VPBs for dismount */ + PVPB IoVPB; + PVPB SpareVPB; } DEVICE_EXTENSION, VCB, *PVCB; typedef struct
10 years, 1 month
1
0
0
0
[jgardou] 65360: [TCPIP] - Violently rip off the whole thing.
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 10 17:40:55 2014 New Revision: 65360 URL:
http://svn.reactos.org/svn/reactos?rev=65360&view=rev
Log: [TCPIP] - Violently rip off the whole thing. Removed: branches/tcpip_revolution/drivers/network/tcpip/CMakeLists.txt branches/tcpip_revolution/drivers/network/tcpip/DIRS branches/tcpip_revolution/drivers/network/tcpip/datalink/SOURCES branches/tcpip_revolution/drivers/network/tcpip/datalink/lan.c branches/tcpip_revolution/drivers/network/tcpip/include/address.h branches/tcpip_revolution/drivers/network/tcpip/include/arp.h branches/tcpip_revolution/drivers/network/tcpip/include/checksum.h branches/tcpip_revolution/drivers/network/tcpip/include/datagram.h branches/tcpip_revolution/drivers/network/tcpip/include/debug.h branches/tcpip_revolution/drivers/network/tcpip/include/dispatch.h branches/tcpip_revolution/drivers/network/tcpip/include/fileobjs.h branches/tcpip_revolution/drivers/network/tcpip/include/icmp.h branches/tcpip_revolution/drivers/network/tcpip/include/info.h branches/tcpip_revolution/drivers/network/tcpip/include/interface.h branches/tcpip_revolution/drivers/network/tcpip/include/ip.h branches/tcpip_revolution/drivers/network/tcpip/include/lan.h branches/tcpip_revolution/drivers/network/tcpip/include/linux.h branches/tcpip_revolution/drivers/network/tcpip/include/lock.h branches/tcpip_revolution/drivers/network/tcpip/include/loopback.h branches/tcpip_revolution/drivers/network/tcpip/include/neighbor.h branches/tcpip_revolution/drivers/network/tcpip/include/pool.h branches/tcpip_revolution/drivers/network/tcpip/include/ports.h branches/tcpip_revolution/drivers/network/tcpip/include/precomp.h branches/tcpip_revolution/drivers/network/tcpip/include/rawip.h branches/tcpip_revolution/drivers/network/tcpip/include/receive.h branches/tcpip_revolution/drivers/network/tcpip/include/route.h branches/tcpip_revolution/drivers/network/tcpip/include/router.h branches/tcpip_revolution/drivers/network/tcpip/include/routines.h branches/tcpip_revolution/drivers/network/tcpip/include/tags.h branches/tcpip_revolution/drivers/network/tcpip/include/tcp.h branches/tcpip_revolution/drivers/network/tcpip/include/tcpcore.h branches/tcpip_revolution/drivers/network/tcpip/include/tcpdef.h branches/tcpip_revolution/drivers/network/tcpip/include/tcpip.h branches/tcpip_revolution/drivers/network/tcpip/include/ticonsts.h branches/tcpip_revolution/drivers/network/tcpip/include/tilists.h branches/tcpip_revolution/drivers/network/tcpip/include/titypes.h branches/tcpip_revolution/drivers/network/tcpip/include/transmit.h branches/tcpip_revolution/drivers/network/tcpip/include/udp.h branches/tcpip_revolution/drivers/network/tcpip/include/wait.h branches/tcpip_revolution/drivers/network/tcpip/notes.txt branches/tcpip_revolution/drivers/network/tcpip/readme.txt branches/tcpip_revolution/drivers/network/tcpip/tcpip.rc branches/tcpip_revolution/drivers/network/tcpip/tcpip.spec branches/tcpip_revolution/drivers/network/tcpip/tcpip/SOURCES branches/tcpip_revolution/drivers/network/tcpip/tcpip/ainfo.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/buffer.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/cinfo.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/dispatch.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/fileobjs.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/iinfo.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/info.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/lock.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/main.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/mockbuffer.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/mocklock.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/mockpool.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/mockwait.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/ninfo.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/proto.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/resource.rc branches/tcpip_revolution/drivers/network/tcpip/tcpip/tcpip.def branches/tcpip_revolution/drivers/network/tcpip/tcpip/tinfo.c branches/tcpip_revolution/drivers/network/tcpip/tcpip/wait.c branches/tcpip_revolution/drivers/network/tcpip/tests/setup.c branches/tcpip_revolution/drivers/network/tcpip/tests/stubs.tst branches/tcpip_revolution/drivers/network/tcpip/tests/tests/ipreceive.c branches/tcpip_revolution/drivers/network/tcpip/tests/tests/tigetprotocolnumber.c [This mail would be too long, it was shortened to contain the URLs only.] Removed: branches/tcpip_revolution/drivers/network/tcpip/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/DIRS URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/datalink/SOURCES URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/datalink/lan.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/address.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/arp.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/checksum.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/datagram.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/debug.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/dispatch.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/fileobjs.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/icmp.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/info.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/interface.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/ip.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/lan.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/linux.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/lock.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/loopback.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/neighbor.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/pool.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/ports.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/rawip.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/receive.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/route.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/router.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/routines.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/tags.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/tcp.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/tcpcore.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/tcpdef.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/tcpip.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/ticonsts.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/tilists.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/titypes.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/transmit.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/udp.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/include/wait.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/notes.txt URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/readme.txt URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip.rc URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip.spec URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/SOURCES URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/ainfo.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/buffer.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/cinfo.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/dispatch.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/fileobjs.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/iinfo.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/info.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/lock.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/mockbuffer.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/mocklock.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/mockpool.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/mockwait.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/ninfo.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/proto.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/resource.rc URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/tcpip.def URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/tinfo.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tcpip/wait.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tests/setup.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tests/stubs.tst URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tests/tests/ipreceive.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
Removed: branches/tcpip_revolution/drivers/network/tcpip/tests/tests/tigetprotocolnumber.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
10 years, 1 month
1
0
0
0
[akhaldi] 65359: * Create a branch for the ongoing tcpip rev^H^H^H rewrite.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 10 17:23:07 2014 New Revision: 65359 URL:
http://svn.reactos.org/svn/reactos?rev=65359&view=rev
Log: * Create a branch for the ongoing tcpip rev^H^H^H rewrite. Added: branches/tcpip_revolution/ (props changed) - copied from r65358, trunk/reactos/ Propchange: branches/tcpip_revolution/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon Nov 10 17:23:07 2014 @@ -0,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: branches/tcpip_revolution/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: branches/tcpip_revolution/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: branches/tcpip_revolution/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Nov 10 17:23:07 2014 @@ -0,0 +1,14 @@ +*.iso +makefile.auto +makefile-*.auto +config-*.rbuild +obj-* +output-* +reactos +reactos.* +RosBE-Logs +*.sln +*.ncb +*.suo +versionreport.xml +config.rbuild Propchange: branches/tcpip_revolution/ ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Mon Nov 10 17:23:07 2014 @@ -0,0 +1,22 @@ +/branches/GSoC_2011/GSoC_Network:51548 +/branches/GSoC_2011/GSoC_TcpIpDriver:51550 +/branches/GSoC_2011/TcpIpDriver:51551-53074,53076-53119 +/branches/GSoC_Network:51545-51546 +/branches/cmake-bringup:50484,50693,50719,51544-52564 +/branches/condrv_restructure:63104-64101 +/branches/header-work:45691-47721 +/branches/kd++:58883-58973 +/branches/kernel-fun/reactos:62304,62353,62531-62532,62853,64152,64173-64174,65253 +/branches/ntvdm:59241-63176 +/branches/reactos-yarotows:45219-46371,46373-48025,48027-49273 +/branches/reactx/reactos:49994-49995 +/branches/ros-amd64-bringup:36852 +/branches/ros-amd64-bringup/reactos:34711-34712,34741,34743,34770,34780-34782,34803,34812,34839,34842,34864,34870,34874,34877,34908-34909,34917,34965,35323-35324,35347-35348,35361,35436,35509,35515,35588,35655,35683,35739,35746,35762,35771,35777,35781,35789,35805,35823,35827,35902,35904-35906,35942,35947-35949,35952-35953,35966,36011-36013,36172,36360,36380,36388-36389,36393,36397,36443,36445,36475,36502-36503,36505,36570,36614,36852,36898-36899,36930,36936,36949,36951,36958,36961,36964,36969,36972,36987-36988,36990,36992,37019,37322-37323,37333-37334,37434,37472,37475,37536,37820-37821,37868-37869,37873,37990-37991,38013-38014,38092,38100,38148-38151,38264-38265,38268,38355,39151,39333,39335,39345,39639,40120,40122-40123,40125,40127-40128,40155,40247,40324,40608,40753,40926-40928,40986-40987,40989,40991,40993,40995-40996,41000-41001,41027-41030,41044-41045,41047-41050,41052,41070,41082-41086,41097-41098,41101,41449,41479-41480,41483-41485,41499-41500,41502,41531,41536,41540,41546-41547,41549,43080,43426,43451,43454,43506,43566,43574,43598,43600-43602,43604-43605,43677,43682,43757,43775,43836,43838-43840,43852,43857-43858,43860,43905-43907,43952,43954,43965,43969,43979,43981,43992,44002,44036-44037,44039-44040,44044-44045,44053,44065,44095,44123,44143-44144,44205,44238,44257,44259,44294,44338-44339,44385,44389,44391,44426,44460,44467-44468,44470-44471,44499,44501,44503-44504,44506,44510-44512,44521,44523-44526,44530,44540,44601,44634,44639,44772,44818,45124,45126-45127,45430,46394,46404,46478,46511,46523-46524,46526,46534-46535,46537-46539,46589,46805,46868,47472,47846-47847,47878,47882 +/branches/ros-branch-0_3_15-lt2013:59059 +/branches/ros-csrss:57561-58762 +/branches/shell-experiments:64866,65001 +/branches/shell32_new-bringup:51893-53652,53661,53700 +/branches/tcp-rewrite-branch:48720,48840-48841,49424-49426,49454 +/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 +/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 +/branches/wlan-bringup:54809-54998 Propchange: branches/tcpip_revolution/ ------------------------------------------------------------------------------ tsvn:logminsize = 10
10 years, 1 month
1
0
0
0
[akhaldi] 65358: [NPPTOOLS] * Import from Wine 1.7.27. CORE-8789 #resolve #comment Imported in r65358. CORE-8540
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 10 16:41:42 2014 New Revision: 65358 URL:
http://svn.reactos.org/svn/reactos?rev=65358&view=rev
Log: [NPPTOOLS] * Import from Wine 1.7.27. CORE-8789 #resolve #comment Imported in r65358. CORE-8540 Added: trunk/reactos/dll/win32/npptools/ (with props) trunk/reactos/dll/win32/npptools/CMakeLists.txt (with props) trunk/reactos/dll/win32/npptools/main.c (with props) trunk/reactos/dll/win32/npptools/npptools.spec (with props) Modified: trunk/reactos/dll/win32/CMakeLists.txt trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/CMakeLists.txt?r…
============================================================================== --- trunk/reactos/dll/win32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/CMakeLists.txt [iso-8859-1] Mon Nov 10 16:41:42 2014 @@ -135,6 +135,7 @@ add_subdirectory(netid) add_subdirectory(netshell) add_subdirectory(newdev) +add_subdirectory(npptools) add_subdirectory(ntdsapi) add_subdirectory(ntlanman) add_subdirectory(ntmarta) Propchange: trunk/reactos/dll/win32/npptools/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon Nov 10 16:41:42 2014 @@ -0,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/dll/win32/npptools/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/dll/win32/npptools/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/dll/win32/npptools/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/dll/win32/npptools/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/npptools/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/npptools/CMakeLists.txt (added) +++ trunk/reactos/dll/win32/npptools/CMakeLists.txt [iso-8859-1] Mon Nov 10 16:41:42 2014 @@ -0,0 +1,13 @@ + +add_definitions(-D__WINESRC__) +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) +spec2def(npptools.dll npptools.spec) + +add_library(npptools SHARED + main.c + ${CMAKE_CURRENT_BINARY_DIR}/npptools_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/npptools.def) + +set_module_type(npptools win32dll) +add_importlibs(npptools msvcrt kernel32 ntdll) +add_cd_file(TARGET npptools DESTINATION reactos/system32 FOR all) Propchange: trunk/reactos/dll/win32/npptools/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/npptools/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/npptools/main.c?…
============================================================================== --- trunk/reactos/dll/win32/npptools/main.c (added) +++ trunk/reactos/dll/win32/npptools/main.c [iso-8859-1] Mon Nov 10 16:41:42 2014 @@ -0,0 +1,39 @@ +/* + * + * Copyright 2014 Austin English + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <wine/config.h> + +#include <stdarg.h> + +#include <windef.h> +#include <winbase.h> + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} Propchange: trunk/reactos/dll/win32/npptools/main.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/npptools/npptools.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/npptools/npptool…
============================================================================== --- trunk/reactos/dll/win32/npptools/npptools.spec (added) +++ trunk/reactos/dll/win32/npptools/npptools.spec [iso-8859-1] Mon Nov 10 16:41:42 2014 @@ -0,0 +1,60 @@ +@ stub ClearEventData +@ stub CreateBlob +@ stub CreateNPPInterface +@ stub DestroyBlob +@ stub DestroyNPPBlobTable +@ stub DuplicateBlob +@ stub FilterNPPBlob +@ stub FindOneOf +@ stub FindUnknownBlobCategories +@ stub FindUnknownBlobTags +@ stub GetBoolFromBlob +@ stub GetClassIDFromBlob +@ stub GetDwordFromBlob +@ stub GetMacAddressFromBlob +@ stub GetNPPAddressFilterFromBlob +@ stub GetNPPBlobFromUI +@ stub GetNPPBlobTable +@ stub GetNPPEtypeSapFilter +@ stub GetNPPMacTypeAsNumber +@ stub GetNPPPatternFilterFromBlob +@ stub GetNPPTriggerFromBlob +@ stub GetNetworkInfoFromBlob +@ stub GetStringFromBlob +@ stub GetStringsFromBlob +@ stub IsRemoteNPP +@ stub LockBlob +@ stub MarshalBlob +@ stub MergeBlob +@ stub NmAddUsedEntry +@ stub NmHeapAllocate +@ stub NmHeapFree +@ stub NmHeapReallocate +@ stub NmHeapSetMaxSize +@ stub NmHeapSize +@ stub NmRemoveUsedEntry +@ stub RaiseNMEvent +@ stub ReadBlobFromFile +@ stub RegCreateBlobKey +@ stub RegOpenBlobKey +@ stub ReleaseEventSystem +@ stub RemoveFromBlob +@ stub SelectNPPBlobFromTable +@ stub SendEvent +@ stub SetBoolInBlob +@ stub SetClassIDInBlob +@ stub SetDwordInBlob +@ stub SetMacAddressInBlob +@ stub SetNPPAddressFilterInBlob +@ stub SetNPPEtypeSapFilter +@ stub SetNPPPatternFilterInBlob +@ stub SetNPPTriggerInBlob +@ stub SetNetworkInfoInBlob +@ stub SetStringInBlob +@ stub SubkeyExists +@ stub UnMarshalBlob +@ stub UnlockBlob +@ stub WriteBlobToFile +@ stub WriteCrackedBlobToFile +@ stub recursiveDeleteKey +@ stub setKeyAndValue Propchange: trunk/reactos/dll/win32/npptools/npptools.spec ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Nov 10 16:41:42 2014 @@ -145,6 +145,7 @@ reactos/dll/win32/msxml6 # Synced to Wine-1.7.27 reactos/dll/win32/nddeapi # Synced to Wine-1.7.27 reactos/dll/win32/netapi32 # Forked at Wine-1.3.34 +reactos/dll/win32/npptools # Synced to Wine-1.7.27 reactos/dll/win32/ntdsapi # Synced to Wine-1.7.27 reactos/dll/win32/ntprint # Synced to Wine-1.7.27 reactos/dll/win32/objsel # Synced to Wine-1.7.27
10 years, 1 month
1
0
0
0
[akhaldi] 65357: [CMAKE][NTOS] * Improve some inclusions (avoid ../ types). * The answer is 42.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 10 16:26:55 2014 New Revision: 65357 URL:
http://svn.reactos.org/svn/reactos?rev=65357&view=rev
Log: [CMAKE][NTOS] * Improve some inclusions (avoid ../ types). * The answer is 42. Modified: trunk/reactos/ntoskrnl/cache/section/data.c trunk/reactos/ntoskrnl/cache/section/fault.c trunk/reactos/ntoskrnl/include/internal/arch/intrin_i.h trunk/reactos/ntoskrnl/include/internal/arch/ke.h trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h trunk/reactos/ntoskrnl/kd64/kddata.c trunk/reactos/ntoskrnl/kdbg/kdb_symbols.cmake.c trunk/reactos/ntoskrnl/mm/ARM3/arm/init.c trunk/reactos/ntoskrnl/mm/ARM3/contmem.c trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c trunk/reactos/ntoskrnl/mm/ARM3/dynamic.c trunk/reactos/ntoskrnl/mm/ARM3/expool.c trunk/reactos/ntoskrnl/mm/ARM3/hypermap.c trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c trunk/reactos/ntoskrnl/mm/ARM3/iosup.c trunk/reactos/ntoskrnl/mm/ARM3/largepag.c trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c trunk/reactos/ntoskrnl/mm/ARM3/mmdbg.c trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c trunk/reactos/ntoskrnl/mm/ARM3/ncache.c trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c trunk/reactos/ntoskrnl/mm/ARM3/pool.c trunk/reactos/ntoskrnl/mm/ARM3/procsup.c trunk/reactos/ntoskrnl/mm/ARM3/section.c trunk/reactos/ntoskrnl/mm/ARM3/session.c trunk/reactos/ntoskrnl/mm/ARM3/special.c trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c trunk/reactos/ntoskrnl/mm/ARM3/syspte.c trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c trunk/reactos/ntoskrnl/mm/ARM3/virtual.c trunk/reactos/ntoskrnl/mm/ARM3/zeropage.c trunk/reactos/ntoskrnl/mm/amd64/init.c trunk/reactos/ntoskrnl/mm/amd64/page.c trunk/reactos/ntoskrnl/mm/arm/page.c trunk/reactos/ntoskrnl/mm/i386/page.c trunk/reactos/ntoskrnl/mm/marea.c trunk/reactos/ntoskrnl/mm/mmfault.c trunk/reactos/ntoskrnl/mm/rmap.c trunk/reactos/ntoskrnl/mm/section.c trunk/reactos/ntoskrnl/ntkrnlmp/CMakeLists.txt trunk/reactos/ntoskrnl/po/poshtdwn.c Modified: trunk/reactos/ntoskrnl/cache/section/data.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/dat…
============================================================================== --- trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -76,10 +76,10 @@ #include <ntoskrnl.h> #include "newmm.h" -#include "../newcc.h" +#include <cache/newcc.h> #define NDEBUG #include <debug.h> -#include "../mm/ARM3/miarm.h" +#include <mm/ARM3/miarm.h> #define DPRINTC DPRINT Modified: trunk/reactos/ntoskrnl/cache/section/fault.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/fau…
============================================================================== --- trunk/reactos/ntoskrnl/cache/section/fault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/fault.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -77,7 +77,7 @@ #include "newmm.h" #define NDEBUG #include <debug.h> -#include "../mm/ARM3/miarm.h" +#include <mm/ARM3/miarm.h> #define DPRINTC DPRINT Modified: trunk/reactos/ntoskrnl/include/internal/arch/intrin_i.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/arch/intrin_i.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/arch/intrin_i.h [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -20,15 +20,15 @@ #pragma once #ifdef _M_IX86 -#include "../i386/intrin_i.h" +#include <internal/i386/intrin_i.h> #elif defined(_M_PPC) -#include "../powerpc/intrin_i.h" +#include <internal/powerpc/intrin_i.h> #elif defined(_M_MIPS) -#include "../mips/intrin_i.h" +#include <internal/mips/intrin_i.h> #elif defined(_M_ARM) -#include "../arm/intrin_i.h" +#include <internal/arm/intrin_i.h> #elif defined(_M_AMD64) -#include "../amd64/intrin_i.h" +#include <internal/amd64/intrin_i.h> #else #error "Unknown processor" #endif Modified: trunk/reactos/ntoskrnl/include/internal/arch/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/arch/ke.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/arch/ke.h [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -20,15 +20,15 @@ #pragma once #ifdef _M_IX86 -#include "../i386/ke.h" +#include <internal/i386/ke.h> #elif defined(_M_PPC) -#include "../powerpc/ke.h" +#include <internal/powerpc/ke.h> #elif defined(_M_MIPS) -#include "../mips/ke.h" +#include <internal/mips/ke.h> #elif defined(_M_ARM) -#include "../arm/ke.h" +#include <internal/arm/ke.h> #elif defined(_M_AMD64) -#include "../amd64/ke.h" +#include <internal/amd64/ke.h> #else #error "Unknown processor" #endif Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -80,7 +80,7 @@ #include "lpc.h" #include "rtl.h" #ifdef KDBG -#include "../kdbg/kdb.h" +#include <kdbg/kdb.h> #endif #include "dbgk.h" #include "spinlock.h" Modified: trunk/reactos/ntoskrnl/kd64/kddata.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/kddata.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/kd64/kddata.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kd64/kddata.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -11,7 +11,7 @@ #include <ntoskrnl.h> #define NDEBUG #include <debug.h> -#include "../mm/ARM3/miarm.h" +#include <mm/ARM3/miarm.h> #undef MmSystemRangeStart VOID NTAPI RtlpBreakWithStatusInstruction(VOID); Modified: trunk/reactos/ntoskrnl/kdbg/kdb_symbols.cmake.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb_symbols.…
============================================================================== --- trunk/reactos/ntoskrnl/kdbg/kdb_symbols.cmake.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kdbg/kdb_symbols.cmake.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <ntoskrnl.h> #define NDEBUG -#include "../cache/section/newmm.h" +#include <cache/section/newmm.h> #include <debug.h> /* GLOBALS ******************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/arm/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/arm/init.…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/arm/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/arm/init.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/contmem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/contmem.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/contmem.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/contmem.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* PRIVATE FUNCTIONS **********************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS *******************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/dynamic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/dynamic.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/dynamic.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/dynamic.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* FUNCTIONS *****************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/expool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/expool.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> #undef ExAllocatePoolWithQuota #undef ExAllocatePoolWithQuotaTag Modified: trunk/reactos/ntoskrnl/mm/ARM3/hypermap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/hypermap.…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/hypermap.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/hypermap.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/i386/init…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/iosup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/iosup.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/iosup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/iosup.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/largepag.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/largepag.…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/largepag.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/largepag.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/mmdbg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mmdbg.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/mmdbg.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/mmdbg.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> #ifndef _WINKD_ #define KdpDprintf DPRINT Modified: trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/ncache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/ncache.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/ncache.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/ncache.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> #if DBG #define ASSERT_LIST_INVARIANT(x) \ Modified: trunk/reactos/ntoskrnl/mm/ARM3/pool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pool.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/session.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/session.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/session.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/session.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -14,7 +14,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/special.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/special.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/special.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/special.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -18,7 +18,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> extern ULONG ExpPoolFlags; extern PMMPTE MmSystemPteBase; Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -14,7 +14,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GCC's incompetence strikes again */ __inline Modified: trunk/reactos/ntoskrnl/mm/ARM3/syspte.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/syspte.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/syspte.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/syspte.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -14,7 +14,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -14,11 +14,11 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* Include Mm version of AVL support */ -#include "../ARM3/miavl.h" -#include "../../../lib/rtl/avlsupp.c" +#include "miavl.h" +#include <lib/rtl/avlsupp.c> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/virtual.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -14,7 +14,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> #define MI_MAPPED_COPY_PAGES 14 #define MI_POOL_COPY_BYTES 512 Modified: trunk/reactos/ntoskrnl/mm/ARM3/zeropage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/zeropage.…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/zeropage.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/zeropage.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/amd64/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/amd64/init.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/amd64/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/amd64/init.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -14,7 +14,7 @@ //#define NDEBUG #include <debug.h> -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> #ifdef _WINKD_ extern PMMPTE MmDebugPte; Modified: trunk/reactos/ntoskrnl/mm/amd64/page.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/amd64/page.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/amd64/page.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/amd64/page.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <ntoskrnl.h> #define NDEBUG #include <debug.h> -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> #undef InterlockedExchangePte #define InterlockedExchangePte(pte1, pte2) \ Modified: trunk/reactos/ntoskrnl/mm/arm/page.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/arm/page.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/mm/arm/page.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/arm/page.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -13,7 +13,7 @@ #include <debug.h> #define MODULE_INVOLVED_IN_ARM3 -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> /* GLOBALS ********************************************************************/ Modified: trunk/reactos/ntoskrnl/mm/i386/page.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -12,7 +12,7 @@ #include <ntoskrnl.h> #define NDEBUG #include <debug.h> -#include "../ARM3/miarm.h" +#include <mm/ARM3/miarm.h> #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) Modified: trunk/reactos/ntoskrnl/mm/marea.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=65…
============================================================================== --- trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -43,7 +43,7 @@ #include <ntoskrnl.h> #define NDEBUG -#include "../cache/section/newmm.h" +#include <cache/section/newmm.h> #include <debug.h> #include "ARM3/miarm.h" Modified: trunk/reactos/ntoskrnl/mm/mmfault.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mmfault.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/mmfault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/mmfault.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -9,7 +9,7 @@ /* INCLUDES *******************************************************************/ #include <ntoskrnl.h> -#include "../cache/section/newmm.h" +#include <cache/section/newmm.h> #define NDEBUG #include <debug.h> Modified: trunk/reactos/ntoskrnl/mm/rmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/rmap.c?rev=653…
============================================================================== --- trunk/reactos/ntoskrnl/mm/rmap.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/rmap.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -10,7 +10,7 @@ /* INCLUDES *****************************************************************/ #include <ntoskrnl.h> -#include "../cache/section/newmm.h" +#include <cache/section/newmm.h> #define NDEBUG #include <debug.h> Modified: trunk/reactos/ntoskrnl/mm/section.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -45,8 +45,8 @@ /* INCLUDES *****************************************************************/ #include <ntoskrnl.h> -#include "../cache/newcc.h" -#include "../cache/section/newmm.h" +#include <cache/newcc.h> +#include <cache/section/newmm.h> #define NDEBUG #include <debug.h> #include <reactos/exeformat.h> Modified: trunk/reactos/ntoskrnl/ntkrnlmp/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntkrnlmp/CMakeLis…
============================================================================== --- trunk/reactos/ntoskrnl/ntkrnlmp/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntkrnlmp/CMakeLists.txt [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -1,6 +1,7 @@ include(../ntos.cmake) +include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl) spec2def(ntkrnlmp.exe ../ntoskrnl.spec) if(MSVC_IDE AND (CMAKE_VERSION MATCHES "ReactOS")) Modified: trunk/reactos/ntoskrnl/po/poshtdwn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/poshtdwn.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/po/poshtdwn.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/po/poshtdwn.c [iso-8859-1] Mon Nov 10 16:26:55 2014 @@ -10,7 +10,7 @@ #include <ntoskrnl.h> #ifdef NEWCC -#include "../cache/newcc.h" +#include <cache/newcc.h> #endif #define NDEBUG #include <debug.h>
10 years, 1 month
1
0
0
0
[khornicek] 65356: [WIN32K] - fix up icon size before calculating the destination rectangle CORE-8782
by khornicek@svn.reactos.org
Author: khornicek Date: Mon Nov 10 14:00:02 2014 New Revision: 65356 URL:
http://svn.reactos.org/svn/reactos?rev=65356&view=rev
Log: [WIN32K] - fix up icon size before calculating the destination rectangle CORE-8782 Modified: trunk/reactos/win32ss/user/ntuser/cursoricon_new.c Modified: trunk/reactos/win32ss/user/ntuser/cursoricon_new.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] Mon Nov 10 14:00:02 2014 @@ -1175,6 +1175,27 @@ if(psurfColor) SURFACE_ShareUnlockSurface(psurfColor); return FALSE; } + + /* Fix width parameter, if needed */ + if (!cxWidth) + { + if(diFlags & DI_DEFAULTSIZE) + cxWidth = is_icon(pIcon) ? + UserGetSystemMetrics(SM_CXICON) : UserGetSystemMetrics(SM_CXCURSOR); + else + cxWidth = pIcon->cx; + } + + /* Fix height parameter, if needed */ + if (!cyHeight) + { + if(diFlags & DI_DEFAULTSIZE) + cyHeight = is_icon(pIcon) ? + UserGetSystemMetrics(SM_CYICON) : UserGetSystemMetrics(SM_CYCURSOR); + else + cyHeight = pIcon->cy; + } + /* Calculate destination rectangle */ RECTL_vSetRect(&rcDest, xLeft, yTop, xLeft + cxWidth, yTop + cyHeight); IntLPtoDP(pdc, (LPPOINT)&rcDest, 2); @@ -1198,26 +1219,6 @@ /* Set source rect */ RECTL_vSetRect(&rcSrc, 0, 0, pIcon->cx, pIcon->cy); - - /* Fix width parameter, if needed */ - if (!cxWidth) - { - if(diFlags & DI_DEFAULTSIZE) - cxWidth = is_icon(pIcon) ? - UserGetSystemMetrics(SM_CXICON) : UserGetSystemMetrics(SM_CXCURSOR); - else - cxWidth = pIcon->cx; - } - - /* Fix height parameter, if needed */ - if (!cyHeight) - { - if(diFlags & DI_DEFAULTSIZE) - cyHeight = is_icon(pIcon) ? - UserGetSystemMetrics(SM_CYICON) : UserGetSystemMetrics(SM_CYCURSOR); - else - cyHeight = pIcon->cy; - } /* Should we render off-screen? */ bOffScreen = hbrFlickerFreeDraw &&
10 years, 1 month
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
38
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
Results per page:
10
25
50
100
200