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.

220 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. irtdiclp.h
  5. Abstract:
  6. private definitions for the irda tdi client library.
  7. Author:
  8. mbert 9-97
  9. --*/
  10. #define LISTEN_BACKLOG 1
  11. #define ENDPSIG 0xEEEEEEEE
  12. #define CONNSIG 0xCCCCCCCC
  13. #define GOODENDP(ep) ASSERT(ep->Sig == ENDPSIG)
  14. #define GOODCONN(c) ASSERT(c->Sig == CONNSIG)
  15. typedef struct
  16. {
  17. LIST_ENTRY Linkage;
  18. HANDLE AddrHandle;
  19. REF_CNT RefCnt;
  20. ULONG Sig;
  21. PFILE_OBJECT pFileObject;
  22. LIST_ENTRY ConnList;
  23. PDEVICE_OBJECT pDeviceObject;
  24. ULONG Flags;
  25. #define EPF_CLIENT 0x00000001
  26. #define EPF_SERVER 0x00000002
  27. #define EPF_COMPLETE_CLOSE 0x00000004
  28. PVOID ClEndpContext;
  29. CTEEvent DeleteEndpEvent;
  30. } IRENDPOINT, *PIRENDPOINT;
  31. #define CONN_ST_CREATED 1
  32. #define CONN_ST_OPEN 2
  33. #define CONN_ST_CLOSED 3
  34. typedef struct
  35. {
  36. LIST_ENTRY Linkage;
  37. HANDLE ConnHandle;
  38. REF_CNT RefCnt;
  39. ULONG Sig;
  40. PFILE_OBJECT pFileObject;
  41. PDEVICE_OBJECT pDeviceObject;
  42. PIRENDPOINT pEndp;
  43. ULONG State;
  44. //LIST_ENTRY RecvBufList;
  45. LIST_ENTRY RecvBufFreeList;
  46. LIST_ENTRY RecvIndList;
  47. LIST_ENTRY RecvIndFreeList;
  48. PIRDA_RECVBUF pAssemBuf;
  49. PVOID ClConnContext;
  50. CTEEvent DeleteConnEvent;
  51. } IRCONN, *PIRCONN;
  52. typedef struct
  53. {
  54. LIST_ENTRY Linkage;
  55. ULONG BytesIndicated;
  56. ULONG FinalSeg;
  57. PMDL pMdl;
  58. PIRCONN pConn;
  59. } RECEIVEIND, *PRECEIVEIND;
  60. VOID
  61. IrdaCloseConnInternal(
  62. PVOID ConnectContext);
  63. NTSTATUS
  64. IrdaCloseEndpointInternal(
  65. PVOID pEndpContext,
  66. BOOLEAN InternalRequest);
  67. NTSTATUS
  68. IrdaDisconnectEventHandler(
  69. IN PVOID TdiEventContext,
  70. IN CONNECTION_CONTEXT ConnectionContext,
  71. IN int DisconnectDataLength,
  72. IN PVOID DisconnectData,
  73. IN int DisconnectInformationLength,
  74. IN PVOID DisconnectInformation,
  75. IN ULONG DisconnectFlags
  76. );
  77. NTSTATUS
  78. IrdaReceiveEventHandler (
  79. IN PVOID TdiEventContext,
  80. IN CONNECTION_CONTEXT ConnectionContext,
  81. IN ULONG ReceiveFlags,
  82. IN ULONG BytesIndicated,
  83. IN ULONG BytesAvailable,
  84. OUT ULONG *BytesTaken,
  85. IN PVOID Tsdu,
  86. OUT PIRP *IoRequestPacket
  87. );
  88. NTSTATUS
  89. IrdaConnectEventHandler (
  90. IN PVOID TdiEventContext,
  91. IN int RemoteAddressLength,
  92. IN PVOID RemoteAddress,
  93. IN int UserDataLength,
  94. IN PVOID UserData,
  95. IN int OptionsLength,
  96. IN PVOID Options,
  97. OUT CONNECTION_CONTEXT *ConnectionContext,
  98. OUT PIRP *AcceptIrp
  99. );
  100. NTSTATUS
  101. IrdaCompleteAcceptIrp (
  102. IN PDEVICE_OBJECT DeviceObject,
  103. IN PIRP Irp,
  104. IN PVOID Context
  105. );
  106. NTSTATUS
  107. IrdaCompleteDisconnectIrp (
  108. IN PDEVICE_OBJECT DeviceObject,
  109. IN PIRP Irp,
  110. IN PVOID Context
  111. );
  112. NTSTATUS
  113. IrdaCompleteSendIrp (
  114. IN PDEVICE_OBJECT DeviceObject,
  115. IN PIRP Irp,
  116. IN PVOID Context);
  117. NTSTATUS
  118. IrdaCompleteReceiveIrp (
  119. IN PDEVICE_OBJECT DeviceObject,
  120. IN PIRP Irp,
  121. IN PVOID Context);
  122. NTSTATUS
  123. IrdaDisassociateAddress(
  124. PIRCONN pConn);
  125. NTSTATUS
  126. IrdaCreateAddress(
  127. IN PTDI_ADDRESS_IRDA pRequestedIrdaAddr,
  128. OUT PHANDLE pAddrHandle);
  129. NTSTATUS
  130. IrdaCreateConnection(
  131. OUT PHANDLE pConnHandle,
  132. IN PVOID ClientContext);
  133. NTSTATUS
  134. IrdaAssociateAddress(
  135. PIRCONN pConn,
  136. HANDLE AddressHandle);
  137. VOID
  138. IrdaCreateConnCallback(
  139. struct CTEEvent *Event,
  140. PVOID Arg);
  141. VOID
  142. IrdaDataReadyCallback(
  143. struct CTEEvent *Event,
  144. PVOID Arg);
  145. VOID
  146. IrdaRestartRecvCallback(
  147. struct CTEEvent *Event,
  148. PVOID Arg);
  149. VOID
  150. AllocRecvData(
  151. PIRCONN pConn);
  152. VOID
  153. DeleteConnCallback(
  154. struct CTEEvent *Event,
  155. PVOID Arg);
  156. VOID
  157. IrdaDeleteConnection(PIRCONN pConn);
  158. VOID
  159. DeleteEndpCallback(
  160. struct CTEEvent *Event,
  161. PVOID Arg);
  162. VOID
  163. IrdaDeleteEndpoint(PIRENDPOINT pEndp);
  164. NTSTATUS
  165. IrdaSetEventHandler(
  166. IN PFILE_OBJECT FileObject,
  167. IN ULONG EventType,
  168. IN PVOID EventHandler,
  169. IN PVOID EventContext);
  170. NTSTATUS
  171. IrdaIssueDeviceControl (
  172. IN HANDLE FileHandle OPTIONAL,
  173. IN PFILE_OBJECT FileObject OPTIONAL,
  174. IN PVOID IrpParameters,
  175. IN ULONG IrpParametersLength,
  176. IN PVOID MdlBuffer,
  177. IN ULONG MdlBufferLength,
  178. IN UCHAR MinorFunction);