Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

167 lines
4.2 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. receive.h
  5. Abstract:
  6. This module describes the public routines in receive.c
  7. Author:
  8. Larry Osterman (larryo) 6-May-1991
  9. Revision History:
  10. 6-May-1991 larryo
  11. Created
  12. --*/
  13. #ifndef _RECEIVE_
  14. #define _RECEIVE_
  15. #define DATAGRAM_HANDLER(RoutineName) \
  16. NTSTATUS \
  17. RoutineName ( \
  18. IN struct _TRANSPORT_NAME *TransportName, \
  19. IN PVOID Buffer, \
  20. IN ULONG BytesAvailable, \
  21. IN OUT PULONG BytesTaken, \
  22. IN PVOID SourceAddress, \
  23. IN ULONG SourceAddressLength, \
  24. IN PVOID SourceName, \
  25. IN ULONG SourceNameLength, \
  26. IN ULONG ReceiveFlags \
  27. ) \
  28. typedef
  29. (*PDATAGRAM_HANDLER)(
  30. IN struct _TRANSPORT_NAME *TransportName,
  31. IN PVOID Buffer,
  32. IN ULONG BytesAvailable,
  33. IN OUT PULONG BytesTaken,
  34. IN PVOID SourceAddress,
  35. IN ULONG SourceAddressLength,
  36. IN PVOID SourceName,
  37. IN ULONG SourceNameLength,
  38. IN ULONG ReceiveFlags
  39. );
  40. LONG BowserPostedDatagramCount;
  41. LONG BowserPostedCriticalDatagramCount;
  42. typedef struct _POST_DATAGRAM_CONTEXT {
  43. WORK_QUEUE_ITEM WorkItem;
  44. PTRANSPORT_NAME TransportName;
  45. PVOID Buffer;
  46. ULONG BytesAvailable;
  47. int ClientNameLength;
  48. CHAR ClientName[NETBIOS_NAME_LEN];
  49. int ClientAddressLength;
  50. CHAR TdiClientAddress[1];
  51. } POST_DATAGRAM_CONTEXT, *PPOST_DATAGRAM_CONTEXT;
  52. NTSTATUS
  53. BowserTdiReceiveDatagramHandler (
  54. IN PVOID TdiEventContext, // the event context
  55. IN LONG SourceAddressLength, // length of the originator of the datagram
  56. IN PVOID SourceAddress, // string describing the originator of the datagram
  57. IN LONG OptionsLength, // options for the receive
  58. IN PVOID Options, //
  59. IN ULONG ReceiveDatagramFlags, //
  60. IN ULONG BytesIndicated, // number of bytes this indication
  61. IN ULONG BytesAvailable, // number of bytes in complete Tsdu
  62. OUT ULONG *BytesTaken, // number of bytes used
  63. IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes
  64. OUT PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED.
  65. );
  66. VOID
  67. BowserCancelAnnounceRequest(
  68. IN PDEVICE_OBJECT DeviceObject,
  69. IN PIRP Irp
  70. );
  71. VOID
  72. BowserCopyOemComputerName(
  73. PCHAR OutputComputerName,
  74. PCHAR NetbiosName,
  75. ULONG NetbiosNameLength,
  76. IN ULONG ReceiveFlags
  77. );
  78. VOID
  79. BowserLogIllegalDatagram(
  80. IN PTRANSPORT_NAME TransportName,
  81. IN PVOID IncomingBuffer,
  82. IN USHORT BufferSize,
  83. IN PCHAR ClientAddress,
  84. IN ULONG ReceiveFlags
  85. );
  86. NTSTATUS
  87. BowserPostDatagramToWorkerThread(
  88. IN PTRANSPORT_NAME TransportName,
  89. IN PVOID Datagram,
  90. IN ULONG Length,
  91. OUT PULONG BytesTaken,
  92. IN PVOID OriginatorsAddress,
  93. IN ULONG OriginatorsAddressLength,
  94. IN PVOID OriginatorsName,
  95. IN ULONG OriginatorsNameLength,
  96. IN PWORKER_THREAD_ROUTINE Handler,
  97. IN POOL_TYPE PoolType,
  98. IN WORK_QUEUE_TYPE QueueType,
  99. IN ULONG ReceiveFlags,
  100. IN BOOLEAN PostToRdrWorkerThread
  101. );
  102. MAILSLOTTYPE
  103. BowserClassifyIncomingDatagram(
  104. IN PVOID Buffer,
  105. IN ULONG BufferLength,
  106. OUT PVOID *DatagramData,
  107. OUT PULONG DatagramDataSize
  108. );
  109. extern
  110. PDATAGRAM_HANDLER
  111. BowserDatagramHandlerTable[];
  112. NTSTATUS
  113. BowserHandleMailslotTransaction (
  114. IN PTRANSPORT_NAME TransportName,
  115. IN PCHAR ClientName,
  116. IN ULONG ClientIpAddress,
  117. IN ULONG SmbOffset,
  118. IN DWORD ReceiveFlags,
  119. IN ULONG BytesIndicated,
  120. IN ULONG BytesAvailable,
  121. OUT ULONG *BytesTaken,
  122. IN PVOID Tsdu,
  123. OUT PIRP *Irp
  124. );
  125. NTSTATUS
  126. BowserHandleShortBrowserPacket(
  127. IN PTRANSPORT_NAME TransportName,
  128. IN PVOID EventContext,
  129. IN int SourceAddressLength,
  130. IN PVOID SourceAddress,
  131. IN int OptionsLength,
  132. IN PVOID Options,
  133. IN ULONG ReceiveDatagramFlags,
  134. IN ULONG BytesAvailable,
  135. IN ULONG *BytesTaken,
  136. IN PIRP *Irp,
  137. PTDI_IND_RECEIVE_DATAGRAM Handler
  138. );
  139. #endif