Leaked source code of windows server 2003
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.

467 lines
13 KiB

  1. /*++ BUILD Version: 0001
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1991, Microsoft Corporation
  6. *
  7. * WOWWSOCK.H
  8. * 16-bit Winsock API argument structures
  9. *
  10. * History:
  11. * Created 02-Oct-1992 by David Treadwell (davidtr)
  12. --*/
  13. //#include <windows.h>
  14. //#include <winsock.h>
  15. /* XLATOFF */
  16. #pragma pack(1)
  17. /* XLATON */
  18. /*++
  19. *
  20. * Winsock data structures
  21. *
  22. --*/
  23. typedef WORD HSOCKET16;
  24. typedef DWORD IN_ADDR16;
  25. typedef struct _SOCKADDR16 { /* sa16 */
  26. WORD sa_family;
  27. BYTE sa_data[14];
  28. } SOCKADDR16;
  29. typedef SOCKADDR16 UNALIGNED *PSOCKADDR16;
  30. typedef VPVOID VPSOCKADDR;
  31. #define FD_SETSIZE 64
  32. typedef struct _FD_SET16 { /* fd16 */
  33. WORD fd_count;
  34. HSOCKET16 fd_array[FD_SETSIZE];
  35. } FD_SET16;
  36. typedef FD_SET16 UNALIGNED *PFD_SET16;
  37. typedef VPVOID VPFD_SET16;
  38. #define WSADESCRIPTION_LEN 256
  39. #define WSASYS_STATUS_LEN 128
  40. typedef struct _WSADATA16 { /* wd16 */
  41. WORD wVersion;
  42. WORD wHighVersion;
  43. CHAR szDescription[WSADESCRIPTION_LEN+1];
  44. CHAR szSystemStatus[WSASYS_STATUS_LEN+1];
  45. INT16 iMaxSockets;
  46. INT16 iMaxUdpDg;
  47. VPBYTE lpVendorInfo;
  48. } WSADATA16;
  49. typedef WSADATA16 UNALIGNED *PWSADATA16;
  50. typedef VPVOID VPWSADATA16;
  51. typedef struct _TIMEVAL16 { /* tv16 */
  52. DWORD tv_sec; /* seconds */
  53. DWORD tv_usec; /* and microseconds */
  54. } TIMEVAL16;
  55. typedef TIMEVAL16 *PTIMEVAL16;
  56. typedef VPVOID VPTIMEVAL16;
  57. typedef struct _HOSTENT16 { /* he16 */
  58. VPSZ h_name;
  59. VPVOID h_aliases;
  60. WORD h_addrtype;
  61. WORD h_length;
  62. VPBYTE h_addr_list;
  63. } HOSTENT16;
  64. typedef HOSTENT16 *PHOSTENT16;
  65. typedef VPVOID VPHOSTENT16;
  66. typedef struct _PROTOENT16 { /* pe16 */
  67. VPSZ p_name;
  68. VPVOID p_aliases;
  69. WORD p_proto;
  70. } PROTOENT16;
  71. typedef PROTOENT16 *PPROTOENT16;
  72. typedef VPVOID VPPROTOENT16;
  73. typedef struct _SERVENT16 { /* se16 */
  74. VPSZ s_name;
  75. VPVOID s_aliases;
  76. WORD s_port;
  77. VPSZ s_proto;
  78. } SERVENT16;
  79. typedef SERVENT16 *PSERVENT16;
  80. typedef VPVOID VPSERVENT16;
  81. typedef struct _NETENT16 { /* ne16 */
  82. VPSZ n_name;
  83. VPVOID n_aliases;
  84. WORD n_addrtype;
  85. DWORD n_net;
  86. } NETENT16;
  87. typedef NETENT16 *PNETENT16;
  88. typedef VPVOID VPNETENT16;
  89. /*++
  90. *
  91. * Winsock API IDs (equal to ordinal numbers)
  92. *
  93. --*/
  94. #define FUN_ACCEPT 1 //
  95. #define FUN_BIND 2 //
  96. #define FUN_CLOSESOCKET 3 //
  97. #define FUN_CONNECT 4 //
  98. #define FUN_GETPEERNAME 5 //
  99. #define FUN_GETSOCKNAME 6 //
  100. #define FUN_GETSOCKOPT 7 //
  101. #define FUN_HTONL 8 //
  102. #define FUN_HTONS 9 //
  103. #define FUN_INET_ADDR 10 //
  104. #define FUN_INET_NTOA 11 //
  105. #define FUN_IOCTLSOCKET 12 //
  106. #define FUN_LISTEN 13 //
  107. #define FUN_NTOHL 14 //
  108. #define FUN_NTOHS 15 //
  109. #define FUN_RECV 16 //
  110. #define FUN_RECVFROM 17 //
  111. #define FUN_SELECT 18 //
  112. #define FUN_SEND 19 //
  113. #define FUN_SENDTO 20 //
  114. #define FUN_SETSOCKOPT 21 //
  115. #define FUN_SHUTDOWN 22 //
  116. #define FUN_SOCKET 23 //
  117. #define FUN_GETHOSTBYADDR 51 //
  118. #define FUN_GETHOSTBYNAME 52 //
  119. #define FUN_GETPROTOBYNAME 53 //
  120. #define FUN_GETPROTOBYNUMBER 54 //
  121. #define FUN_GETSERVBYNAME 55 //
  122. #define FUN_GETSERVBYPORT 56 //
  123. #define FUN_GETHOSTNAME 57 //
  124. #define FUN_WSAASYNCSELECT 101 //
  125. #define FUN_WSAASYNCGETHOSTBYADDR 102 //
  126. #define FUN_WSAASYNCGETHOSTBYNAME 103 //
  127. #define FUN_WSAASYNCGETPROTOBYNUMBER 104 //
  128. #define FUN_WSAASYNCGETPROTOBYNAME 105 //
  129. #define FUN_WSAASYNCGETSERVBYPORT 106 //
  130. #define FUN_WSAASYNCGETSERVBYNAME 107 //
  131. #define FUN_WSACANCELASYNCREQUEST 108 //
  132. #define FUN_WSASETBLOCKINGHOOK 109 //
  133. #define FUN_WSAUNHOOKBLOCKINGHOOK 110 //
  134. #define FUN_WSAGETLASTERROR 111 //
  135. #define FUN_WSASETLASTERROR 112 //
  136. #define FUN_WSACANCELBLOCKINGCALL 113 //
  137. #define FUN_WSAISBLOCKING 114 //
  138. #define FUN_WSASTARTUP 115 //
  139. #define FUN_WSACLEANUP 116 //
  140. #define FUN___WSAFDISSET 151 //
  141. /*++
  142. Winsock function prototypes - the seemingly unimportant number in the
  143. comment on each function MUST match the ones in the list above!!!
  144. !! BE WARNED !!
  145. --*/
  146. typedef struct _ACCEPT16 { /* ws1 */
  147. VPWORD AddressLength;
  148. VPSOCKADDR Address;
  149. HSOCKET16 hSocket;
  150. } ACCEPT16;
  151. typedef ACCEPT16 UNALIGNED *PACCEPT16;
  152. typedef struct _BIND16 { /* ws2 */
  153. WORD AddressLength;
  154. VPSOCKADDR Address;
  155. HSOCKET16 hSocket;
  156. } BIND16;
  157. typedef BIND16 UNALIGNED *PBIND16;
  158. typedef struct _CLOSESOCKET16 { /* ws3 */
  159. HSOCKET16 hSocket;
  160. } CLOSESOCKET16;
  161. typedef CLOSESOCKET16 UNALIGNED *PCLOSESOCKET16;
  162. typedef struct _CONNECT16 { /* ws4 */
  163. WORD AddressLength;
  164. VPSOCKADDR Address;
  165. HSOCKET16 hSocket;
  166. } CONNECT16;
  167. typedef CONNECT16 UNALIGNED *PCONNECT16;
  168. typedef struct _GETPEERNAME16 { /* ws5 */
  169. VPWORD AddressLength;
  170. VPSOCKADDR Address;
  171. HSOCKET16 hSocket;
  172. } GETPEERNAME16;
  173. typedef GETPEERNAME16 UNALIGNED *PGETPEERNAME16;
  174. typedef struct _GETSOCKNAME16 { /* ws6 */
  175. VPWORD AddressLength;
  176. VPSOCKADDR Address;
  177. HSOCKET16 hSocket;
  178. } GETSOCKNAME16;
  179. typedef GETSOCKNAME16 UNALIGNED *PGETSOCKNAME16;
  180. typedef struct _GETSOCKOPT16 { /* ws7 */
  181. VPWORD OptionLength;
  182. VPBYTE OptionValue;
  183. WORD OptionName;
  184. WORD Level;
  185. HSOCKET16 hSocket;
  186. } GETSOCKOPT16;
  187. typedef GETSOCKOPT16 UNALIGNED *PGETSOCKOPT16;
  188. typedef struct _HTONL16 { /* ws8 */
  189. DWORD HostLong;
  190. } HTONL16;
  191. typedef HTONL16 UNALIGNED *PHTONL16;
  192. typedef struct _HTONS16 { /* ws9 */
  193. WORD HostShort;
  194. } HTONS16;
  195. typedef HTONS16 UNALIGNED *PHTONS16;
  196. typedef struct _INET_ADDR16 { /* ws10 */
  197. VPSZ cp;
  198. } INET_ADDR16;
  199. typedef INET_ADDR16 UNALIGNED *PINET_ADDR16;
  200. typedef struct _INET_NTOA16 { /* ws11 */
  201. IN_ADDR16 in;
  202. } INET_NTOA16;
  203. typedef INET_NTOA16 UNALIGNED *PINET_NTOA16;
  204. typedef struct _IOCTLSOCKET16 { /* ws12 */
  205. VPDWORD Argument;
  206. DWORD Command;
  207. HSOCKET16 hSocket;
  208. } IOCTLSOCKET16;
  209. typedef IOCTLSOCKET16 UNALIGNED *PIOCTLSOCKET16;
  210. typedef struct _LISTEN16 { /* ws13 */
  211. WORD Backlog;
  212. HSOCKET16 hSocket;
  213. } LISTEN16;
  214. typedef LISTEN16 UNALIGNED *PLISTEN16;
  215. typedef struct _NTOHL16 { /* ws14 */
  216. DWORD NetLong;
  217. } NTOHL16;
  218. typedef NTOHL16 UNALIGNED *PNTOHL16;
  219. typedef struct _NTOHS16 { /* ws15 */
  220. WORD NetShort;
  221. } NTOHS16;
  222. typedef NTOHS16 UNALIGNED *PNTOHS16;
  223. typedef struct _RECV16 { /* ws16 */
  224. WORD Flags;
  225. WORD BufferLength;
  226. VPBYTE Buffer;
  227. HSOCKET16 hSocket;
  228. } RECV16;
  229. typedef RECV16 UNALIGNED *PRECV16;
  230. typedef struct _RECVFROM16 { /* ws17 */
  231. VPWORD AddressLength;
  232. VPSOCKADDR Address;
  233. WORD Flags;
  234. WORD BufferLength;
  235. VPBYTE Buffer;
  236. HSOCKET16 hSocket;
  237. } RECVFROM16;
  238. typedef RECVFROM16 UNALIGNED *PRECVFROM16;
  239. typedef struct _SELECT16 { /* ws18 */
  240. VPTIMEVAL16 Timeout;
  241. VPFD_SET16 Exceptfds;
  242. VPFD_SET16 Writefds;
  243. VPFD_SET16 Readfds;
  244. WORD HandleCount;
  245. } SELECT16;
  246. typedef SELECT16 UNALIGNED *PSELECT16;
  247. typedef struct _SEND16 { /* ws19 */
  248. WORD Flags;
  249. WORD BufferLength;
  250. VPBYTE Buffer;
  251. HSOCKET16 hSocket;
  252. } SEND16;
  253. typedef SEND16 UNALIGNED *PSEND16;
  254. typedef struct _SENDTO16 { /* ws20 */
  255. WORD AddressLength;
  256. VPSOCKADDR Address;
  257. WORD Flags;
  258. WORD BufferLength;
  259. VPBYTE Buffer;
  260. HSOCKET16 hSocket;
  261. } SENDTO16;
  262. typedef SENDTO16 UNALIGNED *PSENDTO16;
  263. typedef struct _SETSOCKOPT16 { /* ws21 */
  264. WORD OptionLength;
  265. VPBYTE OptionValue;
  266. WORD OptionName;
  267. WORD Level;
  268. HSOCKET16 hSocket;
  269. } SETSOCKOPT16;
  270. typedef SETSOCKOPT16 UNALIGNED *PSETSOCKOPT16;
  271. typedef struct _SHUTDOWN16 { /* ws22 */
  272. WORD How;
  273. HSOCKET16 hSocket;
  274. } SHUTDOWN16;
  275. typedef SHUTDOWN16 UNALIGNED *PSHUTDOWN16;
  276. typedef struct _SOCKET16 { /* ws23 */
  277. WORD Protocol;
  278. WORD Type;
  279. WORD AddressFamily;
  280. } SOCKET16;
  281. typedef SOCKET16 UNALIGNED *PSOCKET16;
  282. typedef struct _GETHOSTBYADDR16 { /* ws51 */
  283. WORD Type;
  284. WORD Length;
  285. VPBYTE Address;
  286. } GETHOSTBYADDR16;
  287. typedef GETHOSTBYADDR16 UNALIGNED *PGETHOSTBYADDR16;
  288. typedef struct _GETHOSTBYNAME16 { /* ws52 */
  289. VPSZ Name;
  290. } GETHOSTBYNAME16;
  291. typedef GETHOSTBYNAME16 UNALIGNED *PGETHOSTBYNAME16;
  292. typedef struct _GETPROTOBYNAME16 { /* ws53 */
  293. VPSZ Name;
  294. } GETPROTOBYNAME16;
  295. typedef GETPROTOBYNAME16 UNALIGNED *PGETPROTOBYNAME16;
  296. typedef struct _GETPROTOBYNUMBER16 { /* ws54 */
  297. WORD Protocol;
  298. } GETPROTOBYNUMBER16;
  299. typedef GETPROTOBYNUMBER16 UNALIGNED *PGETPROTOBYNUMBER16;
  300. typedef struct _GETSERVBYNAME16 { /* ws55 */
  301. VPSZ Protocol;
  302. VPSZ Name;
  303. } GETSERVBYNAME16;
  304. typedef GETSERVBYNAME16 UNALIGNED *PGETSERVBYNAME16;
  305. typedef struct _GETSERVBYPORT16 { /* ws56 */
  306. VPSZ Protocol;
  307. WORD Port;
  308. } GETSERVBYPORT16;
  309. typedef GETSERVBYPORT16 UNALIGNED *PGETSERVBYPORT16;
  310. typedef struct _GETHOSTNAME16 { /* ws57 */
  311. WORD NameLength;
  312. VPSZ Name;
  313. } GETHOSTNAME16;
  314. typedef GETHOSTNAME16 UNALIGNED *PGETHOSTNAME16;
  315. typedef struct _WSAASYNCSELECT16 { /* ws101 */
  316. DWORD lEvent;
  317. WORD wMsg;
  318. HWND16 hWnd;
  319. HSOCKET16 hSocket;
  320. } WSAASYNCSELECT16;
  321. typedef WSAASYNCSELECT16 UNALIGNED *PWSAASYNCSELECT16;
  322. typedef struct _WSAASYNCGETHOSTBYADDR16 { /* ws102 */
  323. WORD BufferLength;
  324. VPBYTE Buffer;
  325. WORD Type;
  326. WORD Length;
  327. VPBYTE Address;
  328. WORD wMsg;
  329. HWND16 hWnd;
  330. } WSAASYNCGETHOSTBYADDR16;
  331. typedef WSAASYNCGETHOSTBYADDR16 UNALIGNED *PWSAASYNCGETHOSTBYADDR16;
  332. typedef struct _WSAASYNCGETHOSTBYNAME16 { /* ws103 */
  333. WORD BufferLength;
  334. VPBYTE Buffer;
  335. VPSZ Name;
  336. WORD wMsg;
  337. HWND16 hWnd;
  338. } WSAASYNCGETHOSTBYNAME16;
  339. typedef WSAASYNCGETHOSTBYNAME16 UNALIGNED *PWSAASYNCGETHOSTBYNAME16;
  340. typedef struct _WSAASYNCGETPROTOBYNUMBER16 { /* ws104 */
  341. WORD BufferLength;
  342. VPBYTE Buffer;
  343. WORD Number;
  344. WORD wMsg;
  345. HWND16 hWnd;
  346. } WSAASYNCGETPROTOBYNUMBER16;
  347. typedef WSAASYNCGETPROTOBYNUMBER16 UNALIGNED *PWSAASYNCGETPROTOBYNUMBER16;
  348. typedef struct _WSAASYNCGETPROTOBYNAME16 { /* ws105 */
  349. WORD BufferLength;
  350. VPBYTE Buffer;
  351. VPSZ Name;
  352. WORD wMsg;
  353. HWND16 hWnd;
  354. } WSAASYNCGETPROTOBYNAME16;
  355. typedef WSAASYNCGETPROTOBYNAME16 UNALIGNED *PWSAASYNCGETPROTOBYNAME16;
  356. typedef struct _WSAASYNCGETSERVBYPORT16 { /* ws106 */
  357. WORD BufferLength;
  358. VPBYTE Buffer;
  359. VPSZ Protocol;
  360. WORD Port;
  361. WORD wMsg;
  362. HWND16 hWnd;
  363. } WSAASYNCGETSERVBYPORT16;
  364. typedef WSAASYNCGETSERVBYPORT16 UNALIGNED *PWSAASYNCGETSERVBYPORT16;
  365. typedef struct _WSAASYNCGETSERVBYNAME16 { /* ws107 */
  366. WORD BufferLength;
  367. VPBYTE Buffer;
  368. VPSZ Protocol;
  369. VPSZ Name;
  370. WORD wMsg;
  371. HWND16 hWnd;
  372. } WSAASYNCGETSERVBYNAME16;
  373. typedef WSAASYNCGETSERVBYNAME16 UNALIGNED *PWSAASYNCGETSERVBYNAME16;
  374. typedef struct _WSACANCELASYNCREQUEST16 { /* ws108 */
  375. WORD hAsyncTaskHandle;
  376. } WSACANCELASYNCREQUEST16;
  377. typedef WSACANCELASYNCREQUEST16 UNALIGNED *PWSACANCELASYNCREQUEST16;
  378. typedef struct _WSASETBLOCKINGHOOK16 { /* ws109 */
  379. VPWNDPROC lpBlockFunc;
  380. } WSASETBLOCKINGHOOK16;
  381. typedef WSASETBLOCKINGHOOK16 UNALIGNED *PWSASETBLOCKINGHOOK16;
  382. typedef struct _WSASETLASTERROR16 { /* ws112 */
  383. WORD Error;
  384. } WSASETLASTERROR16;
  385. typedef WSASETLASTERROR16 UNALIGNED *PWSASETLASTERROR16;
  386. typedef struct _WSASTARTUP16 { /* ws115 */
  387. VPWSADATA16 lpWSAData;
  388. WORD wVersionRequired;
  389. } WSASTARTUP16;
  390. typedef WSASTARTUP16 UNALIGNED *PWSASTARTUP16;
  391. typedef struct ___WSAFDISSET16 { /* ws151 */
  392. VPFD_SET16 Set;
  393. HSOCKET16 hSocket;
  394. } __WSAFDISSET16;
  395. typedef __WSAFDISSET16 UNALIGNED *P__WSAFDISSET16;
  396. /* XLATOFF */
  397. #pragma pack()
  398. /* XLATON */
  399. #define FUN___WSAFDISSET 151 //