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.

1184 lines
23 KiB

  1. /* WS2SPI.H -- definitions to be used with the WinSock service provider.
  2. *
  3. * Copyright (c) Microsoft Corporation. All rights reserved.
  4. *
  5. * This header file corresponds to version 2.2.x of the WinSock SPI
  6. * specification.
  7. *
  8. * This file includes parts which are Copyright (c) 1982-1986 Regents
  9. * of the University of California. All rights reserved. The
  10. * Berkeley Software License Agreement specifies the terms and
  11. * conditions for redistribution.
  12. */
  13. #ifndef _WINSOCK2SPI_
  14. #define _WINSOCK2SPI_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. /*
  19. * Ensure structures are packed consistently.
  20. */
  21. #if !defined(_WIN64)
  22. #include <pshpack4.h>
  23. #endif
  24. /*
  25. * Pull in WINSOCK2.H if necessary
  26. */
  27. #ifndef _WINSOCK2API_
  28. #include <winsock2.h>
  29. #endif /* _WINSOCK2API_ */
  30. #define WSPDESCRIPTION_LEN 255
  31. #define WSS_OPERATION_IN_PROGRESS 0x00000103L
  32. typedef struct WSPData {
  33. WORD wVersion;
  34. WORD wHighVersion;
  35. WCHAR szDescription[WSPDESCRIPTION_LEN+1];
  36. } WSPDATA, FAR * LPWSPDATA;
  37. typedef struct _WSATHREADID {
  38. HANDLE ThreadHandle;
  39. DWORD_PTR Reserved;
  40. } WSATHREADID, FAR * LPWSATHREADID;
  41. /*
  42. * SPI function linkage.
  43. */
  44. #define WSPAPI WSAAPI
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. /*
  49. * Pointer to a blocking callback. A pointer to a blocking callback is
  50. * returned from the WPUQueryBlockingCallback() upcall. Note that this
  51. * function's signature is not identical to an application's blocking
  52. * hook function.
  53. */
  54. typedef
  55. BOOL
  56. (CALLBACK FAR * LPBLOCKINGCALLBACK)(
  57. DWORD_PTR dwContext
  58. );
  59. /*
  60. * Pointer to a user APC function. This is used as a parameter to the
  61. * WPUQueueUserApc() upcall. Note that this function's signature is not
  62. * identical to an application's completion routine.
  63. */
  64. typedef
  65. VOID
  66. (CALLBACK FAR * LPWSAUSERAPC)(
  67. DWORD_PTR dwContext
  68. );
  69. /*
  70. * Pointers to the individual entries in a service provider's proc table.
  71. */
  72. typedef
  73. SOCKET
  74. (WSPAPI * LPWSPACCEPT)(
  75. SOCKET s,
  76. struct sockaddr FAR * addr,
  77. LPINT addrlen,
  78. LPCONDITIONPROC lpfnCondition,
  79. DWORD_PTR dwCallbackData,
  80. LPINT lpErrno
  81. );
  82. typedef
  83. INT
  84. (WSPAPI * LPWSPADDRESSTOSTRING)(
  85. LPSOCKADDR lpsaAddress,
  86. DWORD dwAddressLength,
  87. LPWSAPROTOCOL_INFOW lpProtocolInfo,
  88. LPWSTR lpszAddressString,
  89. LPDWORD lpdwAddressStringLength,
  90. LPINT lpErrno
  91. );
  92. typedef
  93. int
  94. (WSPAPI * LPWSPASYNCSELECT)(
  95. SOCKET s,
  96. HWND hWnd,
  97. unsigned int wMsg,
  98. long lEvent,
  99. LPINT lpErrno
  100. );
  101. typedef
  102. int
  103. (WSPAPI * LPWSPBIND)(
  104. SOCKET s,
  105. const struct sockaddr FAR * name,
  106. int namelen,
  107. LPINT lpErrno
  108. );
  109. typedef
  110. int
  111. (WSPAPI * LPWSPCANCELBLOCKINGCALL)(
  112. LPINT lpErrno
  113. );
  114. typedef
  115. int
  116. (WSPAPI * LPWSPCLEANUP)(
  117. LPINT lpErrno
  118. );
  119. typedef
  120. int
  121. (WSPAPI * LPWSPCLOSESOCKET)(
  122. SOCKET s,
  123. LPINT lpErrno
  124. );
  125. typedef
  126. int
  127. (WSPAPI * LPWSPCONNECT)(
  128. SOCKET s,
  129. const struct sockaddr FAR * name,
  130. int namelen,
  131. LPWSABUF lpCallerData,
  132. LPWSABUF lpCalleeData,
  133. LPQOS lpSQOS,
  134. LPQOS lpGQOS,
  135. LPINT lpErrno
  136. );
  137. typedef
  138. int
  139. (WSPAPI * LPWSPDUPLICATESOCKET)(
  140. SOCKET s,
  141. DWORD dwProcessId,
  142. LPWSAPROTOCOL_INFOW lpProtocolInfo,
  143. LPINT lpErrno
  144. );
  145. typedef
  146. int
  147. (WSPAPI * LPWSPENUMNETWORKEVENTS)(
  148. SOCKET s,
  149. WSAEVENT hEventObject,
  150. LPWSANETWORKEVENTS lpNetworkEvents,
  151. LPINT lpErrno
  152. );
  153. typedef
  154. int
  155. (WSPAPI * LPWSPEVENTSELECT)(
  156. SOCKET s,
  157. WSAEVENT hEventObject,
  158. long lNetworkEvents,
  159. LPINT lpErrno
  160. );
  161. typedef
  162. BOOL
  163. (WSPAPI * LPWSPGETOVERLAPPEDRESULT)(
  164. SOCKET s,
  165. LPWSAOVERLAPPED lpOverlapped,
  166. LPDWORD lpcbTransfer,
  167. BOOL fWait,
  168. LPDWORD lpdwFlags,
  169. LPINT lpErrno
  170. );
  171. typedef
  172. int
  173. (WSPAPI * LPWSPGETPEERNAME)(
  174. SOCKET s,
  175. struct sockaddr FAR * name,
  176. LPINT namelen,
  177. LPINT lpErrno
  178. );
  179. typedef
  180. int
  181. (WSPAPI * LPWSPGETSOCKNAME)(
  182. SOCKET s,
  183. struct sockaddr FAR * name,
  184. LPINT namelen,
  185. LPINT lpErrno
  186. );
  187. typedef
  188. int
  189. (WSPAPI * LPWSPGETSOCKOPT)(
  190. SOCKET s,
  191. int level,
  192. int optname,
  193. char FAR * optval,
  194. LPINT optlen,
  195. LPINT lpErrno
  196. );
  197. typedef
  198. BOOL
  199. (WSPAPI * LPWSPGETQOSBYNAME)(
  200. SOCKET s,
  201. LPWSABUF lpQOSName,
  202. LPQOS lpQOS,
  203. LPINT lpErrno
  204. );
  205. typedef
  206. int
  207. (WSPAPI * LPWSPIOCTL)(
  208. SOCKET s,
  209. DWORD dwIoControlCode,
  210. LPVOID lpvInBuffer,
  211. DWORD cbInBuffer,
  212. LPVOID lpvOutBuffer,
  213. DWORD cbOutBuffer,
  214. LPDWORD lpcbBytesReturned,
  215. LPWSAOVERLAPPED lpOverlapped,
  216. LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
  217. LPWSATHREADID lpThreadId,
  218. LPINT lpErrno
  219. );
  220. typedef
  221. SOCKET
  222. (WSPAPI * LPWSPJOINLEAF)(
  223. SOCKET s,
  224. const struct sockaddr FAR * name,
  225. int namelen,
  226. LPWSABUF lpCallerData,
  227. LPWSABUF lpCalleeData,
  228. LPQOS lpSQOS,
  229. LPQOS lpGQOS,
  230. DWORD dwFlags,
  231. LPINT lpErrno
  232. );
  233. typedef
  234. int
  235. (WSPAPI * LPWSPLISTEN)(
  236. SOCKET s,
  237. int backlog,
  238. LPINT lpErrno
  239. );
  240. typedef
  241. int
  242. (WSPAPI * LPWSPRECV)(
  243. SOCKET s,
  244. LPWSABUF lpBuffers,
  245. DWORD dwBufferCount,
  246. LPDWORD lpNumberOfBytesRecvd,
  247. LPDWORD lpFlags,
  248. LPWSAOVERLAPPED lpOverlapped,
  249. LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
  250. LPWSATHREADID lpThreadId,
  251. LPINT lpErrno
  252. );
  253. typedef
  254. int
  255. (WSPAPI * LPWSPRECVDISCONNECT)(
  256. SOCKET s,
  257. LPWSABUF lpInboundDisconnectData,
  258. LPINT lpErrno
  259. );
  260. typedef
  261. int
  262. (WSPAPI * LPWSPRECVFROM)(
  263. SOCKET s,
  264. LPWSABUF lpBuffers,
  265. DWORD dwBufferCount,
  266. LPDWORD lpNumberOfBytesRecvd,
  267. LPDWORD lpFlags,
  268. struct sockaddr FAR * lpFrom,
  269. LPINT lpFromlen,
  270. LPWSAOVERLAPPED lpOverlapped,
  271. LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
  272. LPWSATHREADID lpThreadId,
  273. LPINT lpErrno
  274. );
  275. typedef
  276. int
  277. (WSPAPI * LPWSPSELECT)(
  278. int nfds,
  279. fd_set FAR * readfds,
  280. fd_set FAR * writefds,
  281. fd_set FAR * exceptfds,
  282. const struct timeval FAR * timeout,
  283. LPINT lpErrno
  284. );
  285. typedef
  286. int
  287. (WSPAPI * LPWSPSEND)(
  288. SOCKET s,
  289. LPWSABUF lpBuffers,
  290. DWORD dwBufferCount,
  291. LPDWORD lpNumberOfBytesSent,
  292. DWORD dwFlags,
  293. LPWSAOVERLAPPED lpOverlapped,
  294. LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
  295. LPWSATHREADID lpThreadId,
  296. LPINT lpErrno
  297. );
  298. typedef
  299. int
  300. (WSPAPI * LPWSPSENDDISCONNECT)(
  301. SOCKET s,
  302. LPWSABUF lpOutboundDisconnectData,
  303. LPINT lpErrno
  304. );
  305. typedef
  306. int
  307. (WSPAPI * LPWSPSENDTO)(
  308. SOCKET s,
  309. LPWSABUF lpBuffers,
  310. DWORD dwBufferCount,
  311. LPDWORD lpNumberOfBytesSent,
  312. DWORD dwFlags,
  313. const struct sockaddr FAR * lpTo,
  314. int iTolen,
  315. LPWSAOVERLAPPED lpOverlapped,
  316. LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
  317. LPWSATHREADID lpThreadId,
  318. LPINT lpErrno
  319. );
  320. typedef
  321. int
  322. (WSPAPI * LPWSPSETSOCKOPT)(
  323. SOCKET s,
  324. int level,
  325. int optname,
  326. const char FAR * optval,
  327. int optlen,
  328. LPINT lpErrno
  329. );
  330. typedef
  331. int
  332. (WSPAPI * LPWSPSHUTDOWN)(
  333. SOCKET s,
  334. int how,
  335. LPINT lpErrno
  336. );
  337. typedef
  338. SOCKET
  339. (WSPAPI * LPWSPSOCKET)(
  340. int af,
  341. int type,
  342. int protocol,
  343. LPWSAPROTOCOL_INFOW lpProtocolInfo,
  344. GROUP g,
  345. DWORD dwFlags,
  346. LPINT lpErrno
  347. );
  348. typedef
  349. INT
  350. (WSPAPI * LPWSPSTRINGTOADDRESS)(
  351. LPWSTR AddressString,
  352. INT AddressFamily,
  353. LPWSAPROTOCOL_INFOW lpProtocolInfo,
  354. LPSOCKADDR lpAddress,
  355. LPINT lpAddressLength,
  356. LPINT lpErrno
  357. );
  358. /*
  359. * A service provider proc table. This structure is returned by value
  360. * from the service provider's WSPStartup() entrypoint.
  361. */
  362. typedef struct _WSPPROC_TABLE {
  363. LPWSPACCEPT lpWSPAccept;
  364. LPWSPADDRESSTOSTRING lpWSPAddressToString;
  365. LPWSPASYNCSELECT lpWSPAsyncSelect;
  366. LPWSPBIND lpWSPBind;
  367. LPWSPCANCELBLOCKINGCALL lpWSPCancelBlockingCall;
  368. LPWSPCLEANUP lpWSPCleanup;
  369. LPWSPCLOSESOCKET lpWSPCloseSocket;
  370. LPWSPCONNECT lpWSPConnect;
  371. LPWSPDUPLICATESOCKET lpWSPDuplicateSocket;
  372. LPWSPENUMNETWORKEVENTS lpWSPEnumNetworkEvents;
  373. LPWSPEVENTSELECT lpWSPEventSelect;
  374. LPWSPGETOVERLAPPEDRESULT lpWSPGetOverlappedResult;
  375. LPWSPGETPEERNAME lpWSPGetPeerName;
  376. LPWSPGETSOCKNAME lpWSPGetSockName;
  377. LPWSPGETSOCKOPT lpWSPGetSockOpt;
  378. LPWSPGETQOSBYNAME lpWSPGetQOSByName;
  379. LPWSPIOCTL lpWSPIoctl;
  380. LPWSPJOINLEAF lpWSPJoinLeaf;
  381. LPWSPLISTEN lpWSPListen;
  382. LPWSPRECV lpWSPRecv;
  383. LPWSPRECVDISCONNECT lpWSPRecvDisconnect;
  384. LPWSPRECVFROM lpWSPRecvFrom;
  385. LPWSPSELECT lpWSPSelect;
  386. LPWSPSEND lpWSPSend;
  387. LPWSPSENDDISCONNECT lpWSPSendDisconnect;
  388. LPWSPSENDTO lpWSPSendTo;
  389. LPWSPSETSOCKOPT lpWSPSetSockOpt;
  390. LPWSPSHUTDOWN lpWSPShutdown;
  391. LPWSPSOCKET lpWSPSocket;
  392. LPWSPSTRINGTOADDRESS lpWSPStringToAddress;
  393. } WSPPROC_TABLE, FAR * LPWSPPROC_TABLE;
  394. /*
  395. * Pointers to the individual entries in the upcall table.
  396. */
  397. typedef
  398. BOOL
  399. (WSPAPI * LPWPUCLOSEEVENT)(
  400. WSAEVENT hEvent,
  401. LPINT lpErrno
  402. );
  403. typedef
  404. int
  405. (WSPAPI * LPWPUCLOSESOCKETHANDLE)(
  406. SOCKET s,
  407. LPINT lpErrno
  408. );
  409. typedef
  410. WSAEVENT
  411. (WSPAPI * LPWPUCREATEEVENT)(
  412. LPINT lpErrno
  413. );
  414. typedef
  415. SOCKET
  416. (WSPAPI * LPWPUCREATESOCKETHANDLE)(
  417. DWORD dwCatalogEntryId,
  418. DWORD_PTR dwContext,
  419. LPINT lpErrno
  420. );
  421. typedef
  422. int
  423. (WSPAPI * LPWPUFDISSET)(
  424. SOCKET s,
  425. fd_set FAR * fdset
  426. );
  427. typedef
  428. int
  429. (WSPAPI * LPWPUGETPROVIDERPATH)(
  430. LPGUID lpProviderId,
  431. WCHAR FAR * lpszProviderDllPath,
  432. LPINT lpProviderDllPathLen,
  433. LPINT lpErrno
  434. );
  435. typedef
  436. SOCKET
  437. (WSPAPI * LPWPUMODIFYIFSHANDLE)(
  438. DWORD dwCatalogEntryId,
  439. SOCKET ProposedHandle,
  440. LPINT lpErrno
  441. );
  442. typedef
  443. BOOL
  444. (WSPAPI * LPWPUPOSTMESSAGE)(
  445. HWND hWnd,
  446. UINT Msg,
  447. WPARAM wParam,
  448. LPARAM lParam
  449. );
  450. typedef
  451. int
  452. (WSPAPI * LPWPUQUERYBLOCKINGCALLBACK)(
  453. DWORD dwCatalogEntryId,
  454. LPBLOCKINGCALLBACK FAR * lplpfnCallback,
  455. PDWORD_PTR lpdwContext,
  456. LPINT lpErrno
  457. );
  458. typedef
  459. int
  460. (WSPAPI * LPWPUQUERYSOCKETHANDLECONTEXT)(
  461. SOCKET s,
  462. PDWORD_PTR lpContext,
  463. LPINT lpErrno
  464. );
  465. typedef
  466. int
  467. (WSPAPI * LPWPUQUEUEAPC)(
  468. LPWSATHREADID lpThreadId,
  469. LPWSAUSERAPC lpfnUserApc,
  470. DWORD_PTR dwContext,
  471. LPINT lpErrno
  472. );
  473. typedef
  474. BOOL
  475. (WSPAPI * LPWPURESETEVENT)(
  476. WSAEVENT hEvent,
  477. LPINT lpErrno
  478. );
  479. typedef
  480. BOOL
  481. (WSPAPI * LPWPUSETEVENT)(
  482. WSAEVENT hEvent,
  483. LPINT lpErrno
  484. );
  485. typedef
  486. int
  487. (WSPAPI * LPWPUOPENCURRENTTHREAD)(
  488. LPWSATHREADID lpThreadId,
  489. LPINT lpErrno
  490. );
  491. typedef
  492. int
  493. (WSPAPI * LPWPUCLOSETHREAD)(
  494. LPWSATHREADID lpThreadId,
  495. LPINT lpErrno
  496. );
  497. // Available only directly from ws2_32.dll
  498. typedef
  499. int
  500. (WSPAPI * LPWPUCOMPLETEOVERLAPPEDREQUEST) (
  501. IN SOCKET s,
  502. LPWSAOVERLAPPED lpOverlapped,
  503. DWORD dwError,
  504. DWORD cbTransferred,
  505. LPINT lpErrno
  506. );
  507. /*
  508. * The upcall table. This structure is passed by value to the service
  509. * provider's WSPStartup() entrypoint.
  510. */
  511. typedef struct _WSPUPCALLTABLE {
  512. LPWPUCLOSEEVENT lpWPUCloseEvent;
  513. LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle;
  514. LPWPUCREATEEVENT lpWPUCreateEvent;
  515. LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle;
  516. LPWPUFDISSET lpWPUFDIsSet;
  517. LPWPUGETPROVIDERPATH lpWPUGetProviderPath;
  518. LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle;
  519. LPWPUPOSTMESSAGE lpWPUPostMessage;
  520. LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback;
  521. LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext;
  522. LPWPUQUEUEAPC lpWPUQueueApc;
  523. LPWPURESETEVENT lpWPUResetEvent;
  524. LPWPUSETEVENT lpWPUSetEvent;
  525. LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread;
  526. LPWPUCLOSETHREAD lpWPUCloseThread;
  527. } WSPUPCALLTABLE, FAR * LPWSPUPCALLTABLE;
  528. /*
  529. * WinSock 2 SPI socket function prototypes
  530. */
  531. int
  532. WSPAPI
  533. WSPStartup(
  534. IN WORD wVersionRequested,
  535. OUT LPWSPDATA lpWSPData,
  536. IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
  537. IN WSPUPCALLTABLE UpcallTable,
  538. OUT LPWSPPROC_TABLE lpProcTable
  539. );
  540. typedef
  541. int
  542. (WSPAPI * LPWSPSTARTUP)(
  543. WORD wVersionRequested,
  544. LPWSPDATA lpWSPData,
  545. LPWSAPROTOCOL_INFOW lpProtocolInfo,
  546. WSPUPCALLTABLE UpcallTable,
  547. LPWSPPROC_TABLE lpProcTable
  548. );
  549. /*
  550. * Installation and configuration entrypoints.
  551. */
  552. int
  553. WSPAPI
  554. WSCEnumProtocols(
  555. IN LPINT lpiProtocols,
  556. OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer,
  557. IN OUT LPDWORD lpdwBufferLength,
  558. OUT LPINT lpErrno
  559. );
  560. typedef
  561. int
  562. (WSPAPI * LPWSCENUMPROTOCOLS)(
  563. LPINT lpiProtocols,
  564. LPWSAPROTOCOL_INFOW lpProtocolBuffer,
  565. LPDWORD lpdwBufferLength,
  566. LPINT lpErrno
  567. );
  568. #if defined(_WIN64)
  569. /*
  570. * 64-bit architectures capable of running 32-bit code have
  571. * separate 64-bit and 32-bit catalogs. API with '32' prefix
  572. * allow 32 bit catalog manipulations by 64 bit process.
  573. */
  574. int
  575. WSPAPI
  576. WSCEnumProtocols32(
  577. IN LPINT lpiProtocols,
  578. OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer,
  579. IN OUT LPDWORD lpdwBufferLength,
  580. OUT LPINT lpErrno
  581. );
  582. #endif
  583. int
  584. WSPAPI
  585. WSCDeinstallProvider(
  586. IN LPGUID lpProviderId,
  587. OUT LPINT lpErrno
  588. );
  589. typedef
  590. int
  591. (WSPAPI * LPWSCDEINSTALLPROVIDER)(
  592. LPGUID lpProviderId,
  593. LPINT lpErrno
  594. );
  595. #if defined(_WIN64)
  596. int
  597. WSPAPI
  598. WSCDeinstallProvider32(
  599. IN LPGUID lpProviderId,
  600. OUT LPINT lpErrno
  601. );
  602. #endif
  603. int
  604. WSPAPI
  605. WSCInstallProvider(
  606. IN LPGUID lpProviderId,
  607. IN const WCHAR FAR * lpszProviderDllPath,
  608. IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
  609. IN DWORD dwNumberOfEntries,
  610. OUT LPINT lpErrno
  611. );
  612. typedef
  613. int
  614. (WSPAPI * LPWSCINSTALLPROVIDER)(
  615. LPGUID lpProviderId,
  616. const WCHAR FAR * lpszProviderDllPath,
  617. const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
  618. DWORD dwNumberOfEntries,
  619. LPINT lpErrno
  620. );
  621. #if defined(_WIN64)
  622. /*
  623. * This API manipulates 64-bit and 32-bit catalogs simulteneously.
  624. * It is needed to guarantee the same catalog IDs for provider catalog
  625. * entries in both 64-bit and 32-bit catalogs.
  626. */
  627. int
  628. WSPAPI
  629. WSCInstallProvider64_32(
  630. IN LPGUID lpProviderId,
  631. IN const WCHAR FAR * lpszProviderDllPath,
  632. IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
  633. IN DWORD dwNumberOfEntries,
  634. OUT LPINT lpErrno
  635. );
  636. #endif
  637. int
  638. WSPAPI
  639. WSCGetProviderPath(
  640. IN LPGUID lpProviderId,
  641. OUT WCHAR FAR * lpszProviderDllPath,
  642. IN OUT LPINT lpProviderDllPathLen,
  643. OUT LPINT lpErrno
  644. );
  645. typedef
  646. int
  647. (WSPAPI * LPWSCGETPROVIDERPATH)(
  648. LPGUID lpProviderId,
  649. WCHAR FAR * lpszProviderDllPath,
  650. LPINT lpProviderDllPathLen,
  651. LPINT lpErrno
  652. );
  653. #if defined(_WIN64)
  654. int
  655. WSPAPI
  656. WSCGetProviderPath32(
  657. IN LPGUID lpProviderId,
  658. OUT WCHAR FAR * lpszProviderDllPath,
  659. IN OUT LPINT lpProviderDllPathLen,
  660. OUT LPINT lpErrno
  661. );
  662. #endif
  663. int
  664. WSPAPI
  665. WSCUpdateProvider(
  666. IN LPGUID lpProviderId,
  667. IN const WCHAR FAR * lpszProviderDllPath,
  668. IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
  669. IN DWORD dwNumberOfEntries,
  670. OUT LPINT lpErrno
  671. );
  672. typedef
  673. int
  674. (WSPAPI * LPWSCUPDATEPROVIDER)(
  675. LPGUID lpProviderId,
  676. const WCHAR FAR * lpszProviderDllPath,
  677. const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
  678. DWORD dwNumberOfEntries,
  679. LPINT lpErrno
  680. );
  681. #if defined(_WIN64)
  682. int
  683. WSPAPI
  684. WSCUpdateProvider32(
  685. IN LPGUID lpProviderId,
  686. IN const WCHAR FAR * lpszProviderDllPath,
  687. IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
  688. IN DWORD dwNumberOfEntries,
  689. OUT LPINT lpErrno
  690. );
  691. #endif
  692. int
  693. WSPAPI
  694. WSCInstallQOSTemplate (
  695. IN const LPGUID Guid,
  696. IN LPWSABUF QosName,
  697. IN LPQOS Qos
  698. );
  699. typedef
  700. int
  701. (WSPAPI * LPWSCINSTALLQOSTEMPLATE)(
  702. const LPGUID Guid,
  703. LPWSABUF QosName,
  704. LPQOS Qos
  705. );
  706. int
  707. WSPAPI
  708. WSCRemoveQOSTemplate (
  709. IN const LPGUID Guid,
  710. IN LPWSABUF QosName
  711. );
  712. typedef
  713. int
  714. (WSPAPI * LPWSCREMOVEQOSTEMPLATE)(
  715. const LPGUID Guid,
  716. LPWSABUF QosName
  717. );
  718. /*
  719. * The following upcall function prototypes are only used by WinSock 2 DLL and
  720. * should not be used by any service providers.
  721. */
  722. BOOL
  723. WSPAPI
  724. WPUCloseEvent(
  725. IN WSAEVENT hEvent,
  726. OUT LPINT lpErrno
  727. );
  728. int
  729. WSPAPI
  730. WPUCloseSocketHandle(
  731. IN SOCKET s,
  732. OUT LPINT lpErrno
  733. );
  734. WSAEVENT
  735. WSPAPI
  736. WPUCreateEvent(
  737. OUT LPINT lpErrno
  738. );
  739. SOCKET
  740. WSPAPI
  741. WPUCreateSocketHandle(
  742. IN DWORD dwCatalogEntryId,
  743. IN DWORD_PTR dwContext,
  744. OUT LPINT lpErrno
  745. );
  746. int
  747. WSPAPI
  748. WPUFDIsSet(
  749. IN SOCKET s,
  750. IN fd_set FAR * fdset
  751. );
  752. int
  753. WSPAPI
  754. WPUGetProviderPath(
  755. IN LPGUID lpProviderId,
  756. OUT WCHAR FAR * lpszProviderDllPath,
  757. IN OUT LPINT lpProviderDllPathLen,
  758. OUT LPINT lpErrno
  759. );
  760. SOCKET
  761. WSPAPI
  762. WPUModifyIFSHandle(
  763. IN DWORD dwCatalogEntryId,
  764. IN SOCKET ProposedHandle,
  765. OUT LPINT lpErrno
  766. );
  767. BOOL
  768. WSPAPI
  769. WPUPostMessage(
  770. IN HWND hWnd,
  771. IN UINT Msg,
  772. IN WPARAM wParam,
  773. IN LPARAM lParam
  774. );
  775. int
  776. WSPAPI
  777. WPUQueryBlockingCallback(
  778. IN DWORD dwCatalogEntryId,
  779. OUT LPBLOCKINGCALLBACK FAR * lplpfnCallback,
  780. OUT PDWORD_PTR lpdwContext,
  781. OUT LPINT lpErrno
  782. );
  783. int
  784. WSPAPI
  785. WPUQuerySocketHandleContext(
  786. IN SOCKET s,
  787. OUT PDWORD_PTR lpContext,
  788. OUT LPINT lpErrno
  789. );
  790. int
  791. WSPAPI
  792. WPUQueueApc(
  793. IN LPWSATHREADID lpThreadId,
  794. IN LPWSAUSERAPC lpfnUserApc,
  795. IN DWORD_PTR dwContext,
  796. OUT LPINT lpErrno
  797. );
  798. BOOL
  799. WSPAPI
  800. WPUResetEvent(
  801. IN WSAEVENT hEvent,
  802. OUT LPINT lpErrno
  803. );
  804. BOOL
  805. WSPAPI
  806. WPUSetEvent(
  807. IN WSAEVENT hEvent,
  808. OUT LPINT lpErrno
  809. );
  810. int
  811. WSPAPI
  812. WPUCompleteOverlappedRequest (
  813. SOCKET s,
  814. LPWSAOVERLAPPED lpOverlapped,
  815. DWORD dwError,
  816. DWORD cbTransferred,
  817. LPINT lpErrno
  818. );
  819. int
  820. WSPAPI
  821. WPUOpenCurrentThread(
  822. LPWSATHREADID lpThreadId,
  823. LPINT lpErrno
  824. );
  825. int
  826. WSPAPI
  827. WPUCloseThread(
  828. LPWSATHREADID lpThreadId,
  829. LPINT lpErrno
  830. );
  831. /*
  832. * Installing and uninstalling name space providers.
  833. */
  834. /*
  835. * SPI and API for enumerating name space providers are
  836. * currently equivalent since there is no concept of a hidden
  837. * name space provider
  838. */
  839. #define WSCEnumNameSpaceProviders WSAEnumNameSpaceProvidersW
  840. #define LPFN_WSCENUMNAMESPACEPROVIDERS LPFN_WSAENUMNAMESPACEPROVIDERSW
  841. #if defined(_WIN64)
  842. INT
  843. WSAAPI
  844. WSCEnumNameSpaceProviders32(
  845. IN OUT LPDWORD lpdwBufferLength,
  846. OUT LPWSANAMESPACE_INFOW lpnspBuffer
  847. );
  848. #endif
  849. INT
  850. WSPAPI
  851. WSCInstallNameSpace (
  852. IN LPWSTR lpszIdentifier,
  853. IN LPWSTR lpszPathName,
  854. IN DWORD dwNameSpace,
  855. IN DWORD dwVersion,
  856. IN LPGUID lpProviderId
  857. );
  858. typedef
  859. INT
  860. (WSPAPI * LPWSCINSTALLNAMESPACE)(
  861. LPWSTR lpszIdentifier,
  862. LPWSTR lpszPathName,
  863. DWORD dwNameSpace,
  864. DWORD dwVersion,
  865. LPGUID lpProviderId
  866. );
  867. #if defined(_WIN64)
  868. INT
  869. WSPAPI
  870. WSCInstallNameSpace32 (
  871. IN LPWSTR lpszIdentifier,
  872. IN LPWSTR lpszPathName,
  873. IN DWORD dwNameSpace,
  874. IN DWORD dwVersion,
  875. IN LPGUID lpProviderId
  876. );
  877. #endif
  878. INT
  879. WSPAPI
  880. WSCUnInstallNameSpace (
  881. IN LPGUID lpProviderId
  882. );
  883. typedef
  884. INT
  885. (WSPAPI * LPWSCUNINSTALLNAMESPACE)(
  886. LPGUID lpProviderId
  887. );
  888. #if defined(_WIN64)
  889. INT
  890. WSPAPI
  891. WSCUnInstallNameSpace32 (
  892. IN LPGUID lpProviderId
  893. );
  894. #endif
  895. INT
  896. WSPAPI
  897. WSCEnableNSProvider (
  898. IN LPGUID lpProviderId,
  899. IN BOOL fEnable
  900. );
  901. typedef
  902. INT
  903. (WSPAPI * LPWSCENABLENSPROVIDER)(
  904. LPGUID lpProviderId,
  905. BOOL fEnable
  906. );
  907. #if defined(_WIN64)
  908. INT
  909. WSPAPI
  910. WSCEnableNSProvider32 (
  911. IN LPGUID lpProviderId,
  912. IN BOOL fEnable
  913. );
  914. #endif
  915. /*
  916. * Pointers to the individual entries in the namespace proc table.
  917. */
  918. typedef
  919. INT
  920. (WSAAPI * LPNSPCLEANUP)(
  921. LPGUID lpProviderId
  922. );
  923. typedef
  924. INT
  925. (WSAAPI * LPNSPLOOKUPSERVICEBEGIN)(
  926. LPGUID lpProviderId,
  927. LPWSAQUERYSETW lpqsRestrictions,
  928. LPWSASERVICECLASSINFOW lpServiceClassInfo,
  929. DWORD dwControlFlags,
  930. LPHANDLE lphLookup
  931. );
  932. typedef
  933. INT
  934. (WSAAPI * LPNSPLOOKUPSERVICENEXT)(
  935. HANDLE hLookup,
  936. DWORD dwControlFlags,
  937. LPDWORD lpdwBufferLength,
  938. LPWSAQUERYSETW lpqsResults
  939. );
  940. typedef
  941. INT
  942. (WSAAPI * LPNSPIOCTL)(
  943. HANDLE hLookup,
  944. DWORD dwControlCode,
  945. LPVOID lpvInBuffer,
  946. DWORD cbInBuffer,
  947. LPVOID lpvOutBuffer,
  948. DWORD cbOutBuffer,
  949. LPDWORD lpcbBytesReturned,
  950. LPWSACOMPLETION lpCompletion,
  951. LPWSATHREADID lpThreadId
  952. );
  953. typedef
  954. INT
  955. (WSAAPI * LPNSPLOOKUPSERVICEEND)(
  956. HANDLE hLookup
  957. );
  958. typedef
  959. INT
  960. (WSAAPI * LPNSPSETSERVICE)(
  961. LPGUID lpProviderId,
  962. LPWSASERVICECLASSINFOW lpServiceClassInfo,
  963. LPWSAQUERYSETW lpqsRegInfo,
  964. WSAESETSERVICEOP essOperation,
  965. DWORD dwControlFlags
  966. );
  967. typedef
  968. INT
  969. (WSAAPI * LPNSPINSTALLSERVICECLASS)(
  970. LPGUID lpProviderId,
  971. LPWSASERVICECLASSINFOW lpServiceClassInfo
  972. );
  973. typedef
  974. INT
  975. (WSAAPI * LPNSPREMOVESERVICECLASS)(
  976. LPGUID lpProviderId,
  977. LPGUID lpServiceClassId
  978. );
  979. typedef
  980. INT
  981. (WSAAPI * LPNSPGETSERVICECLASSINFO)(
  982. LPGUID lpProviderId,
  983. LPDWORD lpdwBufSize,
  984. LPWSASERVICECLASSINFOW lpServiceClassInfo
  985. );
  986. /*
  987. * The name space service provider procedure table.
  988. */
  989. typedef struct _NSP_ROUTINE {
  990. /* Structure version information: */
  991. DWORD cbSize;
  992. DWORD dwMajorVersion;
  993. DWORD dwMinorVersion;
  994. /* Procedure-pointer table: */
  995. LPNSPCLEANUP NSPCleanup;
  996. LPNSPLOOKUPSERVICEBEGIN NSPLookupServiceBegin;
  997. LPNSPLOOKUPSERVICENEXT NSPLookupServiceNext;
  998. LPNSPLOOKUPSERVICEEND NSPLookupServiceEnd;
  999. LPNSPSETSERVICE NSPSetService;
  1000. LPNSPINSTALLSERVICECLASS NSPInstallServiceClass;
  1001. LPNSPREMOVESERVICECLASS NSPRemoveServiceClass;
  1002. LPNSPGETSERVICECLASSINFO NSPGetServiceClassInfo;
  1003. // These APIs were added later, so must appear here
  1004. // to keep the pointers in the structure in order.
  1005. // Namespaces unaware of these APIs will set cbSize
  1006. // to match the size of FIELD_OFFSET(NSP_ROUTINE, NSPIoctl).
  1007. LPNSPIOCTL NSPIoctl;
  1008. } NSP_ROUTINE, FAR * LPNSP_ROUTINE;
  1009. /*
  1010. * Startup procedures.
  1011. */
  1012. INT
  1013. WSAAPI
  1014. NSPStartup(
  1015. LPGUID lpProviderId,
  1016. LPNSP_ROUTINE lpnspRoutines
  1017. );
  1018. typedef
  1019. INT
  1020. (WSAAPI * LPNSPSTARTUP)(
  1021. LPGUID lpProviderId,
  1022. LPNSP_ROUTINE lpnspRoutines
  1023. );
  1024. #ifdef __cplusplus
  1025. }
  1026. #endif
  1027. #if !defined(_WIN64)
  1028. #include <poppack.h>
  1029. #endif
  1030. #endif /* _WINSOCK2SPI_ */