[PSDK]
authorAmine Khaldi <amine.khaldi@reactos.org>
Tue, 30 Mar 2010 13:24:23 +0000 (13:24 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Tue, 30 Mar 2010 13:24:23 +0000 (13:24 +0000)
- Improve ws2spi.h

svn path=/branches/header-work/; revision=46596

include/psdk/ws2spi.h

index c34e0b8..998f199 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
  */
-#ifndef _WS2SPI_H
+#pragma once
+
 #define _WS2SPI_H
 
+#ifndef _WINSOCK2API_
 #include <winsock2.h>
+#endif
 
 #ifdef __cplusplus
 extern "C" {
-#endif /* __cplusplus */
+#endif
+
+#if !defined(_WIN64)
+#include <pshpack4.h>
+#endif
 
-#define WSPAPI WSAAPI
 #define WSPDESCRIPTION_LEN 255
 
-#ifndef RC_INVOKED
+#define WSS_OPERATION_IN_PROGRESS 0x00000103L
+
+#define WSPAPI WSAAPI
 
 typedef struct WSPData {
-       WORD wVersion;
-       WORD wHighVersion;
-       WCHAR szDescription[WSPDESCRIPTION_LEN+1];
+  WORD wVersion;
+  WORD wHighVersion;
+  WCHAR szDescription[WSPDESCRIPTION_LEN+1];
 } WSPDATA, FAR *LPWSPDATA;
+
 typedef struct _WSATHREADID {
-       HANDLE ThreadHandle;
-       DWORD Reserved;
+  HANDLE ThreadHandle;
+  DWORD_PTR Reserved;
 } WSATHREADID, FAR *LPWSATHREADID;
 
-typedef BOOL (CALLBACK FAR *LPBLOCKINGCALLBACK)(DWORD);
-typedef VOID (CALLBACK FAR *LPWSAUSERAPC)(DWORD);
-
-/* Prototypes for service provider procedure table */
-typedef SOCKET (WSPAPI *LPWSPACCEPT)(SOCKET,LPSOCKADDR,LPINT,LPCONDITIONPROC,DWORD,LPINT);
-typedef INT (WSPAPI *LPWSPADDRESSTOSTRING)(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD,LPINT);
-typedef INT (WSPAPI *LPWSPASYNCSELECT)(SOCKET,HWND,UINT,LONG,LPINT);
-typedef INT (WSPAPI *LPWSPBIND)(SOCKET,const struct sockaddr*,INT,LPINT);
-typedef INT (WSPAPI *LPWSPCANCELBLOCKINGCALL)(LPINT);
-typedef INT (WSPAPI *LPWSPCLEANUP)(LPINT);
-typedef INT (WSPAPI *LPWSPCLOSESOCKET)(SOCKET,LPINT);
-typedef INT (WSPAPI *LPWSPCONNECT)(SOCKET,const struct sockaddr*,INT,LPWSABUF,LPWSABUF,LPQOS,LPQOS,LPINT);
-typedef INT (WSPAPI *LPWSPDUPLICATESOCKET)(SOCKET,DWORD,LPWSAPROTOCOL_INFOW,LPINT);
-typedef INT (WSPAPI *LPWSPENUMNETWORKEVENTS)(SOCKET,WSAEVENT,LPWSANETWORKEVENTS,LPINT);
-typedef INT (WSPAPI *LPWSPEVENTSELECT)(SOCKET,WSAEVENT,LONG,LPINT);
-typedef BOOL (WSPAPI *LPWSPGETOVERLAPPEDRESULT)(SOCKET,LPWSAOVERLAPPED,LPDWORD,BOOL,LPDWORD,LPINT);
-typedef INT (WSPAPI *LPWSPGETPEERNAME)(SOCKET,LPSOCKADDR,LPINT,LPINT);
-typedef BOOL (WSPAPI *LPWSPGETQOSBYNAME)(SOCKET,LPWSABUF,LPQOS,LPINT);
-typedef INT (WSPAPI *LPWSPGETSOCKNAME)(SOCKET,LPSOCKADDR,LPINT,LPINT);
-typedef INT (WSPAPI *LPWSPGETSOCKOPT)(SOCKET,INT,INT,CHAR FAR*,LPINT,LPINT);
-typedef INT (WSPAPI *LPWSPIOCTL)(SOCKET,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,
-            LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPWSATHREADID,LPINT);
-typedef SOCKET (WSPAPI *LPWSPJOINLEAF)(SOCKET,const struct sockaddr*,INT,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD,LPINT);
-typedef INT (WSPAPI *LPWSPLISTEN)(SOCKET,INT,LPINT);
-typedef INT (WSPAPI *LPWSPRECV)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,
-LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPWSATHREADID,LPINT);
-typedef INT (WSPAPI *LPWSPRECVDISCONNECT)(SOCKET,LPWSABUF,LPINT);
-typedef INT (WSPAPI *LPWSPRECVFROM)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,LPSOCKADDR,
-LPINT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPWSATHREADID,LPINT);
-typedef INT (WSPAPI *LPWSPSELECT)(INT,LPFD_SET,LPFD_SET,LPFD_SET,CONST LPTIMEVAL,LPINT);
-typedef INT (WSPAPI *LPWSPSEND)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,
-LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPWSATHREADID,LPINT);
-typedef INT (WSPAPI *LPWSPSENDDISCONNECT)(SOCKET,LPWSABUF,LPINT);
-typedef INT (WSPAPI *LPWSPSENDTO)(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,const struct sockaddr*,
-            INT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE,LPWSATHREADID,LPINT);
-typedef INT (WSPAPI *LPWSPSETSOCKOPT)(SOCKET,INT,INT,CONST CHAR FAR*,INT,LPINT);
-typedef INT (WSPAPI *LPWSPSHUTDOWN)(SOCKET,INT,LPINT);
-typedef SOCKET (WSPAPI *LPWSPSOCKET)(INT,INT,INT,LPWSAPROTOCOL_INFOW,GROUP,DWORD,LPINT);
-typedef INT (WSPAPI *LPWSPSTRINGTOADDRESS)(LPWSTR,INT,LPWSAPROTOCOL_INFOW,LPSOCKADDR,LPINT,LPINT);
-
 /* Service provider procedure table */
 typedef struct _WSPPROC_TABLE {
   LPWSPACCEPT lpWSPAccept;
@@ -113,16 +82,48 @@ typedef struct _WSPPROC_TABLE {
   LPWSPSTRINGTOADDRESS lpWSPStringToAddress;
 } WSPPROC_TABLE, FAR* LPWSPPROC_TABLE;
 
-/* Prototypes for service provider namespace procedure table */
-typedef INT (WSAAPI *LPNSPCLEANUP)(LPGUID);
-typedef INT (WSAAPI *LPNSPLOOKUPSERVICEBEGIN)(LPGUID,LPWSAQUERYSETW,LPWSASERVICECLASSINFOW,DWORD,LPHANDLE);
-typedef INT (WSAAPI *LPNSPLOOKUPSERVICENEXT)(HANDLE,DWORD,LPDWORD,LPWSAQUERYSETW);
-typedef INT (WSAAPI *LPNSPLOOKUPSERVICEEND)(HANDLE);
-typedef INT (WSAAPI *LPNSPSETSERVICE)(LPGUID,LPWSASERVICECLASSINFOW,LPWSAQUERYSETW,WSAESETSERVICEOP,DWORD);
-typedef INT (WSAAPI *LPNSPINSTALLSERVICECLASS)(LPGUID,LPWSASERVICECLASSINFOW);
-typedef INT (WSAAPI *LPNSPREMOVESERVICECLASS)(LPGUID,LPGUID);
-typedef INT (WSAAPI *LPNSPGETSERVICECLASSINFO)(LPGUID,LPDWORD,LPWSASERVICECLASSINFOW);
-typedef INT (WSAAPI *LPNSPIOCTL)(HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSACOMPLETION,LPWSATHREADID);
+/* Service Provider upcall table */
+typedef struct _WSPUPCALLTABLE {
+  LPWPUCLOSEEVENT lpWPUCloseEvent;
+  LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle;
+  LPWPUCREATEEVENT lpWPUCreateEvent;
+  LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle;
+  LPWPUFDISSET lpWPUFDIsSet;
+  LPWPUGETPROVIDERPATH lpWPUGetProviderPath;
+  LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle;
+  LPWPUPOSTMESSAGE lpWPUPostMessage;
+  LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback;
+  LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext;
+  LPWPUQUEUEAPC lpWPUQueueApc;
+  LPWPURESETEVENT lpWPUResetEvent;
+  LPWPUSETEVENT lpWPUSetEvent;
+  LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread;
+  LPWPUCLOSETHREAD lpWPUCloseThread;
+} WSPUPCALLTABLE, FAR* LPWSPUPCALLTABLE;
+
+#if(_WIN32_WINNT >= 0x0600)
+
+#define LSP_SYSTEM             0x80000000
+#define LSP_INSPECTOR          0x00000001
+#define LSP_REDIRECTOR         0x00000002
+#define LSP_PROXY              0x00000004
+#define LSP_FIREWALL           0x00000008
+#define LSP_INBOUND_MODIFY     0x00000010
+#define LSP_OUTBOUND_MODIFY    0x00000020
+#define LSP_CRYPTO_COMPRESS    0x00000040
+#define LSP_LOCAL_CACHE        0x00000080
+
+typedef enum _WSC_PROVIDER_INFO_TYPE {
+  ProviderInfoLspCategories,
+  ProviderInfoAudit
+} WSC_PROVIDER_INFO_TYPE ;
+
+typedef struct _WSC_PROVIDER_AUDIT_INFO {
+  DWORD RecordSize;
+  PVOID Reserved;
+} WSC_PROVIDER_AUDIT_INFO;
+
+#endif /* (_WIN32_WINNT >= 0x0600) */
 
 typedef struct _NSP_ROUTINE {
   DWORD cbSize;
@@ -139,80 +140,976 @@ typedef struct _NSP_ROUTINE {
   LPNSPIOCTL NSPIoctl;
 } NSP_ROUTINE, *PNSP_ROUTINE, FAR* LPNSP_ROUTINE;
 
-/* Prototypes for service provider upcall procedure table */
-typedef BOOL (WSPAPI *LPWPUCLOSEEVENT)(WSAEVENT,LPINT);
-typedef INT (WSPAPI *LPWPUCLOSESOCKETHANDLE)(SOCKET,LPINT);
-typedef INT (WSPAPI *LPWPUCLOSETHREAD)(LPWSATHREADID,LPINT);
-typedef WSAEVENT (WSPAPI *LPWPUCREATEEVENT)(LPINT);
-typedef SOCKET (WSPAPI *LPWPUCREATESOCKETHANDLE)(DWORD,DWORD_PTR,LPINT);
-typedef INT (WSPAPI *LPWPUFDISSET)(SOCKET,LPFD_SET);
-typedef INT (WSPAPI *LPWPUGETPROVIDERPATH)(LPGUID,LPWSTR,LPINT,LPINT);
-typedef SOCKET (WSPAPI *LPWPUMODIFYIFSHANDLE)(DWORD,SOCKET,LPINT);
-typedef INT (WSPAPI *LPWPUOPENCURRENTTHREAD)(LPWSATHREADID,LPINT);
-typedef BOOL (WSPAPI *LPWPUPOSTMESSAGE)(HWND,UINT,WPARAM,LPARAM);
-typedef INT (WSPAPI *LPWPUQUERYBLOCKINGCALLBACK)(DWORD,LPBLOCKINGCALLBACK FAR*,PDWORD_PTR,LPINT);
-typedef INT (WSPAPI *LPWPUQUERYSOCKETHANDLECONTEXT)(SOCKET,PDWORD_PTR,LPINT);
-typedef INT (WSPAPI *LPWPUQUEUEAPC)(LPWSATHREADID,LPWSAUSERAPC,DWORD_PTR,LPINT);
-typedef BOOL (WSPAPI *LPWPURESETEVENT)(WSAEVENT,LPINT);
-typedef BOOL (WSPAPI *LPWPUSETEVENT)(WSAEVENT,LPINT);
-typedef INT (WSAAPI *LPNSPSTARTUP)(LPGUID,LPNSP_ROUTINE);
-/* Available only directly from the DLL */
-typedef INT (WSPAPI *LPWPUCOMPLETEOVERLAPPEDREQUEST)(SOCKET,LPWSAOVERLAPPED,DWORD,DWORD,LPINT);
+typedef struct _NSPV2_ROUTINE {
+  DWORD cbSize;
+  DWORD dwMajorVersion;
+  DWORD dwMinorVersion;
+  LPNSPV2STARTUP NSPv2Startup;
+  LPNSPV2CLEANUP NSPv2Cleanup;
+  LPNSPV2LOOKUPSERVICEBEGIN NSPv2LookupServiceBegin;  
+  LPNSPV2LOOKUPSERVICENEXTEX NSPv2LookupServiceNextEx;
+  LPNSPV2LOOKUPSERVICEEND NSPv2LookupServiceEnd;  
+  LPNSPV2SETSERVICEEX NSPv2SetServiceEx;
+  LPNSPV2CLIENTSESSIONRUNDOWN NSPv2ClientSessionRundown;
+} NSPV2_ROUTINE, *PNSPV2_ROUTINE, *LPNSPV2_ROUTINE;
+typedef const NSPV2_ROUTINE *PCNSPV2_ROUTINE, *LPCNSPV2_ROUTINE;
 
-/* Service Provider upcall table */
-typedef struct _WSPUPCALLTABLE {
-       LPWPUCLOSEEVENT lpWPUCloseEvent;
-       LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle;
-       LPWPUCREATEEVENT lpWPUCreateEvent;
-       LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle;
-       LPWPUFDISSET lpWPUFDIsSet;
-       LPWPUGETPROVIDERPATH lpWPUGetProviderPath;
-       LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle;
-       LPWPUPOSTMESSAGE lpWPUPostMessage;
-       LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback;
-       LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext;
-       LPWPUQUEUEAPC lpWPUQueueApc;
-       LPWPURESETEVENT lpWPUResetEvent;
-       LPWPUSETEVENT lpWPUSetEvent;
-       LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread;
-       LPWPUCLOSETHREAD lpWPUCloseThread;
-} WSPUPCALLTABLE, FAR* LPWSPUPCALLTABLE;
+typedef BOOL
+(CALLBACK FAR *LPBLOCKINGCALLBACK)(
+  DWORD_PTR dwContext);
+
+typedef VOID
+(CALLBACK FAR *LPWSAUSERAPC)(
+  DWORD_PTR dwContext);
+
+typedef SOCKET
+(WSPAPI *LPWSPACCEPT)(
+  IN SOCKET s,
+  OUT struct sockaddr FAR *addr OPTIONAL,
+  IN OUT LPINT addrlen OPTIONAL,
+  IN LPCONDITIONPROC lpfnCondition OPTIONAL,
+  IN DWORD_PTR dwCallbackData OPTIONAL,
+  OUT LPINT lpErrno);
+
+typedef INT
+(WSPAPI *LPWSPADDRESSTOSTRING)(
+  IN LPSOCKADDR lpsaAddress,
+  IN DWORD dwAddressLength,
+  IN LPWSAPROTOCOL_INFOW lpProtocolInfo OPTIONAL,
+  OUT LPWSTR lpszAddressString,
+  IN OUT LPDWORD lpdwAddressStringLength,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPASYNCSELECT)(
+  IN SOCKET s,
+  IN HWND hWnd,
+  IN unsigned int wMsg,
+  IN long lEvent,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPBIND)(
+  IN SOCKET s,
+  IN const struct sockaddr FAR *name,
+  IN int namelen,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPCANCELBLOCKINGCALL)(
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPCLEANUP)(
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPCLOSESOCKET)(
+  IN SOCKET s,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPCONNECT)(
+  IN SOCKET s,
+  IN const struct sockaddr FAR *name,
+  IN int namelen,
+  IN LPWSABUF lpCallerData OPTIONAL,
+  OUT LPWSABUF lpCalleeData OPTIONAL,
+  IN LPQOS lpSQOS OPTIONAL,
+  IN LPQOS lpGQOS OPTIONAL,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPDUPLICATESOCKET)(
+  IN SOCKET s,
+  IN DWORD dwProcessId,
+  OUT LPWSAPROTOCOL_INFOW lpProtocolInfo,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPENUMNETWORKEVENTS)(
+  IN SOCKET s,
+  IN WSAEVENT hEventObject,
+  OUT LPWSANETWORKEVENTS lpNetworkEvents,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPEVENTSELECT)(
+  IN SOCKET s,
+  IN WSAEVENT hEventObject,
+  IN long lNetworkEvents,
+  OUT LPINT lpErrno);
+
+typedef BOOL
+(WSPAPI *LPWSPGETOVERLAPPEDRESULT)(
+  IN SOCKET s,
+  IN LPWSAOVERLAPPED lpOverlapped,
+  OUT LPDWORD lpcbTransfer,
+  IN BOOL fWait,
+  OUT LPDWORD lpdwFlags,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPGETPEERNAME)(
+  IN SOCKET s,
+  OUT struct sockaddr FAR *name,
+  IN OUT LPINT namelen,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPGETSOCKNAME)(
+  IN SOCKET s,
+  OUT struct sockaddr FAR *name,
+  IN OUT LPINT namelen,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPGETSOCKOPT)(
+  IN SOCKET s,
+  IN int level,
+  IN int optname,
+  OUT char FAR *optval,
+  IN OUT LPINT optlen,
+  OUT LPINT lpErrno);
+
+typedef BOOL
+(WSPAPI *LPWSPGETQOSBYNAME)(
+  IN SOCKET s,
+  IN LPWSABUF lpQOSName,
+  OUT LPQOS lpQOS,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPIOCTL)(
+  IN SOCKET s,
+  IN DWORD dwIoControlCode,
+  IN LPVOID lpvInBuffer OPTIONAL,
+  IN DWORD cbInBuffer,
+  OUT LPVOID lpvOutBuffer OPTIONAL,
+  IN DWORD cbOutBuffer,
+  OUT LPDWORD lpcbBytesReturned,
+  IN OUT LPWSAOVERLAPPED lpOverlapped OPTIONAL,
+  IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
+  IN LPWSATHREADID lpThreadId OPTIONAL,
+  OUT LPINT lpErrno);
+
+typedef SOCKET
+(WSPAPI *LPWSPJOINLEAF)(
+  IN SOCKET s,
+  IN const struct sockaddr FAR *name,
+  IN int namelen,
+  IN LPWSABUF lpCallerData OPTIONAL,
+  OUT LPWSABUF lpCalleeData OPTIONAL,
+  IN LPQOS lpSQOS OPTIONAL,
+  IN LPQOS lpGQOS OPTIONAL,
+  IN DWORD dwFlags,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPLISTEN)(
+  IN SOCKET s,
+  IN int backlog,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPRECV)(
+  IN SOCKET s,
+  IN LPWSABUF lpBuffers,
+  IN DWORD dwBufferCount,
+  OUT LPDWORD lpNumberOfBytesRecvd OPTIONAL,
+  IN OUT LPDWORD lpFlags,
+  IN OUT LPWSAOVERLAPPED lpOverlapped OPTIONAL,
+  IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
+  IN LPWSATHREADID lpThreadId OPTIONAL,
+  IN LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPRECVDISCONNECT)(
+  IN SOCKET s,
+  IN LPWSABUF lpInboundDisconnectData OPTIONAL,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPRECVFROM)(
+  IN SOCKET s,
+  IN LPWSABUF lpBuffers,
+  IN DWORD dwBufferCount,
+  OUT LPDWORD lpNumberOfBytesRecvd OPTIONAL,
+  IN OUT LPDWORD lpFlags,
+  OUT struct sockaddr FAR *lpFrom OPTIONAL,
+  IN OUT LPINT lpFromlen OPTIONAL,
+  IN OUT LPWSAOVERLAPPED lpOverlapped OPTIONAL,
+  IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
+  IN LPWSATHREADID lpThreadId OPTIONAL,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPSELECT)(
+  IN int nfds,
+  IN OUT fd_set FAR *readfds OPTIONAL,
+  IN OUT fd_set FAR *writefds OPTIONAL,
+  IN OUT fd_set FAR *exceptfds OPTIONAL,
+  IN const struct timeval FAR *timeout OPTIONAL,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPSEND)(
+  IN SOCKET s,
+  IN LPWSABUF lpBuffers,
+  IN DWORD dwBufferCount,
+  OUT LPDWORD lpNumberOfBytesSent OPTIONAL,
+  IN DWORD dwFlags,
+  IN OUT LPWSAOVERLAPPED lpOverlapped OPTIONAL,
+  IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
+  IN LPWSATHREADID lpThreadId OPTIONAL,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPSENDDISCONNECT)(
+  IN SOCKET s,
+  IN LPWSABUF lpOutboundDisconnectData OPTIONAL,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPSENDTO)(
+  IN SOCKET s,
+  IN LPWSABUF lpBuffers,
+  IN DWORD dwBufferCount,
+  OUT LPDWORD lpNumberOfBytesSent OPTIONAL,
+  IN DWORD dwFlags,
+  IN const struct sockaddr FAR *lpTo OPTIONAL,
+  IN int iTolen,
+  IN OUT LPWSAOVERLAPPED lpOverlapped OPTIONAL,
+  IN LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine OPTIONAL,
+  IN LPWSATHREADID lpThreadId OPTIONAL,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPSETSOCKOPT)(
+  IN SOCKET s,
+  IN int level,
+  IN int optname,
+  IN const char FAR *optval OPTIONAL,
+  IN int optlen,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPSHUTDOWN)(
+  IN SOCKET s,
+  IN int how,
+  OUT LPINT lpErrno);
+
+typedef SOCKET
+(WSPAPI *LPWSPSOCKET)(
+  IN int af,
+  IN int type,
+  IN int protocol,
+  IN LPWSAPROTOCOL_INFOW lpProtocolInfo OPTIONAL,
+  IN GROUP g,
+  IN DWORD dwFlags,
+  OUT LPINT lpErrno);
+
+typedef INT
+(WSPAPI *LPWSPSTRINGTOADDRESS)(
+  IN LPWSTR AddressString,
+  IN INT AddressFamily,
+  IN LPWSAPROTOCOL_INFOW lpProtocolInfo OPTIONAL,
+  OUT LPSOCKADDR lpAddress,
+  IN OUT LPINT lpAddressLength,
+  OUT LPINT lpErrno);
+
+typedef BOOL
+(WSPAPI *LPWPUCLOSEEVENT)(
+  IN WSAEVENT hEvent,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWPUCLOSESOCKETHANDLE)(
+  IN SOCKET s,
+  OUT LPINT lpErrno);
+
+typedef WSAEVENT
+(WSPAPI *LPWPUCREATEEVENT)(
+  OUT LPINT lpErrno);
+
+typedef SOCKET
+(WSPAPI *LPWPUCREATESOCKETHANDLE)(
+  IN DWORD dwCatalogEntryId,
+  IN DWORD_PTR dwContext,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWPUFDISSET)(
+  IN SOCKET s,
+  IN fd_set FAR *fdset);
+
+typedef int
+(WSPAPI *LPWPUGETPROVIDERPATH)(
+  IN LPGUID lpProviderId,
+  OUT WCHAR FAR *lpszProviderDllPath,
+  IN OUT LPINT lpProviderDllPathLen,
+  OUT LPINT lpErrno);
+
+typedef SOCKET
+(WSPAPI *LPWPUMODIFYIFSHANDLE)(
+  IN DWORD dwCatalogEntryId,
+  IN SOCKET ProposedHandle,
+  OUT LPINT lpErrno);
+
+typedef BOOL
+(WSPAPI *LPWPUPOSTMESSAGE)(
+  IN HWND hWnd,
+  IN UINT Msg,
+  IN WPARAM wParam,
+  IN LPARAM lParam);
+
+typedef int
+(WSPAPI *LPWPUQUERYBLOCKINGCALLBACK)(
+  IN DWORD dwCatalogEntryId,
+  OUT LPBLOCKINGCALLBACK FAR *lplpfnCallback,
+  OUT PDWORD_PTR lpdwContext,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWPUQUERYSOCKETHANDLECONTEXT)(
+  IN SOCKET s,
+  OUT PDWORD_PTR lpContext,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWPUQUEUEAPC)(
+  IN LPWSATHREADID lpThreadId,
+  IN LPWSAUSERAPC lpfnUserApc,
+  IN DWORD_PTR dwContext,
+  OUT LPINT lpErrno);
+
+typedef BOOL
+(WSPAPI *LPWPURESETEVENT)(
+  IN WSAEVENT hEvent,
+  OUT LPINT lpErrno);
+
+typedef BOOL
+(WSPAPI *LPWPUSETEVENT)(
+  IN WSAEVENT hEvent,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWPUOPENCURRENTTHREAD)(
+  OUT LPWSATHREADID lpThreadId,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWPUCLOSETHREAD)(
+  IN LPWSATHREADID lpThreadId,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWPUCOMPLETEOVERLAPPEDREQUEST)(
+  IN SOCKET s,
+  IN OUT LPWSAOVERLAPPED lpOverlapped,
+  IN DWORD dwError,
+  IN DWORD cbTransferred,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSPSTARTUP)(
+  IN WORD wVersionRequested,
+  IN LPWSPDATA lpWSPData,
+  IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
+  IN WSPUPCALLTABLE UpcallTable,
+  OUT LPWSPPROC_TABLE lpProcTable);
+
+typedef int
+(WSPAPI *LPWSCENUMPROTOCOLS)(
+  IN LPINT lpiProtocols OPTIONAL,
+  OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer OPTIONAL,
+  IN OUT LPDWORD lpdwBufferLength,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSCDEINSTALLPROVIDER)(
+  IN LPGUID lpProviderId,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSCINSTALLPROVIDER)(
+  IN LPGUID lpProviderId,
+  IN const WCHAR FAR *lpszProviderDllPath,
+  IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
+  IN DWORD dwNumberOfEntries,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSCGETPROVIDERPATH)(
+  IN LPGUID lpProviderId,
+  OUT WCHAR FAR *lpszProviderDllPath,
+  IN OUT LPINT lpProviderDllPathLen,
+  OUT LPINT lpErrno);
+
+typedef INT
+(WSPAPI *LPWSCINSTALLNAMESPACE)(
+  IN LPWSTR lpszIdentifier,
+  IN LPWSTR lpszPathName,
+  IN DWORD dwNameSpace,
+  IN DWORD dwVersion,
+  IN LPGUID lpProviderId);
+
+typedef INT
+(WSPAPI *LPWSCUNINSTALLNAMESPACE)(
+  IN LPGUID lpProviderId);
+
+typedef INT
+(WSPAPI *LPWSCENABLENSPROVIDER)(
+  IN LPGUID lpProviderId,
+  IN BOOL fEnable);
+
+typedef INT
+(WSAAPI *LPNSPCLEANUP)(
+  IN LPGUID lpProviderId);
+
+typedef INT
+(WSAAPI *LPNSPLOOKUPSERVICEBEGIN)(
+  IN LPGUID lpProviderId,
+  IN LPWSAQUERYSETW lpqsRestrictions,
+  IN LPWSASERVICECLASSINFOW lpServiceClassInfo,
+  IN DWORD dwControlFlags,
+  OUT LPHANDLE lphLookup);
+
+typedef INT
+(WSAAPI *LPNSPLOOKUPSERVICENEXT)(
+  IN HANDLE hLookup,
+  IN DWORD dwControlFlags,
+  IN OUT LPDWORD lpdwBufferLength,
+  OUT LPWSAQUERYSETW lpqsResults);
+
+#if(_WIN32_WINNT >= 0x0501)
+typedef INT
+(WSAAPI *LPNSPIOCTL)(
+  IN HANDLE hLookup,
+  IN DWORD dwControlCode,
+  IN LPVOID lpvInBuffer,
+  IN DWORD cbInBuffer,
+  OUT LPVOID lpvOutBuffer,
+  IN DWORD cbOutBuffer,
+  OUT LPDWORD lpcbBytesReturned,
+  IN LPWSACOMPLETION lpCompletion OPTIONAL,
+  IN LPWSATHREADID lpThreadId);
+#endif
 
-typedef INT (WSPAPI *LPWSPSTARTUP)(WORD,LPWSPDATA,LPWSAPROTOCOL_INFOW,WSPUPCALLTABLE,LPWSPPROC_TABLE);
-
-INT WSPAPI NSPStartup(LPGUID,LPNSP_ROUTINE);
-
-/* WinSock 2 DLL function prototypes */
-INT WSPAPI WPUCompleteOverlappedRequest(SOCKET,LPWSAOVERLAPPED,DWORD,DWORD,LPINT);
-INT WSPAPI WSPStartup(WORD,LPWSPDATA,LPWSAPROTOCOL_INFOW,WSPUPCALLTABLE,LPWSPPROC_TABLE);
-INT WSPAPI WSCDeinstallProvider(LPGUID,LPINT);
-INT WSPAPI WSCEnumProtocols(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD,LPINT);
-INT WSPAPI WSCGetProviderPath(LPGUID,LPWSTR,LPINT,LPINT);
-INT WSPAPI WSCInstallProvider(LPGUID,CONST WCHAR*,CONST LPWSAPROTOCOL_INFOW,DWORD,LPINT);
-INT WSPAPI WSCEnableNSProvider(LPGUID,BOOL);
-INT WSPAPI WSCInstallNameSpace(LPWSTR,LPWSTR,DWORD,DWORD,LPGUID);
-INT WSPAPI WSCUnInstallNameSpace(LPGUID);
-INT WSPAPI WSCWriteProviderOrder(LPDWORD,DWORD);
-BOOL WSPAPI WPUPostMessage(HWND,UINT,WPARAM,LPARAM);
-BOOL WSPAPI WPUCloseEvent(WSAEVENT,LPINT);
-int WSPAPI WPUCloseSocketHandle(SOCKET,LPINT);
-WSAEVENT WSPAPI WPUCreateEvent(LPINT);
-SOCKET WSPAPI WPUModifyIFSHandle(DWORD,SOCKET,LPINT);
-SOCKET WSPAPI WPUCreateSocketHandle(DWORD,DWORD_PTR,LPINT);
-int WSPAPI WPUFDIsSet(SOCKET,LPFD_SET);
-int WSPAPI WPUGetProviderPath(LPGUID,WCHAR FAR*,LPINT,LPINT);
-int WSPAPI WPUQueryBlockingCallback(DWORD,LPBLOCKINGCALLBACK FAR*,PDWORD_PTR,LPINT);
-int WSPAPI WPUQuerySocketHandleContext(SOCKET,PDWORD_PTR,LPINT);
-int WSPAPI WPUQueueApc(LPWSATHREADID,LPWSAUSERAPC,DWORD_PTR,LPINT);
-BOOL WSPAPI WPUResetEvent(WSAEVENT,LPINT);
-BOOL WSPAPI WPUSetEvent(WSAEVENT,LPINT);
-int WSPAPI WPUOpenCurrentThread(LPWSATHREADID,LPINT);
-int WSPAPI WPUCloseThread(LPWSATHREADID,LPINT);
-
-#endif /* RC_INVOKED */
+typedef INT
+(WSAAPI *LPNSPLOOKUPSERVICEEND)(
+  IN HANDLE hLookup);
+
+typedef INT
+(WSAAPI *LPNSPSETSERVICE)(
+  IN LPGUID lpProviderId,
+  IN LPWSASERVICECLASSINFOW lpServiceClassInfo,
+  IN LPWSAQUERYSETW lpqsRegInfo,
+  IN WSAESETSERVICEOP essOperation,
+  IN DWORD dwControlFlags);
+
+typedef INT
+(WSAAPI *LPNSPINSTALLSERVICECLASS)(
+  IN LPGUID lpProviderId,
+  IN LPWSASERVICECLASSINFOW lpServiceClassInfo);
+
+typedef INT
+(WSAAPI *LPNSPREMOVESERVICECLASS)(
+  IN LPGUID lpProviderId,
+  IN LPGUID lpServiceClassId);
+
+typedef INT
+(WSAAPI *LPNSPGETSERVICECLASSINFO)(
+  IN LPGUID lpProviderId,
+  IN LPDWORD lpdwBufSize,
+  IN LPWSASERVICECLASSINFOW lpServiceClassInfo);
+
+typedef INT
+(WSAAPI *LPNSPSTARTUP)(
+  IN LPGUID lpProviderId,
+  IN OUT LPNSP_ROUTINE lpnspRoutines);
+
+typedef INT
+(WSAAPI *LPNSPV2STARTUP)(
+  IN LPGUID lpProviderId,
+  OUT LPVOID *ppvClientSessionArg);
+
+typedef INT
+(WSAAPI *LPNSPV2CLEANUP)(
+  IN LPGUID lpProviderId,
+  IN LPVOID pvClientSessionArg);
+
+typedef INT
+(WSAAPI *LPNSPV2LOOKUPSERVICEBEGIN)(
+  IN LPGUID lpProviderId,
+  IN LPWSAQUERYSET2W lpqsRestrictions,
+  IN DWORD dwControlFlags,
+  IN LPVOID lpvClientSessionArg,
+  OUT LPHANDLE lphLookup);
+
+typedef VOID
+(WSAAPI *LPNSPV2LOOKUPSERVICENEXTEX)(
+  IN HANDLE hAsyncCall,
+  IN HANDLE hLookup,
+  IN DWORD dwControlFlags,
+  IN LPDWORD lpdwBufferLength,
+  OUT LPWSAQUERYSET2W lpqsResults);
+
+typedef INT
+(WSAAPI *LPNSPV2LOOKUPSERVICEEND)(
+  IN HANDLE hLookup);
+
+typedef VOID
+(WSAAPI *LPNSPV2SETSERVICEEX)(
+  IN HANDLE hAsyncCall,
+  IN LPGUID lpProviderId,
+  IN LPWSAQUERYSET2W lpqsRegInfo,
+  IN WSAESETSERVICEOP essOperation,
+  IN DWORD dwControlFlags,
+  IN LPVOID lpvClientSessionArg);
+
+typedef VOID
+(WSAAPI *LPNSPV2CLIENTSESSIONRUNDOWN)(
+  IN LPGUID lpProviderId,
+  IN LPVOID pvClientSessionArg);
+
+int
+WSPAPI
+WSPStartup(
+  IN WORD wVersionRequested,
+  IN LPWSPDATA lpWSPData,
+  IN LPWSAPROTOCOL_INFOW lpProtocolInfo,
+  IN WSPUPCALLTABLE UpcallTable,
+  OUT LPWSPPROC_TABLE lpProcTable);
+
+int
+WSPAPI
+WSCEnumProtocols(
+  IN LPINT lpiProtocols OPTIONAL,
+  OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer OPTIONAL,
+  IN OUT LPDWORD lpdwBufferLength,
+  OUT LPINT lpErrno);
+
+#if defined(_WIN32_WINNT >= 0x0501)
+
+int
+WSPAPI
+WPUOpenCurrentThread(
+  OUT LPWSATHREADID lpThreadId,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WPUCloseThread(
+  IN LPWSATHREADID lpThreadId,
+  OUT LPINT lpErrno);
+
+#define WSCEnumNameSpaceProviders WSAEnumNameSpaceProvidersW
+#define LPFN_WSCENUMNAMESPACEPROVIDERS LPFN_WSAENUMNAMESPACEPROVIDERSW
+
+int
+WSPAPI
+WSCUpdateProvider(
+  IN LPGUID lpProviderId,
+  IN const WCHAR FAR *lpszProviderDllPath,
+  IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
+  IN DWORD dwNumberOfEntries,
+  OUT LPINT lpErrno);
+
+typedef int
+(WSPAPI *LPWSCUPDATEPROVIDER)(
+  IN LPGUID lpProviderId,
+  IN const WCHAR FAR *lpszProviderDllPath,
+  IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
+  IN DWORD dwNumberOfEntries,
+  OUT LPINT lpErrno);
+
+#if defined(_WIN64)
+
+int
+WSPAPI
+WSCEnumProtocols32(
+  IN LPINT lpiProtocols OPTIONAL,
+  OUT LPWSAPROTOCOL_INFOW lpProtocolBuffer,
+  IN OUT LPDWORD lpdwBufferLength,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WSCDeinstallProvider32(
+  IN LPGUID lpProviderId,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WSCInstallProvider64_32(
+  IN LPGUID lpProviderId,
+  IN const WCHAR FAR *lpszProviderDllPath,
+  IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
+  IN DWORD dwNumberOfEntries,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WSCGetProviderPath32(
+  IN LPGUID lpProviderId,
+  OUT WCHAR FAR *lpszProviderDllPath,
+  IN OUT LPINT lpProviderDllPathLen,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WSCUpdateProvider32(
+  IN LPGUID lpProviderId,
+  IN const WCHAR FAR *lpszProviderDllPath,
+  IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
+  IN DWORD dwNumberOfEntries,
+  OUT LPINT lpErrno);
+
+INT
+WSAAPI
+WSCEnumNameSpaceProviders32(
+  IN OUT LPDWORD lpdwBufferLength,
+  OUT LPWSANAMESPACE_INFOW lpnspBuffer);
+
+INT
+WSPAPI
+WSCInstallNameSpace32(
+  IN LPWSTR lpszIdentifier,
+  IN LPWSTR lpszPathName,
+  IN DWORD dwNameSpace,
+  IN DWORD dwVersion,
+  IN LPGUID lpProviderId);
+
+INT
+WSPAPI
+WSCUnInstallNameSpace32(
+  IN LPGUID lpProviderId);
+
+INT
+WSPAPI
+WSCEnableNSProvider32(
+  IN LPGUID lpProviderId,
+  IN BOOL fEnable);
+
+#endif /* defined(_WIN64) */
+
+#endif /* defined(_WIN32_WINNT >= 0x0501) */
+
+int
+WSPAPI
+WSCDeinstallProvider(
+  IN LPGUID lpProviderId,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WSCInstallProvider(
+  IN LPGUID lpProviderId,
+  IN const WCHAR FAR *lpszProviderDllPath,
+  IN const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
+  IN DWORD dwNumberOfEntries,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WSCGetProviderPath(
+  IN LPGUID lpProviderId,
+  OUT WCHAR FAR *lpszProviderDllPath,
+  IN OUT LPINT lpProviderDllPathLen,
+  OUT LPINT lpErrno);
+
+#if (_WIN32_WINNT < 0x0600)
+
+int
+WSPAPI
+WSCInstallQOSTemplate(
+  IN const LPGUID Guid,
+  IN LPWSABUF QosName,
+  IN LPQOS Qos);
+
+typedef int
+(WSPAPI *LPWSCINSTALLQOSTEMPLATE)(
+  IN const LPGUID Guid,
+  IN LPWSABUF QosName,
+  IN LPQOS Qos);
+
+int
+WSPAPI
+WSCRemoveQOSTemplate(
+  IN const LPGUID Guid,
+  IN LPWSABUF QosName);
+
+typedef int
+(WSPAPI *LPWSCREMOVEQOSTEMPLATE)(
+  IN const LPGUID Guid,
+  IN LPWSABUF QosName);
+
+#endif /* (_WIN32_WINNT < 0x0600) */
+
+#if(_WIN32_WINNT >= 0x0600)
+
+int
+WSPAPI
+WSCSetProviderInfo(
+  IN LPGUID lpProviderId,
+  IN WSC_PROVIDER_INFO_TYPE InfoType,
+  IN PBYTE Info,
+  IN size_t InfoSize,
+  IN DWORD Flags,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WSCGetProviderInfo(
+  IN LPGUID lpProviderId,
+  IN WSC_PROVIDER_INFO_TYPE InfoType,
+  OUT PBYTE Info,
+  IN OUT *InfoSize,
+  IN DWORD Flags,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WSCSetApplicationCategory(
+  IN LPCWSTR Path,
+  IN DWORD PathLength,
+  IN LPCWSTR Extra OPTIONAL,
+  IN DWORD ExtraLength,
+  IN DWORD PermittedLspCategories,
+  OUT DWORD *pPrevPermLspCat OPTIONAL,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WSCGetApplicationCategory(
+  IN LPCWSTR Path,
+  IN DWORD PathLength,
+  IN LPCWSTR Extra OPTIONAL,
+  IN DWORD ExtraLength,
+  OUT DWORD *pPermittedLspCategories,
+  OUT LPINT lpErrno);
+
+#define WSCEnumNameSpaceProvidersEx WSAEnumNameSpaceProvidersExW
+#define LPFN_WSCENUMNAMESPACEPROVIDERSEX LPFN_WSAENUMNAMESPACEPROVIDERSEXW
+
+INT
+WSPAPI
+WSCInstallNameSpaceEx(
+  IN LPWSTR lpszIdentifier,
+  IN LPWSTR lpszPathName,
+  IN DWORD dwNameSpace,
+  IN DWORD dwVersion,
+  IN LPGUID lpProviderId,
+  IN LPBLOB lpProviderSpecific);
+
+INT
+WSAAPI
+WSAAdvertiseProvider(
+  IN const GUID *puuidProviderId,
+  IN const LPCNSPV2_ROUTINE pNSPv2Routine);
+
+INT
+WSAAPI
+WSAUnadvertiseProvider(
+  IN const GUID *puuidProviderId);
+
+INT
+WSAAPI
+WSAProviderCompleteAsyncCall(
+  IN HANDLE hAsyncCall,
+  IN INT iRetCode);
+
+#if defined(_WIN64)
+
+int
+WSPAPI
+WSCSetProviderInfo32(
+  IN LPGUID lpProviderId,
+  IN WSC_PROVIDER_INFO_TYPE InfoType,
+  IN PBYTE Info,
+  IN size_t InfoSize,
+  IN DWORD Flags,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WSCGetProviderInfo32(
+  IN LPGUID lpProviderId,
+  IN WSC_PROVIDER_INFO_TYPE InfoType,
+  OUT PBYTE Info,
+  IN OUT size_t *InfoSize,
+  IN DWORD Flags,
+  OUT LPINT lpErrno);
+
+INT
+WSAAPI
+WSCEnumNameSpaceProvidersEx32(
+  IN OUT LPDWORD lpdwBufferLength,
+  OUT LPWSANAMESPACE_INFOEXW lpnspBuffer);
+
+INT
+WSPAPI
+WSCInstallNameSpaceEx32(
+  IN LPWSTR lpszIdentifier,
+  IN LPWSTR lpszPathName,
+  IN DWORD dwNameSpace,
+  IN DWORD dwVersion,
+  IN LPGUID lpProviderId,
+  IN LPBLOB lpProviderSpecific);
+
+#endif /* (_WIN64) */
+
+#if defined(_WIN64)
+int
+WSPAPI
+WSCInstallProviderAndChains64_32(
+#else
+int
+WSPAPI
+WSCInstallProviderAndChains(
+#endif
+  IN LPGUID lpProviderId,
+  IN const LPWSTR lpszProviderDllPath,
+#if defined(_WIN64)
+  IN const LPWSTR lpszProviderDllPath32,
+#endif
+  IN const LPWSTR lpszLspName,
+  IN DWORD dwServiceFlags,
+  IN OUT LPWSAPROTOCOL_INFOW lpProtocolInfoList,
+  IN DWORD dwNumberOfEntries,
+  OUT LPDWORD lpdwCatalogEntryId OPTIONAL,
+  OUT LPINT lpErrno);
+
+#endif /* (_WIN32_WINNT >= 0x0600) */
+
+BOOL
+WSPAPI
+WPUCloseEvent(
+  IN WSAEVENT hEvent,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WPUCloseSocketHandle(
+  IN SOCKET s,
+  OUT LPINT lpErrno);
+
+WSAEVENT
+WSPAPI
+WPUCreateEvent(
+  OUT LPINT lpErrno);
+
+SOCKET
+WSPAPI
+WPUCreateSocketHandle(
+  IN DWORD dwCatalogEntryId,
+  IN DWORD_PTR dwContext,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WPUFDIsSet(
+  IN SOCKET s,
+  IN fd_set FAR *fdset);
+
+int
+WSPAPI
+WPUGetProviderPath(
+  IN LPGUID lpProviderId,
+  OUT WCHAR FAR *lpszProviderDllPath,
+  IN OUT LPINT lpProviderDllPathLen,
+  OUT LPINT lpErrno);
+
+SOCKET
+WSPAPI
+WPUModifyIFSHandle(
+  IN DWORD dwCatalogEntryId,
+  IN SOCKET ProposedHandle,
+  OUT LPINT lpErrno);
+
+BOOL
+WSPAPI
+WPUPostMessage(
+  IN HWND hWnd,
+  IN UINT Msg,
+  IN WPARAM wParam,
+  IN LPARAM lParam);
+
+int
+WSPAPI
+WPUQueryBlockingCallback(
+  IN DWORD dwCatalogEntryId,
+  OUT LPBLOCKINGCALLBACK FAR *lplpfnCallback,
+  OUT PDWORD_PTR lpdwContext,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WPUQuerySocketHandleContext(
+  IN SOCKET s,
+  OUT PDWORD_PTR lpContext,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WPUQueueApc(
+  IN LPWSATHREADID lpThreadId,
+  IN LPWSAUSERAPC lpfnUserApc,
+  IN DWORD_PTR dwContext,
+  OUT LPINT lpErrno);
+
+BOOL
+WSPAPI
+WPUResetEvent(
+  IN WSAEVENT hEvent,
+  OUT LPINT lpErrno);
+
+BOOL
+WSPAPI
+WPUSetEvent(
+  IN WSAEVENT hEvent,
+  OUT LPINT lpErrno);
+
+int
+WSPAPI
+WPUCompleteOverlappedRequest(
+  IN SOCKET s,
+  IN OUT LPWSAOVERLAPPED lpOverlapped,
+  IN DWORD dwError,
+  IN DWORD cbTransferred,
+  OUT LPINT lpErrno);
+
+INT
+WSPAPI
+WSCInstallNameSpace(
+  IN LPWSTR lpszIdentifier,
+  IN LPWSTR lpszPathName,
+  IN DWORD dwNameSpace,
+  IN DWORD dwVersion,
+  IN LPGUID lpProviderId);
+
+INT
+WSPAPI
+WSCUnInstallNameSpace(
+  IN LPGUID lpProviderId);
+
+INT
+WSPAPI
+WSCEnableNSProvider(
+  IN LPGUID lpProviderId,
+  IN BOOL fEnable);
+
+INT
+WSAAPI
+NSPStartup(
+  IN LPGUID lpProviderId,
+  IN OUT LPNSP_ROUTINE lpnspRoutines);
+
+#if !defined(_WIN64)
+#include <poppack.h>
+#endif
 
 #ifdef __cplusplus
 }
-#endif /* __cplusplus */
-
-#endif /* _WS2SPI_H */
+#endif