From 4ada99aa83c5fc84bb77c5b5b14a9fa0c220b6d7 Mon Sep 17 00:00:00 2001 From: Austin English Date: Thu, 9 Sep 2010 11:32:56 -0500 Subject: [PATCH] ws2_32: Add a stub for WSANSPIoctl. --- dlls/ws2_32/socket.c | 13 +++++++++++++ dlls/ws2_32/ws2_32.spec | 2 +- include/winsock2.h | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 82d157c3a07..0335d41a00a 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -6020,3 +6020,16 @@ INT WINAPI WSCWriteProviderOrder( LPDWORD entry, DWORD number ) FIXME("(%p 0x%08x) Stub!\n", entry, number); return 0; } + +/*********************************************************************** + * WSANSPIoctl (WS2_32.91) + */ +INT WINAPI WSANSPIoctl( HANDLE hLookup, DWORD dwControlCode, LPVOID lpvInBuffer, + DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, + LPDWORD lpcbBytesReturned, LPWSACOMPLETION lpCompletion ) +{ + FIXME("(%p, 0x%08x, %p, 0x%08x, %p, 0x%08x, %p, %p) Stub!\n", hLookup, dwControlCode, + lpvInBuffer, cbInBuffer, lpvOutBuffer, cbOutBuffer, lpcbBytesReturned, lpCompletion); + WSASetLastError(WSA_NOT_ENOUGH_MEMORY); + return SOCKET_ERROR; +}; diff --git a/dlls/ws2_32/ws2_32.spec b/dlls/ws2_32/ws2_32.spec index a77c215b849..537e7f33ace 100644 --- a/dlls/ws2_32/ws2_32.spec +++ b/dlls/ws2_32/ws2_32.spec @@ -85,7 +85,7 @@ @ stdcall WSALookupServiceEnd(long) @ stdcall WSALookupServiceNextA(long long ptr ptr) @ stdcall WSALookupServiceNextW(long long ptr ptr) -@ stub WSANSPIoctl +@ stdcall WSANSPIoctl(ptr long ptr long ptr long ptr ptr) @ stdcall WSANtohl(long long ptr) @ stdcall WSANtohs(long long ptr) @ stdcall WSAProviderConfigChange(ptr ptr ptr) diff --git a/include/winsock2.h b/include/winsock2.h index 5d5bd607b71..c3464738c4d 100644 --- a/include/winsock2.h +++ b/include/winsock2.h @@ -506,6 +506,37 @@ DECL_WINELIB_TYPE_AW(WSANAMESPACE_INFO) DECL_WINELIB_TYPE_AW(PWSANAMESPACE_INFO) DECL_WINELIB_TYPE_AW(LPWSANAMESPACE_INFO) +typedef enum _WSACOMPLETIONTYPE { + NSP_NOTIFY_IMMEDIATELY = 0, + NSP_NOTIFY_HWND = 1, + NSP_NOTIFY_EVENT = 2, + NSP_NOTIFY_PORT = 3, + NSP_NOTIFY_APC = 4 +} WSACOMPLETIONTYPE, * PWSACOMPLETIONTYPE, * LPWSACOMPLETIONTYPE; + +typedef struct _WSACOMPLETION { + WSACOMPLETIONTYPE Type; + union { + struct { + HWND hWnd; + UINT uMsg; + WPARAM context; + } WindowMessage; + struct { + LPWSAOVERLAPPED lpOverlapped; + } Event; + struct { + LPWSAOVERLAPPED lpOverlapped; + LPWSAOVERLAPPED_COMPLETION_ROUTINE lpfnCompletionProc; + } Apc; + struct { + LPWSAOVERLAPPED lpOverlapped; + HANDLE hPort; + ULONG_PTR Key; + } Port; + } Parameters; +} WSACOMPLETION, *PWSACOMPLETION, *LPWSACOMPLETION; + /* * Winsock Function Typedefs * @@ -613,6 +644,7 @@ INT WINAPI WSALookupServiceEnd(HANDLE); INT WINAPI WSALookupServiceNextA(HANDLE,DWORD,LPDWORD,LPWSAQUERYSETA); INT WINAPI WSALookupServiceNextW(HANDLE,DWORD,LPDWORD,LPWSAQUERYSETW); #define WSALookupServiceNext WINELIB_NAME_AW(WSALookupServiceNext) +int WINAPI WSANSPIoctl(HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSACOMPLETION); int WINAPI WSANtohl(SOCKET,ULONG,ULONG*); int WINAPI WSANtohs(SOCKET,WS(u_short),WS(u_short)*); INT WINAPI WSAProviderConfigChange(LPHANDLE,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE); @@ -685,6 +717,7 @@ typedef INT (WINAPI *LPFN_WSALOOKUPSERVICEEND(HANDLE); typedef INT (WINAPI *LPFN_WSALOOKUPSERVICENEXTA)(HANDLE,DWORD,LPDWORD,LPWSAQUERYSETA); typedef INT (WINAPI *LPFN_WSALOOKUPSERVICENEXTW)(HANDLE,DWORD,LPDWORD,LPWSAQUERYSETW); #define LPFN_WSALOOKUPSERVICENEXT WINELIB_NAME_AW(LPFN_WSALOOKUPSERVICENEXT) +typedef int (WINAPI *LPFN_WSANSPIoctl)(HANDLE, DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSACOMPLETION); typedef int (WINAPI *LPFN_WSANTOHL)(SOCKET,ULONG,ULONG*); typedef int (WINAPI *LPFN_WSANTOHS)(SOCKET,WS(u_short),WS(u_short)*); typedef INT (WINAPI *LPFN_WSAPROVIDERCONFIGCHANGE)(LPHANDLE,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);