ReactOS  0.4.14-dev-293-g2b39b42
fileobjs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

NTSTATUS FileOpenAddress (PTDI_REQUEST Request, PTA_IP_ADDRESS AddrList, USHORT Protocol, BOOLEAN Shared, PVOID Options)
 
NTSTATUS FileCloseAddress (PTDI_REQUEST Request)
 
NTSTATUS FileOpenConnection (PTDI_REQUEST Request, PVOID ClientContext)
 
NTSTATUS FileCloseConnection (PTDI_REQUEST Request)
 
NTSTATUS FileOpenControlChannel (PTDI_REQUEST Request)
 
NTSTATUS FileCloseControlChannel (PTDI_REQUEST Request)
 
VOID LogActiveObjects (VOID)
 

Variables

LIST_ENTRY AddressFileListHead
 
KSPIN_LOCK AddressFileListLock
 
LIST_ENTRY ConnectionEndpointListHead
 
KSPIN_LOCK ConnectionEndpointListLock
 

Function Documentation

◆ FileCloseAddress()

NTSTATUS FileCloseAddress ( PTDI_REQUEST  Request)

Definition at line 580 of file fileobjs.c.

582 {
583  PADDRESS_FILE AddrFile = Request->Handle.AddressHandle;
584  KIRQL OldIrql;
585 
586  if (!Request->Handle.AddressHandle) return STATUS_INVALID_PARAMETER;
587 
588  LockObject(AddrFile, &OldIrql);
589 
590  if (InterlockedDecrement(&AddrFile->Sharers) != 0)
591  {
592  /* Still other guys have open handles to this, so keep it around */
593  UnlockObject(AddrFile, OldIrql);
594  return STATUS_SUCCESS;
595  }
596 
597  /* We have to close this listener because we started it */
598  if( AddrFile->Listener )
599  {
600  TCPClose( AddrFile->Listener );
601  }
602 
603  UnlockObject(AddrFile, OldIrql);
604 
605  DereferenceObject(AddrFile);
606 
607  TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
608 
609  return STATUS_SUCCESS;
610 }
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG Sharers
Definition: titypes.h:140
#define DereferenceObject(Object)
Definition: titypes.h:24
#define LockObject(Object, Irql)
Definition: titypes.h:34
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
UCHAR KIRQL
Definition: env_spec_w32.h:591
NTSTATUS TCPClose(PCONNECTION_ENDPOINT Connection)
Definition: tcp.c:150
#define UnlockObject(Object, OldIrql)
Definition: titypes.h:54
#define InterlockedDecrement
Definition: armddk.h:52
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
struct _CONNECTION_ENDPOINT * Listener
Definition: titypes.h:153
#define MAX_TRACE
Definition: debug.h:16
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by TiCloseFileObject().

◆ FileCloseConnection()

NTSTATUS FileCloseConnection ( PTDI_REQUEST  Request)

Definition at line 656 of file fileobjs.c.

658 {
659  PCONNECTION_ENDPOINT Connection;
660 
661  TI_DbgPrint(MID_TRACE, ("Called.\n"));
662 
663  Connection = Request->Handle.ConnectionContext;
664 
665  if (!Connection) return STATUS_INVALID_PARAMETER;
666 
667  TCPClose( Connection );
668 
669  Request->Handle.ConnectionContext = NULL;
670 
671  TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
672 
673  return STATUS_SUCCESS;
674 }
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
#define MID_TRACE
Definition: debug.h:15
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
NTSTATUS TCPClose(PCONNECTION_ENDPOINT Connection)
Definition: tcp.c:150
smooth NULL
Definition: ftsmooth.c:416
#define MAX_TRACE
Definition: debug.h:16
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by TiCloseFileObject().

◆ FileCloseControlChannel()

NTSTATUS FileCloseControlChannel ( PTDI_REQUEST  Request)

Definition at line 727 of file fileobjs.c.

729 {
730  if (!Request->Handle.ControlChannel) return STATUS_INVALID_PARAMETER;
731 
732  DereferenceObject((PCONTROL_CHANNEL)Request->Handle.ControlChannel);
733 
734  Request->Handle.ControlChannel = NULL;
735 
736  return STATUS_SUCCESS;
737 }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define DereferenceObject(Object)
Definition: titypes.h:24
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
smooth NULL
Definition: ftsmooth.c:416
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by TiCloseFileObject().

◆ FileOpenAddress()

NTSTATUS FileOpenAddress ( PTDI_REQUEST  Request,
PTA_IP_ADDRESS  AddrList,
USHORT  Protocol,
BOOLEAN  Shared,
PVOID  Options 
)

Definition at line 391 of file fileobjs.c.

397 {
398  PADDRESS_FILE AddrFile;
399 
400  TI_DbgPrint(MID_TRACE, ("Called (Proto %d).\n", Protocol));
401 
402  /* If it's shared and has a port specified, look for a match */
403  if ((Shared != FALSE) && (Address->Address[0].Address[0].sin_port != 0))
404  {
405  AddrFile = AddrFindShared(NULL, Address->Address[0].Address[0].sin_port, Protocol);
406  if (AddrFile != NULL)
407  {
408  Request->Handle.AddressHandle = AddrFile;
409  return STATUS_SUCCESS;
410  }
411  }
412 
413  AddrFile = ExAllocatePoolWithTag(NonPagedPool, sizeof(ADDRESS_FILE),
414  ADDR_FILE_TAG);
415  if (!AddrFile) {
416  TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
418  }
419 
420  RtlZeroMemory(AddrFile, sizeof(ADDRESS_FILE));
421 
422  AddrFile->RefCount = 1;
423  AddrFile->Free = AddrFileFree;
424  AddrFile->Sharers = 1;
425 
426  /* Set our default options */
427  AddrFile->TTL = 128;
428  AddrFile->DF = 0;
429  AddrFile->BCast = 1;
430  AddrFile->HeaderIncl = 1;
431  AddrFile->ProcessId = PsGetCurrentProcessId();
432 
433  _SEH2_TRY {
434  PTEB Teb;
435 
436  Teb = PsGetCurrentThreadTeb();
437  if (Teb != NULL)
438  AddrFile->SubProcessTag = Teb->SubProcessTag;
440  AddrFile->SubProcessTag = 0;
441  } _SEH2_END;
442 
443  KeQuerySystemTime(&AddrFile->CreationTime);
444 
445  /* Make sure address is a local unicast address or 0 */
446  /* FIXME: IPv4 only */
447  AddrFile->Family = Address->Address[0].AddressType;
448  AddrFile->Address.Address.IPv4Address = Address->Address[0].Address[0].in_addr;
449  AddrFile->Address.Type = IP_ADDRESS_V4;
450 
451  if (!AddrIsUnspecified(&AddrFile->Address) &&
452  !AddrLocateInterface(&AddrFile->Address)) {
453  TI_DbgPrint(MIN_TRACE, ("Non-local address given (0x%X).\n", A2S(&AddrFile->Address)));
454  ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG);
455  return STATUS_INVALID_ADDRESS;
456  }
457 
458  TI_DbgPrint(MID_TRACE, ("Opening address %s for communication (P=%d U=%d).\n",
459  A2S(&AddrFile->Address), Protocol, IPPROTO_UDP));
460 
461  /* Protocol specific handling */
462  switch (Protocol) {
463  case IPPROTO_TCP:
464  if (Address->Address[0].Address[0].sin_port)
465  {
466  /* The client specified an explicit port so we force a bind to this */
467  AddrFile->Port = TCPAllocatePort(Address->Address[0].Address[0].sin_port);
468 
469  /* Check for bind success */
470  if (AddrFile->Port == 0xffff)
471  {
472  ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG);
474  }
475 
476  /* Sanity check */
477  ASSERT(Address->Address[0].Address[0].sin_port == AddrFile->Port);
478  }
479  else if (!AddrIsUnspecified(&AddrFile->Address))
480  {
481  /* The client is trying to bind to a local address so allocate a port now too */
482  AddrFile->Port = TCPAllocatePort(0);
483 
484  /* Check for bind success */
485  if (AddrFile->Port == 0xffff)
486  {
487  ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG);
489  }
490  }
491  else
492  {
493  /* The client wants an unspecified port with an unspecified address so we wait to see what the TCP library gives us */
494  AddrFile->Port = 0;
495  }
496 
497  AddEntity(CO_TL_ENTITY, AddrFile, CO_TL_TCP);
498 
499  AddrFile->Send = NULL; /* TCPSendData */
500  break;
501 
502  case IPPROTO_UDP:
503  TI_DbgPrint(MID_TRACE,("Allocating udp port\n"));
504  AddrFile->Port =
505  UDPAllocatePort(Address->Address[0].Address[0].sin_port);
506 
507  if ((Address->Address[0].Address[0].sin_port &&
508  AddrFile->Port != Address->Address[0].Address[0].sin_port) ||
509  AddrFile->Port == 0xffff)
510  {
511  ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG);
513  }
514 
515  TI_DbgPrint(MID_TRACE,("Setting port %d (wanted %d)\n",
516  AddrFile->Port,
517  Address->Address[0].Address[0].sin_port));
518 
519  AddEntity(CL_TL_ENTITY, AddrFile, CL_TL_UDP);
520 
521  AddrFile->Send = UDPSendDatagram;
522  break;
523 
524  case IPPROTO_ICMP:
525  AddrFile->Port = 0;
526  AddrFile->Send = ICMPSendDatagram;
527 
528  /* FIXME: Verify this */
529  AddEntity(ER_ENTITY, AddrFile, ER_ICMP);
530  break;
531 
532  default:
533  /* Use raw IP for all other protocols */
534  AddrFile->Port = 0;
535  AddrFile->Send = RawIPSendDatagram;
536 
537  /* FIXME: Verify this */
538  AddEntity(CL_TL_ENTITY, AddrFile, 0);
539  break;
540  }
541 
542  TI_DbgPrint(MID_TRACE, ("IP protocol number for address file object is %d.\n",
543  Protocol));
544 
545  TI_DbgPrint(MID_TRACE, ("Port number for address file object is %d.\n",
546  WN2H(AddrFile->Port)));
547 
548  /* Set protocol */
549  AddrFile->Protocol = Protocol;
550 
551  /* Initialize receive and transmit queues */
552  InitializeListHead(&AddrFile->ReceiveQueue);
553  InitializeListHead(&AddrFile->TransmitQueue);
554 
555  /* Initialize spin lock that protects the address file object */
556  KeInitializeSpinLock(&AddrFile->Lock);
557 
558  /* Return address file object */
559  Request->Handle.AddressHandle = AddrFile;
560 
561  /* Add address file to global list */
564  &AddrFile->ListEntry,
566 
567  TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
568 
569  return STATUS_SUCCESS;
570 }
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
BOOLEAN AddrIsUnspecified(PIP_ADDRESS Address)
Definition: address.c:113
PADDRESS_FILE AddrFindShared(PIP_ADDRESS BindAddress, USHORT Port, USHORT Protocol)
Definition: fileobjs.c:190
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
IPv4_RAW_ADDRESS IPv4Address
Definition: ip.h:26
NTSTATUS ICMPSendDatagram(PADDRESS_FILE AddrFile, PTDI_CONNECTION_INFORMATION ConnInfo, PCHAR BufferData, ULONG DataSize, PULONG DataUsed)
Definition: icmp.c:118
UINT UDPAllocatePort(UINT HintPort)
Definition: udp.c:385
#define MID_TRACE
Definition: debug.h:15
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
UCHAR TTL
Definition: titypes.h:141
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140
DATAGRAM_SEND_ROUTINE Send
Definition: titypes.h:148
LONG Sharers
Definition: titypes.h:140
LONG RefCount
Definition: titypes.h:132
USHORT Protocol
Definition: titypes.h:138
_In_ USHORT _In_ ULONG Protocol
Definition: wsk.h:182
HANDLE ProcessId
Definition: titypes.h:157
KSPIN_LOCK Lock
Definition: titypes.h:134
#define STATUS_ADDRESS_ALREADY_EXISTS
Definition: ntstatus.h:640
#define ADDR_FILE_TAG
Definition: tags.h:11
_SEH2_TRY
Definition: create.c:4250
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
#define IP_ADDRESS_V4
Definition: ip.h:32
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
#define CO_TL_ENTITY
Definition: tdiinfo.h:45
NTSTATUS UDPSendDatagram(PADDRESS_FILE AddrFile, PTDI_CONNECTION_INFORMATION ConnInfo, PCHAR BufferData, ULONG DataSize, PULONG DataUsed)
Definition: udp.c:150
UINT TCPAllocatePort(const UINT HintPort)
Definition: tcp.c:580
#define ER_ICMP
Definition: tdiinfo.h:59
NTSTATUS RawIPSendDatagram(PADDRESS_FILE AddrFile, PTDI_CONNECTION_INFORMATION ConnInfo, PCHAR Buffer, ULONG DataSize, PULONG DataUsed)
Definition: rawip.c:171
PVOID NTAPI PsGetCurrentThreadTeb(VOID)
Definition: thread.c:785
#define WN2H(w)
Definition: addrconv.c:35
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
VOID AddrFileFree(PVOID Object)
Definition: fileobjs.c:302
UINT HeaderIncl
Definition: titypes.h:144
LIST_ENTRY AddressFileListHead
Definition: fileobjs.c:21
KSPIN_LOCK AddressFileListLock
Definition: fileobjs.c:22
LIST_ENTRY ListEntry
Definition: titypes.h:131
PVOID SubProcessTag
Definition: titypes.h:158
#define CL_TL_ENTITY
Definition: tdiinfo.h:43
Definition: compat.h:484
UCHAR Type
Definition: ip.h:24
_SEH2_END
Definition: create.c:4424
PIP_INTERFACE AddrLocateInterface(PIP_ADDRESS MatchAddress)
Definition: interface.c:89
#define MAX_TRACE
Definition: debug.h:16
#define STATUS_INVALID_ADDRESS
Definition: ntstatus.h:543
IP_ADDRESS Address
Definition: titypes.h:136
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
UINT BCast
Definition: titypes.h:143
#define ER_ENTITY
Definition: tdiinfo.h:46
HANDLE NTAPI PsGetCurrentProcessId(VOID)
Definition: process.c:1123
OBJECT_FREE_ROUTINE Free
Definition: titypes.h:133
VOID AddEntity(ULONG EntityType, PVOID Context, ULONG Flags)
Definition: info.c:15
LIST_ENTRY TransmitQueue
Definition: titypes.h:150
USHORT Family
Definition: titypes.h:137
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define MIN_TRACE
Definition: debug.h:14
LIST_ENTRY ReceiveQueue
Definition: titypes.h:149
USHORT Port
Definition: titypes.h:139
#define CL_TL_UDP
Definition: tdiinfo.h:52
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define CO_TL_TCP
Definition: tdiinfo.h:57
union IP_ADDRESS::@990 Address
PCHAR A2S(PIP_ADDRESS Address)
Definition: address.c:17
LARGE_INTEGER CreationTime
Definition: titypes.h:159

Referenced by TiCreateFileObject().

◆ FileOpenConnection()

NTSTATUS FileOpenConnection ( PTDI_REQUEST  Request,
PVOID  ClientContext 
)

Definition at line 621 of file fileobjs.c.

624 {
626  PCONNECTION_ENDPOINT Connection;
627 
628  TI_DbgPrint(MID_TRACE, ("Called.\n"));
629 
631 
632  if( !Connection ) return STATUS_NO_MEMORY;
633 
634  Status = TCPSocket( Connection, AF_INET, SOCK_STREAM, IPPROTO_TCP );
635 
636  if( !NT_SUCCESS(Status) ) {
637  DereferenceObject( Connection );
638  return Status;
639  }
640 
641  /* Return connection endpoint file object */
642  Request->Handle.ConnectionContext = Connection;
643 
644  TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
645 
646  return STATUS_SUCCESS;
647 }
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
#define MID_TRACE
Definition: debug.h:15
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS TCPSocket(PCONNECTION_ENDPOINT Connection, UINT Family, UINT Type, UINT Proto)
Definition: tcp.c:125
#define DereferenceObject(Object)
Definition: titypes.h:24
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ PVOID ClientContext
Definition: netioddk.h:55
Status
Definition: gdiplustypes.h:24
#define MAX_TRACE
Definition: debug.h:16
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define AF_INET
Definition: tcpip.h:117
#define SOCK_STREAM
Definition: tcpip.h:118
return STATUS_SUCCESS
Definition: btrfs.c:2966
PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint(PVOID ClientContext)
Definition: tcp.c:86

Referenced by TiCreateFileObject().

◆ FileOpenControlChannel()

NTSTATUS FileOpenControlChannel ( PTDI_REQUEST  Request)

Definition at line 683 of file fileobjs.c.

685 {
686  PCONTROL_CHANNEL ControlChannel;
687  TI_DbgPrint(MID_TRACE, ("Called.\n"));
688 
689  ControlChannel = ExAllocatePoolWithTag(NonPagedPool, sizeof(*ControlChannel),
691 
692  if (!ControlChannel) {
693  TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
695  }
696 
697  RtlZeroMemory(ControlChannel, sizeof(CONTROL_CHANNEL));
698 
699  /* Make sure address is a local unicast address or 0 */
700 
701  /* Locate address entry. If specified address is 0, a random address is chosen */
702 
703  /* Initialize receive and transmit queues */
704  InitializeListHead(&ControlChannel->ListEntry);
705 
706  /* Initialize spin lock that protects the address file object */
707  KeInitializeSpinLock(&ControlChannel->Lock);
708 
709  ControlChannel->RefCount = 1;
710  ControlChannel->Free = ControlChannelFree;
711 
712  /* Return address file object */
713  Request->Handle.ControlChannel = ControlChannel;
714 
715  TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));
716 
717  return STATUS_SUCCESS;
718 }
#define TI_DbgPrint(_t_, _x_)
Definition: debug.h:45
#define MID_TRACE
Definition: debug.h:15
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
VOID ControlChannelFree(PVOID Object)
Definition: fileobjs.c:368
OBJECT_FREE_ROUTINE Free
Definition: titypes.h:303
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
LIST_ENTRY ListEntry
Definition: titypes.h:301
#define MAX_TRACE
Definition: debug.h:16
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define CONTROL_CHANNEL_TAG
Definition: tags.h:12
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define MIN_TRACE
Definition: debug.h:14
return STATUS_SUCCESS
Definition: btrfs.c:2966
KSPIN_LOCK Lock
Definition: titypes.h:304

Referenced by TiCreateFileObject().

◆ LogActiveObjects()

VOID LogActiveObjects ( VOID  )

Definition at line 109 of file fileobjs.c.

110 {
111 #ifdef LOG_OBJECTS
112  PLIST_ENTRY CurrentEntry;
113  KIRQL OldIrql;
114  PADDRESS_FILE AddrFile;
116 
117  DbgPrint("----------- TCP/IP Active Object Dump -------------\n");
118 
120 
121  CurrentEntry = AddressFileListHead.Flink;
122  while (CurrentEntry != &AddressFileListHead)
123  {
124  AddrFile = CONTAINING_RECORD(CurrentEntry, ADDRESS_FILE, ListEntry);
125 
126  DbgPrint("Address File (%s, %d, %d) @ 0x%p | Ref count: %d | Sharers: %d\n",
127  A2S(&AddrFile->Address), WN2H(AddrFile->Port), AddrFile->Protocol,
128  AddrFile, AddrFile->RefCount, AddrFile->Sharers);
129  DbgPrint("\tListener: ");
130  if (AddrFile->Listener == NULL)
131  DbgPrint("<None>\n");
132  else
133  DbgPrint("0x%p\n", AddrFile->Listener);
134  DbgPrint("\tAssociated endpoints: ");
135  if (AddrFile->Connection == NULL)
136  DbgPrint("<None>\n");
137  else
138  {
139  Conn = AddrFile->Connection;
140  while (Conn)
141  {
142  DbgPrint("0x%p ", Conn);
143  Conn = Conn->Next;
144  }
145  DbgPrint("\n");
146  }
147 
148  CurrentEntry = CurrentEntry->Flink;
149  }
150 
152 
154 
155  CurrentEntry = ConnectionEndpointListHead.Flink;
156  while (CurrentEntry != &ConnectionEndpointListHead)
157  {
158  Conn = CONTAINING_RECORD(CurrentEntry, CONNECTION_ENDPOINT, ListEntry);
159 
160  DbgPrint("Connection @ 0x%p | Ref count: %d\n", Conn, Conn->RefCount);
161  DbgPrint("\tPCB: ");
162  if (Conn->SocketContext == NULL)
163  DbgPrint("<None>\n");
164  else
165  {
166  DbgPrint("0x%p\n", Conn->SocketContext);
168  }
169  DbgPrint("\tPacket queue status: %s\n", IsListEmpty(&Conn->PacketQueue) ? "Empty" : "Not Empty");
170  DbgPrint("\tRequest lists: Connect: %s | Recv: %s | Send: %s | Shutdown: %s | Listen: %s\n",
171  IsListEmpty(&Conn->ConnectRequest) ? "Empty" : "Not Empty",
172  IsListEmpty(&Conn->ReceiveRequest) ? "Empty" : "Not Empty",
173  IsListEmpty(&Conn->SendRequest) ? "Empty" : "Not Empty",
174  IsListEmpty(&Conn->ShutdownRequest) ? "Empty" : "Not Empty",
175  IsListEmpty(&Conn->ListenRequest) ? "Empty" : "Not Empty");
176  DbgPrint("\tSend shutdown: %s\n", Conn->SendShutdown ? "Yes" : "No");
177  DbgPrint("\tReceive shutdown: %s\n", Conn->ReceiveShutdown ? "Yes" : "No");
178  if (Conn->ReceiveShutdown) DbgPrint("\tReceive shutdown status: 0x%x\n", Conn->ReceiveShutdownStatus);
179  DbgPrint("\tClosing: %s\n", Conn->Closing ? "Yes" : "No");
180 
181  CurrentEntry = CurrentEntry->Flink;
182  }
183 
185 
186  DbgPrint("---------------------------------------------------\n");
187 #endif
188 }
#define DbgPrint
Definition: loader.c:25
LONG Sharers
Definition: titypes.h:140
LONG RefCount
Definition: titypes.h:132
USHORT Protocol
Definition: titypes.h:138
NTSTATUS ReceiveShutdownStatus
Definition: titypes.h:286
VOID TcpipReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL Irql)
Definition: lock.c:26
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
VOID TcpipAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL Irql)
Definition: lock.c:18
LIST_ENTRY PacketQueue
Definition: titypes.h:277
struct _CONNECTION_ENDPOINT * Next
Definition: titypes.h:289
UCHAR KIRQL
Definition: env_spec_w32.h:591
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN SendShutdown
Definition: titypes.h:284
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define WN2H(w)
Definition: addrconv.c:35
LIST_ENTRY ShutdownRequest
Definition: titypes.h:275
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
LIST_ENTRY ReceiveRequest
Definition: titypes.h:273
Definition: typedefs.h:117
struct _CONNECTION_ENDPOINT * Listener
Definition: titypes.h:153
LIST_ENTRY AddressFileListHead
Definition: fileobjs.c:21
KSPIN_LOCK AddressFileListLock
Definition: fileobjs.c:22
void LibTCPDumpPcb(PVOID SocketContext)
Definition: rostcp.c:39
BOOLEAN ReceiveShutdown
Definition: titypes.h:285
IP_ADDRESS Address
Definition: titypes.h:136
LIST_ENTRY ConnectRequest
Definition: titypes.h:271
LIST_ENTRY ListenRequest
Definition: titypes.h:272
LIST_ENTRY SendRequest
Definition: titypes.h:274
KSPIN_LOCK ConnectionEndpointListLock
Definition: fileobjs.c:26
struct _CONNECTION_ENDPOINT * Connection
Definition: titypes.h:151
USHORT Port
Definition: titypes.h:139
PCHAR A2S(PIP_ADDRESS Address)
Definition: address.c:17
LIST_ENTRY ConnectionEndpointListHead
Definition: fileobjs.c:25

Referenced by IPTimeoutDpcFn().

Variable Documentation

◆ AddressFileListHead

LIST_ENTRY AddressFileListHead

Definition at line 21 of file fileobjs.c.

Referenced by DriverEntry(), and TiUnload().

◆ AddressFileListLock

KSPIN_LOCK AddressFileListLock

Definition at line 22 of file fileobjs.c.

Referenced by DriverEntry(), and TiUnload().

◆ ConnectionEndpointListHead

LIST_ENTRY ConnectionEndpointListHead

Definition at line 25 of file fileobjs.c.

Referenced by DriverEntry(), LogActiveObjects(), and TCPAllocateConnectionEndpoint().

◆ ConnectionEndpointListLock

KSPIN_LOCK ConnectionEndpointListLock