Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _WINSOCK2SPI_
      7 #define _WINSOCK2SPI_
      8 
      9 #ifndef _WIN64
     10 #include <pshpack4.h>
     11 #endif
     12 
     13 #include <winsock2.h>
     14 
     15 #define WSPDESCRIPTION_LEN 255
     16 
     17 #define WSS_OPERATION_IN_PROGRESS __MSABI_LONG(0x00000103)
     18 
     19 typedef struct WSPData {
     20   WORD wVersion;
     21   WORD wHighVersion;
     22   WCHAR szDescription[WSPDESCRIPTION_LEN+1];
     23 } WSPDATA,*LPWSPDATA;
     24 
     25 typedef struct _WSATHREADID {
     26   HANDLE ThreadHandle;
     27   DWORD_PTR Reserved;
     28 } WSATHREADID,*LPWSATHREADID;
     29 
     30 #define WSPAPI WSAAPI
     31 
     32 #ifdef __cplusplus
     33 extern "C" {
     34 #endif
     35 
     36   typedef WINBOOL (CALLBACK *LPBLOCKINGCALLBACK)(DWORD_PTR dwContext);
     37   typedef VOID (CALLBACK *LPWSAUSERAPC)(DWORD_PTR dwContext);
     38   typedef SOCKET (WSPAPI *LPWSPACCEPT)(SOCKET s,struct sockaddr *addr,LPINT addrlen,LPCONDITIONPROC lpfnCondition,DWORD_PTR dwCallbackData,LPINT lpErrno);
     39   typedef INT (WSPAPI *LPWSPADDRESSTOSTRING)(LPSOCKADDR lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPWSTR lpszAddressString,LPDWORD lpdwAddressStringLength,LPINT lpErrno);
     40   typedef int (WSPAPI *LPWSPASYNCSELECT)(SOCKET s,HWND hWnd,unsigned int wMsg,__LONG32 lEvent,LPINT lpErrno);
     41   typedef int (WSPAPI *LPWSPBIND)(SOCKET s,const struct sockaddr *name,int namelen,LPINT lpErrno);
     42   typedef int (WSPAPI *LPWSPCANCELBLOCKINGCALL)(LPINT lpErrno);
     43   typedef int (WSPAPI *LPWSPCLEANUP)(LPINT lpErrno);
     44   typedef int (WSPAPI *LPWSPCLOSESOCKET)(SOCKET s,LPINT lpErrno);
     45   typedef int (WSPAPI *LPWSPCONNECT)(SOCKET s,const struct sockaddr *name,int namelen,LPWSABUF lpCallerData,LPWSABUF lpCalleeData,LPQOS lpSQOS,LPQOS lpGQOS,LPINT lpErrno);
     46   typedef int (WSPAPI *LPWSPDUPLICATESOCKET)(SOCKET s,DWORD dwProcessId,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPINT lpErrno);
     47   typedef int (WSPAPI *LPWSPENUMNETWORKEVENTS)(SOCKET s,WSAEVENT hEventObject,LPWSANETWORKEVENTS lpNetworkEvents,LPINT lpErrno);
     48   typedef int (WSPAPI *LPWSPEVENTSELECT)(SOCKET s,WSAEVENT hEventObject,__LONG32 lNetworkEvents,LPINT lpErrno);
     49   typedef WINBOOL (WSPAPI *LPWSPGETOVERLAPPEDRESULT)(SOCKET s,LPWSAOVERLAPPED lpOverlapped,LPDWORD lpcbTransfer,WINBOOL fWait,LPDWORD lpdwFlags,LPINT lpErrno);
     50   typedef int (WSPAPI *LPWSPGETPEERNAME)(SOCKET s,struct sockaddr *name,LPINT namelen,LPINT lpErrno);
     51   typedef int (WSPAPI *LPWSPGETSOCKNAME)(SOCKET s,struct sockaddr *name,LPINT namelen,LPINT lpErrno);
     52   typedef int (WSPAPI *LPWSPGETSOCKOPT)(SOCKET s,int level,int optname,char *optval,LPINT optlen,LPINT lpErrno);
     53   typedef WINBOOL (WSPAPI *LPWSPGETQOSBYNAME)(SOCKET s,LPWSABUF lpQOSName,LPQOS lpQOS,LPINT lpErrno);
     54   typedef int (WSPAPI *LPWSPIOCTL)(SOCKET s,DWORD dwIoControlCode,LPVOID lpvInBuffer,DWORD cbInBuffer,LPVOID lpvOutBuffer,DWORD cbOutBuffer,LPDWORD lpcbBytesReturned,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,LPWSATHREADID lpThreadId,LPINT lpErrno);
     55   typedef SOCKET (WSPAPI *LPWSPJOINLEAF)(SOCKET s,const struct sockaddr *name,int namelen,LPWSABUF lpCallerData,LPWSABUF lpCalleeData,LPQOS lpSQOS,LPQOS lpGQOS,DWORD dwFlags,LPINT lpErrno);
     56   typedef int (WSPAPI *LPWSPLISTEN)(SOCKET s,int backlog,LPINT lpErrno);
     57   typedef int (WSPAPI *LPWSPRECV)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,LPDWORD lpFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,LPWSATHREADID lpThreadId,LPINT lpErrno);
     58   typedef int (WSPAPI *LPWSPRECVDISCONNECT)(SOCKET s,LPWSABUF lpInboundDisconnectData,LPINT lpErrno);
     59   typedef int (WSPAPI *LPWSPRECVFROM)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,LPDWORD lpFlags,struct sockaddr *lpFrom,LPINT lpFromlen,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,LPWSATHREADID lpThreadId,LPINT lpErrno);
     60   typedef int (WSPAPI *LPWSPSELECT)(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout,LPINT lpErrno);
     61   typedef int (WSPAPI *LPWSPSEND)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,LPWSATHREADID lpThreadId,LPINT lpErrno);
     62   typedef int (WSPAPI *LPWSPSENDDISCONNECT)(SOCKET s,LPWSABUF lpOutboundDisconnectData,LPINT lpErrno);
     63   typedef int (WSPAPI *LPWSPSENDTO)(SOCKET s,LPWSABUF lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,const struct sockaddr *lpTo,int iTolen,LPWSAOVERLAPPED lpOverlapped,LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,LPWSATHREADID lpThreadId,LPINT lpErrno);
     64   typedef int (WSPAPI *LPWSPSETSOCKOPT)(SOCKET s,int level,int optname,const char *optval,int optlen,LPINT lpErrno);
     65   typedef int (WSPAPI *LPWSPSHUTDOWN)(SOCKET s,int how,LPINT lpErrno);
     66   typedef SOCKET (WSPAPI *LPWSPSOCKET)(int af,int type,int protocol,LPWSAPROTOCOL_INFOW lpProtocolInfo,GROUP g,DWORD dwFlags,LPINT lpErrno);
     67   typedef INT (WSPAPI *LPWSPSTRINGTOADDRESS)(LPWSTR AddressString,INT AddressFamily,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPSOCKADDR lpAddress,LPINT lpAddressLength,LPINT lpErrno);
     68 
     69   typedef struct _WSPPROC_TABLE {
     70 
     71     LPWSPACCEPT lpWSPAccept;
     72     LPWSPADDRESSTOSTRING lpWSPAddressToString;
     73     LPWSPASYNCSELECT lpWSPAsyncSelect;
     74     LPWSPBIND lpWSPBind;
     75     LPWSPCANCELBLOCKINGCALL lpWSPCancelBlockingCall;
     76     LPWSPCLEANUP lpWSPCleanup;
     77     LPWSPCLOSESOCKET lpWSPCloseSocket;
     78     LPWSPCONNECT lpWSPConnect;
     79     LPWSPDUPLICATESOCKET lpWSPDuplicateSocket;
     80     LPWSPENUMNETWORKEVENTS lpWSPEnumNetworkEvents;
     81     LPWSPEVENTSELECT lpWSPEventSelect;
     82     LPWSPGETOVERLAPPEDRESULT lpWSPGetOverlappedResult;
     83     LPWSPGETPEERNAME lpWSPGetPeerName;
     84     LPWSPGETSOCKNAME lpWSPGetSockName;
     85     LPWSPGETSOCKOPT lpWSPGetSockOpt;
     86     LPWSPGETQOSBYNAME lpWSPGetQOSByName;
     87     LPWSPIOCTL lpWSPIoctl;
     88     LPWSPJOINLEAF lpWSPJoinLeaf;
     89     LPWSPLISTEN lpWSPListen;
     90     LPWSPRECV lpWSPRecv;
     91     LPWSPRECVDISCONNECT lpWSPRecvDisconnect;
     92     LPWSPRECVFROM lpWSPRecvFrom;
     93     LPWSPSELECT lpWSPSelect;
     94     LPWSPSEND lpWSPSend;
     95     LPWSPSENDDISCONNECT lpWSPSendDisconnect;
     96     LPWSPSENDTO lpWSPSendTo;
     97     LPWSPSETSOCKOPT lpWSPSetSockOpt;
     98     LPWSPSHUTDOWN lpWSPShutdown;
     99     LPWSPSOCKET lpWSPSocket;
    100     LPWSPSTRINGTOADDRESS lpWSPStringToAddress;
    101   } WSPPROC_TABLE,*LPWSPPROC_TABLE;
    102 
    103   typedef WINBOOL (WSPAPI *LPWPUCLOSEEVENT)(WSAEVENT hEvent,LPINT lpErrno);
    104   typedef int (WSPAPI *LPWPUCLOSESOCKETHANDLE)(SOCKET s,LPINT lpErrno);
    105   typedef WSAEVENT (WSPAPI *LPWPUCREATEEVENT)(LPINT lpErrno);
    106   typedef SOCKET (WSPAPI *LPWPUCREATESOCKETHANDLE)(DWORD dwCatalogEntryId,DWORD_PTR dwContext,LPINT lpErrno);
    107   typedef int (WSPAPI *LPWPUFDISSET)(SOCKET s,fd_set *fdset);
    108   typedef int (WSPAPI *LPWPUGETPROVIDERPATH)(LPGUID lpProviderId,WCHAR *lpszProviderDllPath,LPINT lpProviderDllPathLen,LPINT lpErrno);
    109   typedef SOCKET (WSPAPI *LPWPUMODIFYIFSHANDLE)(DWORD dwCatalogEntryId,SOCKET ProposedHandle,LPINT lpErrno);
    110   typedef WINBOOL (WSPAPI *LPWPUPOSTMESSAGE)(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
    111   typedef int (WSPAPI *LPWPUQUERYBLOCKINGCALLBACK)(DWORD dwCatalogEntryId,LPBLOCKINGCALLBACK *lplpfnCallback,PDWORD_PTR lpdwContext,LPINT lpErrno);
    112   typedef int (WSPAPI *LPWPUQUERYSOCKETHANDLECONTEXT)(SOCKET s,PDWORD_PTR lpContext,LPINT lpErrno);
    113   typedef int (WSPAPI *LPWPUQUEUEAPC)(LPWSATHREADID lpThreadId,LPWSAUSERAPC lpfnUserApc,DWORD_PTR dwContext,LPINT lpErrno);
    114   typedef WINBOOL (WSPAPI *LPWPURESETEVENT)(WSAEVENT hEvent,LPINT lpErrno);
    115   typedef WINBOOL (WSPAPI *LPWPUSETEVENT)(WSAEVENT hEvent,LPINT lpErrno);
    116   typedef int (WSPAPI *LPWPUOPENCURRENTTHREAD)(LPWSATHREADID lpThreadId,LPINT lpErrno);
    117   typedef int (WSPAPI *LPWPUCLOSETHREAD)(LPWSATHREADID lpThreadId,LPINT lpErrno);
    118   typedef int (WSPAPI *LPWPUCOMPLETEOVERLAPPEDREQUEST)(SOCKET s,LPWSAOVERLAPPED lpOverlapped,DWORD dwError,DWORD cbTransferred,LPINT lpErrno);
    119 
    120   typedef struct _WSPUPCALLTABLE {
    121     LPWPUCLOSEEVENT lpWPUCloseEvent;
    122     LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle;
    123     LPWPUCREATEEVENT lpWPUCreateEvent;
    124     LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle;
    125     LPWPUFDISSET lpWPUFDIsSet;
    126     LPWPUGETPROVIDERPATH lpWPUGetProviderPath;
    127     LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle;
    128     LPWPUPOSTMESSAGE lpWPUPostMessage;
    129     LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback;
    130     LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext;
    131     LPWPUQUEUEAPC lpWPUQueueApc;
    132     LPWPURESETEVENT lpWPUResetEvent;
    133     LPWPUSETEVENT lpWPUSetEvent;
    134     LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread;
    135     LPWPUCLOSETHREAD lpWPUCloseThread;
    136   } WSPUPCALLTABLE,*LPWSPUPCALLTABLE;
    137 
    138   typedef int (WSPAPI *LPWSPSTARTUP)(WORD wVersionRequested,LPWSPDATA lpWSPData,LPWSAPROTOCOL_INFOW lpProtocolInfo,WSPUPCALLTABLE UpcallTable,LPWSPPROC_TABLE lpProcTable);
    139   typedef int (WSPAPI *LPWSCENUMPROTOCOLS)(LPINT lpiProtocols,LPWSAPROTOCOL_INFOW lpProtocolBuffer,LPDWORD lpdwBufferLength,LPINT lpErrno);
    140   typedef int (WSPAPI *LPWSCDEINSTALLPROVIDER)(LPGUID lpProviderId,LPINT lpErrno);
    141   typedef int (WSPAPI *LPWSCINSTALLPROVIDER)(LPGUID lpProviderId,const WCHAR *lpszProviderDllPath,const LPWSAPROTOCOL_INFOW lpProtocolInfoList,DWORD dwNumberOfEntries,LPINT lpErrno);
    142   typedef int (WSPAPI *LPWSCGETPROVIDERPATH)(LPGUID lpProviderId,WCHAR *lpszProviderDllPath,LPINT lpProviderDllPathLen,LPINT lpErrno);
    143   typedef int (WSPAPI *LPWSCUPDATEPROVIDER)(LPGUID lpProviderId,const WCHAR *lpszProviderDllPath,const LPWSAPROTOCOL_INFOW lpProtocolInfoList,DWORD dwNumberOfEntries,LPINT lpErrno);
    144   typedef int (WSPAPI *LPWSCINSTALLQOSTEMPLATE)(const LPGUID Guid,LPWSABUF QosName,LPQOS Qos);
    145   typedef int (WSPAPI *LPWSCREMOVEQOSTEMPLATE)(const LPGUID Guid,LPWSABUF QosName);
    146 
    147   int WSPAPI WSPStartup(WORD wVersionRequested,LPWSPDATA lpWSPData,LPWSAPROTOCOL_INFOW lpProtocolInfo,WSPUPCALLTABLE UpcallTable,LPWSPPROC_TABLE lpProcTable);
    148   int WSPAPI WSCEnumProtocols(LPINT lpiProtocols,LPWSAPROTOCOL_INFOW lpProtocolBuffer,LPDWORD lpdwBufferLength,LPINT lpErrno);
    149   int WSPAPI WSCDeinstallProvider(LPGUID lpProviderId,LPINT lpErrno);
    150   int WSPAPI WSCInstallProvider(LPGUID lpProviderId,const WCHAR *lpszProviderDllPath,const LPWSAPROTOCOL_INFOW lpProtocolInfoList,DWORD dwNumberOfEntries,LPINT lpErrno);
    151   int WSPAPI WSCGetProviderPath(LPGUID lpProviderId,WCHAR *lpszProviderDllPath,LPINT lpProviderDllPathLen,LPINT lpErrno);
    152   int WSPAPI WSCUpdateProvider(LPGUID lpProviderId,const WCHAR *lpszProviderDllPath,const LPWSAPROTOCOL_INFOW lpProtocolInfoList,DWORD dwNumberOfEntries,LPINT lpErrno);
    153   int WSPAPI WSCInstallQOSTemplate (const LPGUID Guid,LPWSABUF QosName,LPQOS Qos);
    154   int WSPAPI WSCRemoveQOSTemplate (const LPGUID Guid,LPWSABUF QosName);
    155 
    156 #ifdef _WIN64
    157   int WSPAPI WSCEnumProtocols32(LPINT lpiProtocols,LPWSAPROTOCOL_INFOW lpProtocolBuffer,LPDWORD lpdwBufferLength,LPINT lpErrno);
    158   int WSPAPI WSCDeinstallProvider32(LPGUID lpProviderId,LPINT lpErrno);
    159   int WSPAPI WSCInstallProvider64_32(LPGUID lpProviderId,const WCHAR *lpszProviderDllPath,const LPWSAPROTOCOL_INFOW lpProtocolInfoList,DWORD dwNumberOfEntries,LPINT lpErrno);
    160   int WSPAPI WSCGetProviderPath32(LPGUID lpProviderId,WCHAR *lpszProviderDllPath,LPINT lpProviderDllPathLen,LPINT lpErrno);
    161   int WSPAPI WSCUpdateProvider32(LPGUID lpProviderId,const WCHAR *lpszProviderDllPath,const LPWSAPROTOCOL_INFOW lpProtocolInfoList,DWORD dwNumberOfEntries,LPINT lpErrno);
    162 #endif
    163 
    164   WINBOOL WSPAPI WPUCloseEvent(WSAEVENT hEvent,LPINT lpErrno);
    165   int WSPAPI WPUCloseSocketHandle(SOCKET s,LPINT lpErrno);
    166   WSAEVENT WSPAPI WPUCreateEvent(LPINT lpErrno);
    167   SOCKET WSPAPI WPUCreateSocketHandle(DWORD dwCatalogEntryId,DWORD_PTR dwContext,LPINT lpErrno);
    168   int WSPAPI WPUFDIsSet(SOCKET s,fd_set *fdset);
    169   int WSPAPI WPUGetProviderPath(LPGUID lpProviderId,WCHAR *lpszProviderDllPath,LPINT lpProviderDllPathLen,LPINT lpErrno);
    170   SOCKET WSPAPI WPUModifyIFSHandle(DWORD dwCatalogEntryId,SOCKET ProposedHandle,LPINT lpErrno);
    171   WINBOOL WSPAPI WPUPostMessage(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam);
    172   int WSPAPI WPUQueryBlockingCallback(DWORD dwCatalogEntryId,LPBLOCKINGCALLBACK *lplpfnCallback,PDWORD_PTR lpdwContext,LPINT lpErrno);
    173   int WSPAPI WPUQuerySocketHandleContext(SOCKET s,PDWORD_PTR lpContext,LPINT lpErrno);
    174   int WSPAPI WPUQueueApc(LPWSATHREADID lpThreadId,LPWSAUSERAPC lpfnUserApc,DWORD_PTR dwContext,LPINT lpErrno);
    175   WINBOOL WSPAPI WPUResetEvent(WSAEVENT hEvent,LPINT lpErrno);
    176   WINBOOL WSPAPI WPUSetEvent(WSAEVENT hEvent,LPINT lpErrno);
    177   int WSPAPI WPUCompleteOverlappedRequest (SOCKET s,LPWSAOVERLAPPED lpOverlapped,DWORD dwError,DWORD cbTransferred,LPINT lpErrno);
    178   int WSPAPI WPUOpenCurrentThread(LPWSATHREADID lpThreadId,LPINT lpErrno);
    179   int WSPAPI WPUCloseThread(LPWSATHREADID lpThreadId,LPINT lpErrno);
    180 #define WSCEnumNameSpaceProviders WSAEnumNameSpaceProvidersW
    181 #define LPFN_WSCENUMNAMESPACEPROVIDERS LPFN_WSAENUMNAMESPACEPROVIDERSW
    182 
    183 #ifdef _WIN64
    184   INT WSAAPI WSCEnumNameSpaceProviders32(LPDWORD lpdwBufferLength,LPWSANAMESPACE_INFOW lpnspBuffer);
    185 #endif
    186 
    187   typedef INT (WSPAPI *LPWSCINSTALLNAMESPACE)(LPWSTR lpszIdentifier,LPWSTR lpszPathName,DWORD dwNameSpace,DWORD dwVersion,LPGUID lpProviderId);
    188   typedef INT (WSPAPI *LPWSCUNINSTALLNAMESPACE)(LPGUID lpProviderId);
    189   typedef INT (WSPAPI *LPWSCENABLENSPROVIDER)(LPGUID lpProviderId,WINBOOL fEnable);
    190 
    191   INT WSPAPI WSCInstallNameSpace (LPWSTR lpszIdentifier,LPWSTR lpszPathName,DWORD dwNameSpace,DWORD dwVersion,LPGUID lpProviderId);
    192   INT WSPAPI WSCUnInstallNameSpace (LPGUID lpProviderId);
    193   INT WSPAPI WSCEnableNSProvider (LPGUID lpProviderId,WINBOOL fEnable);
    194 
    195 #ifdef _WIN64
    196   INT WSPAPI WSCInstallNameSpace32 (LPWSTR lpszIdentifier,LPWSTR lpszPathName,DWORD dwNameSpace,DWORD dwVersion,LPGUID lpProviderId);
    197   INT WSPAPI WSCUnInstallNameSpace32 (LPGUID lpProviderId);
    198   INT WSPAPI WSCEnableNSProvider32 (LPGUID lpProviderId,WINBOOL fEnable);
    199 #endif
    200 
    201   typedef INT (WSAAPI *LPNSPCLEANUP)(LPGUID lpProviderId);
    202   typedef INT (WSAAPI *LPNSPLOOKUPSERVICEBEGIN)(LPGUID lpProviderId,LPWSAQUERYSETW lpqsRestrictions,LPWSASERVICECLASSINFOW lpServiceClassInfo,DWORD dwControlFlags,LPHANDLE lphLookup);
    203   typedef INT (WSAAPI *LPNSPLOOKUPSERVICENEXT)(HANDLE hLookup,DWORD dwControlFlags,LPDWORD lpdwBufferLength,LPWSAQUERYSETW lpqsResults);
    204   typedef INT (WSAAPI *LPNSPIOCTL)(HANDLE hLookup,DWORD dwControlCode,LPVOID lpvInBuffer,DWORD cbInBuffer,LPVOID lpvOutBuffer,DWORD cbOutBuffer,LPDWORD lpcbBytesReturned,LPWSACOMPLETION lpCompletion,LPWSATHREADID lpThreadId);
    205   typedef INT (WSAAPI *LPNSPLOOKUPSERVICEEND)(HANDLE hLookup);
    206   typedef INT (WSAAPI *LPNSPSETSERVICE)(LPGUID lpProviderId,LPWSASERVICECLASSINFOW lpServiceClassInfo,LPWSAQUERYSETW lpqsRegInfo,WSAESETSERVICEOP essOperation,DWORD dwControlFlags);
    207   typedef INT (WSAAPI *LPNSPINSTALLSERVICECLASS)(LPGUID lpProviderId,LPWSASERVICECLASSINFOW lpServiceClassInfo);
    208   typedef INT (WSAAPI *LPNSPREMOVESERVICECLASS)(LPGUID lpProviderId,LPGUID lpServiceClassId);
    209   typedef INT (WSAAPI *LPNSPGETSERVICECLASSINFO)(LPGUID lpProviderId,LPDWORD lpdwBufSize,LPWSASERVICECLASSINFOW lpServiceClassInfo);
    210 
    211   typedef struct _NSP_ROUTINE {
    212     DWORD cbSize;
    213     DWORD dwMajorVersion;
    214     DWORD dwMinorVersion;
    215     LPNSPCLEANUP NSPCleanup;
    216     LPNSPLOOKUPSERVICEBEGIN NSPLookupServiceBegin;
    217     LPNSPLOOKUPSERVICENEXT NSPLookupServiceNext;
    218     LPNSPLOOKUPSERVICEEND NSPLookupServiceEnd;
    219     LPNSPSETSERVICE NSPSetService;
    220     LPNSPINSTALLSERVICECLASS NSPInstallServiceClass;
    221     LPNSPREMOVESERVICECLASS NSPRemoveServiceClass;
    222     LPNSPGETSERVICECLASSINFO NSPGetServiceClassInfo;
    223     LPNSPIOCTL NSPIoctl;
    224   } NSP_ROUTINE,*LPNSP_ROUTINE;
    225 
    226   typedef INT (WSAAPI *LPNSPSTARTUP)(LPGUID lpProviderId,LPNSP_ROUTINE lpnspRoutines);
    227 
    228   INT WSAAPI NSPStartup(LPGUID lpProviderId,LPNSP_ROUTINE lpnspRoutines);
    229 
    230 #if (_WIN32_WINNT >= 0x0600)
    231 
    232 typedef int (WSAAPI *LPNSPV2CLEANUP)(
    233   LPGUID lpProviderId,
    234   LPVOID pvClientSessionArg
    235 );
    236 
    237 typedef int (WSAAPI *LPNSPV2CLIENTSESSIONRUNDOWN)(
    238   LPGUID lpProviderId,
    239   LPVOID pvClientSessionArg
    240 );
    241 
    242 typedef int (WSAAPI *LPNSPV2LOOKUPSERVICEBEGIN)(
    243   LPGUID lpProviderId,
    244   LPWSAQUERYSET2W lpqsRestrictions,
    245   DWORD dwControlFlags,
    246   LPVOID lpvClientSessionArg,
    247   LPHANDLE lphLookup
    248 );
    249 
    250 typedef int (WSAAPI *LPNSPV2LOOKUPSERVICEEND)(
    251   HANDLE hLookup
    252 );
    253 
    254 typedef int (WSAAPI *LPNSPV2LOOKUPSERVICENEXTEX)(
    255   HANDLE hAsyncCall,
    256   HANDLE hLookup,
    257   DWORD dwControlFlags,
    258   LPDWORD lpdwBufferLength,
    259   LPWSAQUERYSET2W lpqsResults
    260 );
    261 
    262 typedef int (WSAAPI *LPNSPV2SETSERVICEEX)(
    263   HANDLE hAsyncCall,
    264   LPGUID lpProviderId,
    265   LPWSAQUERYSET2W lpqsRegInfo,
    266   WSAESETSERVICEOP essOperation,
    267   DWORD dwControlFlags,
    268   LPVOID lpvClientSessionArg
    269 );
    270 
    271 typedef int (WSAAPI *LPNSPV2STARTUP)(
    272   LPGUID lpProviderId,
    273   LPVOID *ppvClientSessionArg
    274 );
    275 
    276 typedef struct _NSPV2_ROUTINE {
    277   DWORD                       cbSize;
    278   DWORD                       dwMajorVersion;
    279   DWORD                       dwMinorVersion;
    280   LPNSPV2STARTUP              NSPv2Startup;
    281   LPNSPV2CLEANUP              NSPv2Cleanup;
    282   LPNSPV2LOOKUPSERVICEBEGIN   NSPv2LookupServiceBegin;
    283   LPNSPV2LOOKUPSERVICENEXTEX  NSPv2LookupServiceNextEx;
    284   LPNSPV2LOOKUPSERVICEEND     NSPv2LookupServiceEnd;
    285   LPNSPV2SETSERVICEEX         NSPv2SetServiceEx;
    286   LPNSPV2CLIENTSESSIONRUNDOWN NSPv2ClientSessionRundown;
    287 } NSPV2_ROUTINE, *PNSPV2_ROUTINE, *LPCNSPV2_ROUTINE;
    288 
    289 #define LSP_SYSTEM          0x80000000
    290 #define LSP_INSPECTOR       0x00000001
    291 #define LSP_REDIRECTOR      0x00000002
    292 #define LSP_PROXY           0x00000004
    293 #define LSP_FIREWALL        0x00000008
    294 #define LSP_INBOUND_MODIFY  0x00000010
    295 #define LSP_OUTBOUND_MODIFY 0x00000020
    296 #define LSP_CRYPTO_COMPRESS 0x00000040
    297 #define LSP_LOCAL_CACHE     0x00000080
    298 
    299 typedef enum _WSC_PROVIDER_INFO_TYPE {
    300   ProviderInfoLspCategories = 0,
    301   ProviderInfoAudit
    302 } WSC_PROVIDER_INFO_TYPE;
    303 
    304 typedef struct _WSC_PROVIDER_AUDIT_INFO {
    305   DWORD RecordSize;
    306   PVOID Reserved;
    307 } WSC_PROVIDER_AUDIT_INFO, *PWSC_PROVIDER_AUDIT_INFO;
    308 
    309 INT WSAAPI WSAAdvertiseProvider(
    310   const GUID *puuidProviderId,
    311   const LPCNSPV2_ROUTINE *pNSPv2Routine
    312 );
    313 
    314 INT WSPAPI WSAProviderCompleteAsyncCall(
    315   HANDLE hAsyncCall,
    316   INT iRetCode
    317 );
    318 
    319 INT WSPAPI WSAUnadvertiseProvider(
    320   const GUID *puuidProviderId
    321 );
    322 
    323 int WSPAPI WSCGetApplicationCategory(
    324   LPCWSTR Path,
    325   DWORD PathLength,
    326   LPCWSTR Extra,
    327   DWORD ExtraLength,
    328   DWORD *pPermittedLspCategories,
    329   LPINT lpErrno
    330 );
    331 
    332 int WSPAPI WSCGetProviderInfo(
    333   LPGUID lpProviderId,
    334   WSC_PROVIDER_INFO_TYPE InfoType,
    335   PBYTE Info,
    336   size_t *InfoSize,
    337   DWORD Flags,
    338   LPINT lpErrno
    339 );
    340 
    341 #ifndef _WIN64
    342 int WSPAPI WSCInstallProviderAndChains(
    343   const LPGUID lpProviderId,
    344   const LPWSTR lpszProviderDllPath,
    345   const LPWSTR lpszLspName,
    346   DWORD dwServiceFlags,
    347   const LPWSAPROTOCOL_INFO lpProtocolInfoList,
    348   DWORD dwNumberOfEntries,
    349   LPDWORD lpdwCatalogEntryId,
    350   LPINT lpErrno
    351 );
    352 #endif /* !_WIN64 */
    353 
    354 int WSPAPI WSCSetApplicationCategory(
    355   LPCWSTR Path,
    356   DWORD PathLength,
    357   LPCWSTR Extra,
    358   DWORD ExtraLength,
    359   DWORD PermittedLspCategories,
    360   DWORD *pPrevPermLspCat,
    361   LPINT lpErrno
    362 );
    363 
    364 int WSPAPI WSCSetProviderInfo(
    365   LPGUID lpProviderId,
    366   WSC_PROVIDER_INFO_TYPE InfoType,
    367   PBYTE Info,
    368   size_t InfoSize,
    369   DWORD Flags,
    370   LPINT lpErrno
    371 );
    372 
    373 int WSAAPI WSCInstallNameSpaceEx(
    374   LPWSTR lpszIdentifier,
    375   LPWSTR lpszPathName,
    376   DWORD dwNameSpace,
    377   DWORD dwVersion,
    378   LPGUID lpProviderId,
    379   LPBLOB lpProviderInfo
    380 );
    381 
    382 #define WSCEnumNameSpaceProvidersEx WSAEnumNameSpaceProvidersExW
    383 #define LPFN_WSCENUMNAMESPACEPROVIDERSEX LPFN_WSAENUMNAMESPACEPROVIDERSEXW
    384 
    385 #ifdef _WIN64
    386 INT WSPAPI WSCEnumNameSpaceProvidersEx32(
    387   LPDWORD lpdwBufferLength,
    388   LPWSANAMESPACE_INFOEXW lpnspBuffer
    389 );
    390 
    391 int WSPAPI WSCGetProviderInfo32(
    392   LPGUID lpProviderId,
    393   WSC_PROVIDER_INFO_TYPE InfoType,
    394   PBYTE Info,
    395   size_t *InfoSize,
    396   DWORD Flags,
    397   LPINT lpErrno
    398 );
    399 
    400 int WSAAPI WSCInstallNameSpaceEx32(
    401   LPWSTR lpszIdentifier,
    402   LPWSTR lpszPathName,
    403   DWORD dwNameSpace,
    404   DWORD dwVersion,
    405   LPGUID lpProviderId,
    406   LPBLOB lpProviderInfo
    407 );
    408 
    409 int WSPAPI WSCInstallProviderAndChains64_32(
    410   const LPGUID lpProviderId,
    411   const LPWSTR lpszProviderDllPath,
    412   const LPWSTR lpszProviderDllPath32,
    413   const LPWSTR lpszLspName,
    414   DWORD dwServiceFlags,
    415   const LPWSAPROTOCOL_INFO lpProtocolInfoList,
    416   DWORD dwNumberOfEntries,
    417   LPDWORD lpdwCatalogEntryId,
    418   LPINT lpErrno
    419 );
    420 
    421 int WSPAPI WSCSetProviderInfo32(
    422   LPGUID lpProviderId,
    423   WSC_PROVIDER_INFO_TYPE InfoType,
    424   PBYTE Info,
    425   size_t InfoSize,
    426   DWORD Flags,
    427   LPINT lpErrno
    428 );
    429 
    430 #endif /* _WIN64*/
    431 
    432 #endif /*(_WIN32_WINNT >= 0x0600)*/
    433 
    434 #ifdef __cplusplus
    435 }
    436 #endif
    437 
    438 #if !defined(_WIN64)
    439 #include <poppack.h>
    440 #endif
    441 #endif
    442