diff --git a/reactos/drivers/network/afd/afd/select.c b/reactos/drivers/network/afd/afd/select.c index 109a519ade2..1888340cd3d 100644 --- a/reactos/drivers/network/afd/afd/select.c +++ b/reactos/drivers/network/afd/afd/select.c @@ -85,6 +85,7 @@ static VOID SignalSocket( PollReq->Handles[i].Status)); } UnlockHandles( AFD_HANDLES(PollReq), PollReq->HandleCount ); + if( Irp->MdlAddress ) UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) ); AFD_DbgPrint(MID_TRACE,("Completing\n")); IoCompleteRequest( Irp, IO_NETWORK_INCREMENT ); AFD_DbgPrint(MID_TRACE,("Done\n")); @@ -391,6 +392,11 @@ VOID PollReeval( PAFD_DEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject ) { /* Take care of any event select signalling */ FCB = (PAFD_FCB)FileObject->FsContext; + if( !FCB ) { + KeReleaseSpinLock( &DeviceExt->Lock, OldIrql ); + return; + } + /* Not sure if i can do this at DISPATCH_LEVEL ... try it at passive */ AFD_DbgPrint(MID_TRACE,("Current State: %x, Events Fired: %x, " "Select Triggers %x\n", @@ -401,11 +407,6 @@ VOID PollReeval( PAFD_DEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject ) { EventSelect = FCB->EventSelect; } - if( !FCB ) { - KeReleaseSpinLock( &DeviceExt->Lock, OldIrql ); - return; - } - /* Now signal normal select irps */ ThePollEnt = DeviceExt->Polls.Flink; diff --git a/reactos/drivers/network/afd/afd/tdi.c b/reactos/drivers/network/afd/afd/tdi.c index 93701ab5cd8..925a07277fe 100644 --- a/reactos/drivers/network/afd/afd/tdi.c +++ b/reactos/drivers/network/afd/afd/tdi.c @@ -631,7 +631,6 @@ NTSTATUS TdiQueryInformation( return Status; } -#if 0 NTSTATUS TdiQueryInformationEx( PFILE_OBJECT FileObject, ULONG Entity, @@ -807,7 +806,6 @@ NTSTATUS TdiQueryAddress( return Status; } -#endif NTSTATUS TdiSend ( PIRP *Irp, diff --git a/reactos/drivers/network/afd/include/afd.h b/reactos/drivers/network/afd/include/afd.h index 285907a60af..e77d64bf598 100644 --- a/reactos/drivers/network/afd/include/afd.h +++ b/reactos/drivers/network/afd/include/afd.h @@ -28,6 +28,55 @@ #define MIN(x,y) (((x)<(y))?(x):(y)) #endif +#define IOCTL_TCP_QUERY_INFORMATION_EX \ + CTL_CODE(FILE_DEVICE_NETWORK, 0, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define TL_INSTANCE 0 +#define IP_MIB_STATS_ID 1 +#define IP_MIB_ADDRTABLE_ENTRY_ID 0x102 + +typedef struct IPSNMP_INFO { + ULONG Forwarding; + ULONG DefaultTTL; + ULONG InReceives; + ULONG InHdrErrors; + ULONG InAddrErrors; + ULONG ForwDatagrams; + ULONG InUnknownProtos; + ULONG InDiscards; + ULONG InDelivers; + ULONG OutRequests; + ULONG RoutingDiscards; + ULONG OutDiscards; + ULONG OutNoRoutes; + ULONG ReasmTimeout; + ULONG ReasmReqds; + ULONG ReasmOks; + ULONG ReasmFails; + ULONG FragOks; + ULONG FragFails; + ULONG FragCreates; + ULONG NumIf; + ULONG NumAddr; + ULONG NumRoutes; +} IPSNMP_INFO, *PIPSNMP_INFO; + +typedef struct IPADDR_ENTRY { + ULONG Addr; + ULONG Index; + ULONG Mask; + ULONG BcastAddr; + ULONG ReasmSize; + USHORT Context; + USHORT Pad; +} IPADDR_ENTRY, *PIPADDR_ENTRY; + +#define DN2H(dw) \ + ((((dw) & 0xFF000000L) >> 24) | \ + (((dw) & 0x00FF0000L) >> 8) | \ + (((dw) & 0x0000FF00L) << 8) | \ + (((dw) & 0x000000FFL) << 24)) + #define SOCKET_STATE_INVALID_TRANSITION ((DWORD)-1) #define SOCKET_STATE_CREATED 0 #define SOCKET_STATE_BOUND 1