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.

287 lines
8.1 KiB

  1. //
  2. // Winsock1.1, IrDA1.1, WindowsNT5.0, Windows98 and WindowsCE1.0.
  3. // Define one of _WIN32_WINNT, _WIN32_WINDOWS, _WIN32_WCE.
  4. // Copyright (C) Microsoft Corporation, 1994-1999.
  5. //
  6. #ifndef __AFIRDA__
  7. #define __AFIRDA__
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif
  11. #ifndef _WINSOCKAPI_
  12. typedef unsigned char u_char;
  13. typedef unsigned short u_short;
  14. typedef unsigned int u_int;
  15. typedef unsigned long u_long;
  16. #endif
  17. #define WINDOWS_AF_IRDA 26
  18. #define WINDOWS_PF_IRDA WINDOWS_AF_IRDA
  19. #define WCE_AF_IRDA 22
  20. #define WCE_PF_IRDA WCE_AF_IRDA
  21. #if defined(_WIN32_WINNT) || defined(_WIN32_WINDOWS)
  22. #ifndef AF_IRDA
  23. #define AF_IRDA WINDOWS_AF_IRDA
  24. #endif
  25. #define IRDA_PROTO_SOCK_STREAM 1
  26. #elif defined(_WIN32_WCE)
  27. #define AF_IRDA WCE_AF_IRDA
  28. #else
  29. #pragma message("One of _WIN32_WINNT | _WIN32_WINDOWS | _WIN32_WCE must be defined.")
  30. #endif
  31. #define PF_IRDA AF_IRDA
  32. // WINNT, WIN98, WINCE
  33. #define SOL_IRLMP 0x00FF
  34. #define IRLMP_ENUMDEVICES 0x00000010
  35. #define IRLMP_IAS_SET 0x00000011
  36. #define IRLMP_IAS_QUERY 0x00000012
  37. // WINNT, WINCE
  38. #define IRLMP_SEND_PDU_LEN 0x00000013
  39. #define IRLMP_EXCLUSIVE_MODE 0x00000014
  40. #define IRLMP_IRLPT_MODE 0x00000015
  41. #define IRLMP_9WIRE_MODE 0x00000016
  42. // WIN98
  43. #define IRLMP_TINYTP_MODE 0x00000017
  44. #define IRLMP_PARAMETERS 0x00000018
  45. #define IRLMP_DISCOVERY_MODE 0x00000019
  46. // WINCE
  47. #define IRLMP_SHARP_MODE 0x00000020
  48. #if defined(_WIN32_WINNT) // WSAIoctl for lazy discovery
  49. #define SIO_LAZY_DISCOVERY _IOR('t', 127, u_long)
  50. #endif
  51. #define IAS_ATTRIB_NO_CLASS 0x00000010
  52. #define IAS_ATTRIB_NO_ATTRIB 0x00000000
  53. #define IAS_ATTRIB_INT 0x00000001
  54. #define IAS_ATTRIB_OCTETSEQ 0x00000002
  55. #define IAS_ATTRIB_STR 0x00000003
  56. #define IAS_MAX_USER_STRING 256
  57. #define IAS_MAX_OCTET_STRING 1024
  58. #define IAS_MAX_CLASSNAME 64
  59. #define IAS_MAX_ATTRIBNAME 256
  60. // WINNT, WIN98
  61. enum
  62. {
  63. LM_HB_Extension = 128, // Any hint byte
  64. LM_HB1_PnP = 1, // First hint byte
  65. LM_HB1_PDA_Palmtop = 2,
  66. LM_HB1_Computer = 4,
  67. LM_HB1_Printer = 8,
  68. LM_HB1_Modem = 16,
  69. LM_HB1_Fax = 32,
  70. LM_HB1_LANAccess = 64,
  71. LM_HB2_Telephony = 1, // Second hint byte
  72. LM_HB2_FileServer = 2,
  73. };
  74. #define LmCharSetASCII 0
  75. #define LmCharSetISO_8859_1 1
  76. #define LmCharSetISO_8859_2 2
  77. #define LmCharSetISO_8859_3 3
  78. #define LmCharSetISO_8859_4 4
  79. #define LmCharSetISO_8859_5 5
  80. #define LmCharSetISO_8859_6 6
  81. #define LmCharSetISO_8859_7 7
  82. #define LmCharSetISO_8859_8 8
  83. #define LmCharSetISO_8859_9 9
  84. #define LmCharSetUNICODE 0xff
  85. // WIN98
  86. typedef u_long LM_BAUD_RATE;
  87. #define LM_BAUD_1200 1200
  88. #define LM_BAUD_2400 2400
  89. #define LM_BAUD_9600 9600
  90. #define LM_BAUD_19200 19200
  91. #define LM_BAUD_38400 38400
  92. #define LM_BAUD_57600 57600
  93. #define LM_BAUD_115200 115200
  94. #define LM_BAUD_576K 576000
  95. #define LM_BAUD_1152K 1152000
  96. #define LM_BAUD_4M 4000000
  97. typedef struct
  98. {
  99. u_long nTXDataBytes; // Max tx data bytes per packet
  100. u_long nRXDataBytes; // Max rx data bytes per packet
  101. LM_BAUD_RATE nBaudRate; // Negotiated baud rate
  102. u_long thresholdTime; // Threshold (ms)
  103. u_long discTime; // Disconnect (ms)
  104. u_short nMSLinkTurn; // Link turn around (ms)
  105. u_char nTXPackets; // Number packets in transmit window
  106. u_char nRXPackets; // Number packets in receive window
  107. } LM_IRPARMS,*PLM_IRPARMS;
  108. typedef struct _SOCKADDR_IRDA
  109. {
  110. u_short irdaAddressFamily;
  111. u_char irdaDeviceID[4];
  112. char irdaServiceName[25];
  113. } SOCKADDR_IRDA, *PSOCKADDR_IRDA, FAR *LPSOCKADDR_IRDA;
  114. typedef struct _WINDOWS_IRDA_DEVICE_INFO
  115. {
  116. u_char irdaDeviceID[4];
  117. char irdaDeviceName[22];
  118. u_char irdaDeviceHints1;
  119. u_char irdaDeviceHints2;
  120. u_char irdaCharSet;
  121. } WINDOWS_IRDA_DEVICE_INFO, *PWINDOWS_IRDA_DEVICE_INFO, FAR *LPWINDOWS_IRDA_DEVICE_INFO;
  122. typedef struct _WCE_IRDA_DEVICE_INFO
  123. {
  124. u_char irdaDeviceID[4];
  125. char irdaDeviceName[22];
  126. u_char Reserved[2];
  127. } WCE_IRDA_DEVICE_INFO, *PWCE_IRDA_DEVICE_INFO;
  128. #if defined(_WIN32_WINNT) || defined(_WIN32_WINDOWS)
  129. typedef WINDOWS_IRDA_DEVICE_INFO IRDA_DEVICE_INFO, *PIRDA_DEVICE_INFO, FAR *LPIRDA_DEVICE_INFO;
  130. #elif defined(_WIN32_WCE)
  131. typedef WCE_IRDA_DEVICE_INFO IRDA_DEVICE_INFO, *PIRDA_DEVICE_INFO;
  132. #else
  133. #pragma message("One of _WIN32_WINNT | _WIN32_WINDOWS | _WIN32_WCE must be defined.")
  134. #endif
  135. typedef struct _WINDOWS_DEVICELIST
  136. {
  137. ULONG numDevice;
  138. WINDOWS_IRDA_DEVICE_INFO Device[1];
  139. } WINDOWS_DEVICELIST, *PWINDOWS_DEVICELIST, FAR *LPWINDOWS_DEVICELIST;
  140. typedef struct _WCE_DEVICELIST
  141. {
  142. ULONG numDevice;
  143. WCE_IRDA_DEVICE_INFO Device[1];
  144. } WCE_DEVICELIST, *PWCE_DEVICELIST;
  145. #if defined(_WIN32_WINNT) || defined(_WIN32_WINDOWS)
  146. typedef WINDOWS_DEVICELIST DEVICELIST, *PDEVICELIST, FAR *LPDEVICELIST;
  147. #elif defined(_WIN32_WCE)
  148. typedef WCE_DEVICELIST DEVICELIST, *PDEVICELIST;
  149. #else
  150. #pragma message("One of _WIN32_WINNT | _WIN32_WINDOWS | _WIN32_WCE must be defined.")
  151. #endif
  152. typedef struct _WINDOWS_IAS_SET
  153. {
  154. char irdaClassName[IAS_MAX_CLASSNAME];
  155. char irdaAttribName[IAS_MAX_ATTRIBNAME];
  156. u_long irdaAttribType;
  157. union
  158. {
  159. LONG irdaAttribInt;
  160. struct
  161. {
  162. u_short Len;
  163. u_char OctetSeq[IAS_MAX_OCTET_STRING];
  164. } irdaAttribOctetSeq;
  165. struct
  166. {
  167. u_char Len;
  168. u_char CharSet;
  169. u_char UsrStr[IAS_MAX_USER_STRING];
  170. } irdaAttribUsrStr;
  171. } irdaAttribute;
  172. } WINDOWS_IAS_SET, *PWINDOWS_IAS_SET, FAR *LPWINDOWS_IAS_SET;
  173. typedef struct _WINDOWS_IAS_QUERY
  174. {
  175. u_char irdaDeviceID[4];
  176. char irdaClassName[IAS_MAX_CLASSNAME];
  177. char irdaAttribName[IAS_MAX_ATTRIBNAME];
  178. u_long irdaAttribType;
  179. union
  180. {
  181. LONG irdaAttribInt;
  182. struct
  183. {
  184. u_long Len;
  185. u_char OctetSeq[IAS_MAX_OCTET_STRING];
  186. } irdaAttribOctetSeq;
  187. struct
  188. {
  189. u_long Len;
  190. u_long CharSet;
  191. u_char UsrStr[IAS_MAX_USER_STRING];
  192. } irdaAttribUsrStr;
  193. } irdaAttribute;
  194. } WINDOWS_IAS_QUERY, *PWINDOWS_IAS_QUERY, FAR *LPWINDOWS_IAS_QUERY;
  195. typedef struct _WCE_IAS_SET
  196. {
  197. char irdaClassName[61];
  198. char irdaAttribName[61];
  199. u_short irdaAttribType;
  200. union
  201. {
  202. int irdaAttribInt;
  203. struct
  204. {
  205. int Len;
  206. u_char OctetSeq[1];
  207. u_char Reserved[3];
  208. } irdaAttribOctetSeq;
  209. struct
  210. {
  211. int Len;
  212. u_char CharSet;
  213. u_char UsrStr[1];
  214. u_char Reserved[2];
  215. } irdaAttribUsrStr;
  216. } irdaAttribute;
  217. } WCE_IAS_SET, *PWCE_IAS_SET;
  218. typedef struct _WCE_IAS_QUERY
  219. {
  220. u_char irdaDeviceID[4];
  221. char irdaClassName[61];
  222. char irdaAttribName[61];
  223. u_short irdaAttribType;
  224. union
  225. {
  226. int irdaAttribInt;
  227. struct
  228. {
  229. int Len;
  230. u_char OctetSeq[1];
  231. u_char Reserved[3];
  232. } irdaAttribOctetSeq;
  233. struct
  234. {
  235. int Len;
  236. u_char CharSet;
  237. u_char UsrStr[1];
  238. u_char Reserved[2];
  239. } irdaAttribUsrStr;
  240. } irdaAttribute;
  241. } WCE_IAS_QUERY, *PWCE_IAS_QUERY;
  242. #if defined(_WIN32_WINNT) || defined(_WIN32_WINDOWS)
  243. typedef WINDOWS_IAS_SET IAS_SET, *PIAS_SET, FAR *LPIASSET;
  244. typedef WINDOWS_IAS_QUERY IAS_QUERY, *PIAS_QUERY, FAR *LPIASQUERY;
  245. #elif defined(_WIN32_WCE)
  246. typedef WCE_IAS_SET IAS_SET, *PIAS_SET;
  247. typedef WCE_IAS_QUERY IAS_QUERY, *PIAS_QUERY, FAR *LPIASQUERY;
  248. #else
  249. #pragma message("One of _WIN32_WINNT | _WIN32_WINDOWS | _WIN32_WCE must be defined.")
  250. #endif
  251. #endif // __AFIRDA__