Implemented TransmitFile (non-functional, depends on unimplemented
features), added some missing definitions to mswsock.h
Modified: trunk/reactos/lib/mswsock/Makefile
Added: trunk/reactos/lib/mswsock/extensions.c
Modified: trunk/reactos/lib/mswsock/stubs.c
Modified: trunk/reactos/w32api/include/mswsock.h
_____
Modified: trunk/reactos/lib/mswsock/Makefile
--- trunk/reactos/lib/mswsock/Makefile 2005-01-18 18:12:41 UTC (rev
13125)
+++ trunk/reactos/lib/mswsock/Makefile 2005-01-18 22:36:39 UTC (rev
13126)
@@ -20,9 +20,9 @@
TARGET_LFLAGS = -nostartfiles -nostdlib
-TARGET_SDKLIBS = kernel32.a
+TARGET_SDKLIBS = kernel32.a ws2_32.a
-TARGET_OBJECTS = stubs.o
+TARGET_OBJECTS = stubs.o extensions.o
TARGET_CLEAN = $(DEP_FILES)
_____
Added: trunk/reactos/lib/mswsock/extensions.c
--- trunk/reactos/lib/mswsock/extensions.c 2005-01-18 18:12:41 UTC
(rev 13125)
+++ trunk/reactos/lib/mswsock/extensions.c 2005-01-18 22:36:39 UTC
(rev 13126)
@@ -0,0 +1,54 @@
+/* $Id: stubs.c 12852 2005-01-06 13:58:04Z mf $
+ *
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS WinSock DLL
+ * FILE: stubs.c
+ * PURPOSE: WSAIoctl wrappers for Microsoft extensions to Winsock
+ * PROGRAMMERS: KJK::Hyperion <hackbunny(a)reactos.com>
+ * REVISIONS:
+ */
+
+#include <windows.h>
+#include <winsock2.h>
+#include <mswsock.h>
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+TransmitFile(SOCKET Socket,
+ HANDLE File,
+ DWORD NumberOfBytesToWrite,
+ DWORD NumberOfBytesPerSend,
+ LPOVERLAPPED Overlapped,
+ LPTRANSMIT_FILE_BUFFERS TransmitBuffers,
+ DWORD Flags)
+{
+ static GUID TransmitFileGUID = WSAID_TRANSMITFILE;
+ LPFN_TRANSMITFILE pfnTransmitFile;
+ DWORD cbBytesReturned;
+
+ if (WSAIoctl(Socket,
+ SIO_GET_EXTENSION_FUNCTION_POINTER,
+ &TransmitFileGUID,
+ sizeof(TransmitFileGUID),
+ &pfnTransmitFile,
+ sizeof(pfnTransmitFile),
+ &cbBytesReturned,
+ NULL,
+ NULL) == SOCKET_ERROR)
+ {
+ return FALSE;
+ }
+
+ return pfnTransmitFile(Socket,
+ File,
+ NumberOfBytesToWrite,
+ NumberOfBytesPerSend,
+ Overlapped,
+ TransmitBuffers,
+ Flags);
+}
+
+/* EOF */
_____
Modified: trunk/reactos/lib/mswsock/stubs.c
--- trunk/reactos/lib/mswsock/stubs.c 2005-01-18 18:12:41 UTC (rev
13125)
+++ trunk/reactos/lib/mswsock/stubs.c 2005-01-18 22:36:39 UTC (rev
13126)
@@ -255,24 +255,6 @@
/*
* @unimplemented
*/
-BOOL
-STDCALL
-TransmitFile(SOCKET Socket,
- HANDLE File,
- DWORD NumberOfBytesToWrite,
- DWORD NumberOfBytesPerSend,
- LPOVERLAPPED Overlapped,
- LPTRANSMIT_FILE_BUFFERS TransmitBuffers,
- DWORD Flags)
-{
- OutputDebugStringW(L"w32sock TransmitFile stub called\n");
-
- return FALSE;
-}
-
-/*
- * @unimplemented
- */
int
STDCALL
WSARecvEx(SOCKET Sock,
_____
Modified: trunk/reactos/w32api/include/mswsock.h
--- trunk/reactos/w32api/include/mswsock.h 2005-01-18 18:12:41 UTC
(rev 13125)
+++ trunk/reactos/w32api/include/mswsock.h 2005-01-18 22:36:39 UTC
(rev 13126)
@@ -54,6 +54,14 @@
BOOL PASCAL
AcceptEx(SOCKET,SOCKET,PVOID,DWORD,DWORD,DWORD,LPDWORD,LPOVERLAPPED);
VOID PASCAL GetAcceptExSockaddrs(PVOID,DWORD,DWORD,DWORD,struct
sockaddr**, LPINT, struct sockaddr**, LPINT);
+#define WSAID_ACCEPTEX { 0xB5367DF0, 0xCBAC, 0x11CF, {
0x95, 0xCA, 0x00, 0x80, 0x5F, 0x48, 0xA1, 0x92 } }
+#define WSAID_TRANSMITFILE { 0xB5367DF1, 0xCBAC, 0x11CF, {
0x95, 0xCA, 0x00, 0x80, 0x5F, 0x48, 0xA1, 0x92 } }
+#define WSAID_GETACCEPTEXSOCKADDRS { 0xB5367DF2, 0xCBAC, 0x11CF, {
0x95, 0xCA, 0x00, 0x80, 0x5F, 0x48, 0xA1, 0x92 } }
+
+typedef BOOL (PASCAL
*LPFN_TRANSMITFILE)(SOCKET,HANDLE,DWORD,DWORD,LPOVERLAPPED,LPTRANSMIT_FI
LE_BUFFERS,DWORD);
+typedef BOOL (PASCAL
*LPFN_ACCEPTEX)(SOCKET,SOCKET,PVOID,DWORD,DWORD,DWORD,LPDWORD,LPOVERLAPP
ED);
+typedef VOID (PASCAL
*LPFN_GETACCEPTEXSOCKADDRS)(PVOID,DWORD,DWORD,DWORD,struct sockaddr**,
LPINT, struct sockaddr**, LPINT);
+
#ifdef _WINSOCK2_H /* These require the winsock2 interface. */
#define TP_ELEMENT_FILE 1