- New winsock (part 1 of x)
authorCameron Gutman <aicommander@gmail.com>
Sat, 6 Feb 2010 02:32:13 +0000 (02:32 +0000)
committerCameron Gutman <aicommander@gmail.com>
Sat, 6 Feb 2010 02:32:13 +0000 (02:32 +0000)
 - Remove the old ws2_32

svn path=/branches/aicom-network-branch/; revision=45448

21 files changed:
dll/win32/ws2_32/include/catalog.h [deleted file]
dll/win32/ws2_32/include/debug.h [deleted file]
dll/win32/ws2_32/include/handle.h [deleted file]
dll/win32/ws2_32/include/upcall.h [deleted file]
dll/win32/ws2_32/include/ws2_32.h [deleted file]
dll/win32/ws2_32/misc/async.c [deleted file]
dll/win32/ws2_32/misc/bsd.c [deleted file]
dll/win32/ws2_32/misc/catalog.c [deleted file]
dll/win32/ws2_32/misc/dllmain.c [deleted file]
dll/win32/ws2_32/misc/event.c [deleted file]
dll/win32/ws2_32/misc/handle.c [deleted file]
dll/win32/ws2_32/misc/ns.c [deleted file]
dll/win32/ws2_32/misc/sndrcv.c [deleted file]
dll/win32/ws2_32/misc/stubs.c [deleted file]
dll/win32/ws2_32/misc/upcall.c [deleted file]
dll/win32/ws2_32/tests/setup.c [deleted file]
dll/win32/ws2_32/tests/stubs.tst [deleted file]
dll/win32/ws2_32/tests/tests/WinsockEvent.c [deleted file]
dll/win32/ws2_32/ws2_32.rbuild [deleted file]
dll/win32/ws2_32/ws2_32.rc [deleted file]
dll/win32/ws2_32/ws2_32.spec [deleted file]

diff --git a/dll/win32/ws2_32/include/catalog.h b/dll/win32/ws2_32/include/catalog.h
deleted file mode 100644 (file)
index f36513e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        include/catalog.h
- * PURPOSE:     Service Provider Catalog definitions
- */
-#ifndef __CATALOG_H
-#define __CATALOG_H
-
-typedef struct _CATALOG_ENTRY
-{
-    LIST_ENTRY ListEntry;
-    ULONG ReferenceCount;
-    CRITICAL_SECTION Lock;
-    UNICODE_STRING LibraryName;
-    HMODULE hModule;
-    WSAPROTOCOL_INFOW ProtocolInfo;
-    PWINSOCK_MAPPING Mapping;
-    LPWSPSTARTUP WSPStartup;
-    WSPDATA WSPData;
-    WSPPROC_TABLE ProcTable;
-} CATALOG_ENTRY, *PCATALOG_ENTRY;
-
-extern LIST_ENTRY Catalog;
-
-
-VOID ReferenceProviderByPointer(
-    PCATALOG_ENTRY Provider);
-
-VOID DereferenceProviderByPointer(
-    PCATALOG_ENTRY Provider);
-
-PCATALOG_ENTRY CreateCatalogEntry(
-    LPWSTR LibraryName);
-
-INT DestroyCatalogEntry(
-    PCATALOG_ENTRY Provider);
-
-PCATALOG_ENTRY LocateProvider(
-    LPWSAPROTOCOL_INFOW lpProtocolInfo);
-
-PCATALOG_ENTRY LocateProviderById(
-    DWORD CatalogEntryId);
-
-INT LoadProvider(
-    PCATALOG_ENTRY Provider,
-    LPWSAPROTOCOL_INFOW lpProtocolInfo);
-
-INT UnloadProvider(
-    PCATALOG_ENTRY Provider);
-
-VOID CreateCatalog(VOID);
-
-VOID DestroyCatalog(VOID);
-
-#endif /* __CATALOG_H */
-
-/* EOF */
diff --git a/dll/win32/ws2_32/include/debug.h b/dll/win32/ws2_32/include/debug.h
deleted file mode 100644 (file)
index 369aa28..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        include/debug.h
- * PURPOSE:     Debugging support macros
- * DEFINES:     DBG     - Enable debug output
- *              NASSERT - Disable assertions
- */
-#ifndef __DEBUG_H
-#define __DEBUG_H
-
-#define NORMAL_MASK    0x000000FF
-#define SPECIAL_MASK   0xFFFFFF00
-#define MIN_TRACE      0x00000001
-#define MID_TRACE      0x00000002
-#define MAX_TRACE      0x00000003
-
-#define DEBUG_CHECK    0x00000100
-#define DEBUG_ULTRA    0xFFFFFFFF
-
-#ifdef ASSERT
-#undef ASSERT
-#endif
-
-#if DBG
-
-extern DWORD DebugTraceLevel;
-
-#define WS_DbgPrint(_t_, _x_) \
-    if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
-        ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
-        DbgPrint("(%hS:%d)(%hS) ", __FILE__, __LINE__, __FUNCTION__); \
-               DbgPrint _x_; \
-    }
-
-#ifdef NASSERT
-#define ASSERT(x)
-#else /* NASSERT */
-#define ASSERT(x) if (!(x)) { WS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); }
-#endif /* NASSERT */
-
-#else /* DBG */
-
-#define WS_DbgPrint(_t_, _x_)
-
-#define ASSERT_IRQL(x)
-#define ASSERT(x)
-
-#endif /* DBG */
-
-
-#define assert(x) ASSERT(x)
-#define assert_irql(x) ASSERT_IRQL(x)
-
-
-#define UNIMPLEMENTED \
-    WS_DbgPrint(MIN_TRACE, ("is unimplemented, please try again later.\n"));
-
-#define CHECKPOINT \
-    WS_DbgPrint(DEBUG_CHECK, ("\n"));
-
-#define CP CHECKPOINT
-
-#endif /* __DEBUG_H */
-
-/* EOF */
diff --git a/dll/win32/ws2_32/include/handle.h b/dll/win32/ws2_32/include/handle.h
deleted file mode 100644 (file)
index 95fb03a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        include/handle.h
- * PURPOSE:     Provider handle definitions
- */
-#ifndef __HANDLE_H
-#define __HANDLE_H
-
-#include <catalog.h>
-
-typedef struct _PROVIDER_HANDLE
-{
-    HANDLE Handle;
-    PCATALOG_ENTRY Provider;
-} PROVIDER_HANDLE, *PPROVIDER_HANDLE;
-
-#define HANDLE_BLOCK_ENTRIES ((1024-sizeof(LIST_ENTRY))/sizeof(PROVIDER_HANDLE))
-
-typedef struct _PROVIDER_HANDLE_BLOCK
-{
-    LIST_ENTRY Entry;
-    PROVIDER_HANDLE Handles[HANDLE_BLOCK_ENTRIES];
-} PROVIDER_HANDLE_BLOCK, *PPROVIDER_HANDLE_BLOCK;
-
-extern PPROVIDER_HANDLE_BLOCK ProviderHandleTable;
-
-
-HANDLE
-CreateProviderHandle(HANDLE Handle,
-                     PCATALOG_ENTRY Provider);
-
-BOOL
-ReferenceProviderByHandle(HANDLE Handle,
-                          PCATALOG_ENTRY* Provider);
-
-BOOL
-CloseProviderHandle(HANDLE Handle);
-
-BOOL
-InitProviderHandleTable(VOID);
-
-VOID
-FreeProviderHandleTable(VOID);
-
-#endif /* __HANDLE_H */
-
-/* EOF */
diff --git a/dll/win32/ws2_32/include/upcall.h b/dll/win32/ws2_32/include/upcall.h
deleted file mode 100644 (file)
index 16ec65a..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        include/upcall.h
- * PURPOSE:     Upcall function defintions
- */
-#ifndef __UPCALL_H
-#define __UPCALL_H
-
-BOOL
-WSPAPI
-WPUCloseEvent(
-    IN  WSAEVENT hEvent,
-    OUT LPINT lpErrno);
-
-INT
-WSPAPI
-WPUCloseSocketHandle(
-    IN  SOCKET s,
-    OUT LPINT lpErrno);
-
-INT
-WSPAPI
-WPUCloseThread(
-    IN  LPWSATHREADID lpThreadId,
-    OUT LPINT lpErrno);
-
-WSAEVENT
-WSPAPI
-WPUCreateEvent(
-    OUT LPINT lpErrno);
-
-SOCKET
-WSPAPI
-WPUCreateSocketHandle(
-    IN  DWORD dwCatalogEntryId,
-    IN  DWORD dwContext,
-    OUT LPINT lpErrno);
-
-int
-WSPAPI
-WPUFDIsSet(
-    IN  SOCKET s,
-    IN  LPFD_SET set);
-
-INT
-WSPAPI
-WPUGetProviderPath(
-    IN      LPGUID lpProviderId,
-    OUT     LPWSTR lpszProviderDllPath,
-    IN OUT  LPINT lpProviderDllPathLen,
-    OUT     LPINT lpErrno);
-
-SOCKET
-WSPAPI
-WPUModifyIFSHandle(
-    IN  DWORD dwCatalogEntryId,
-    IN  SOCKET ProposedHandle,
-    OUT LPINT lpErrno);
-
-INT
-WSPAPI
-WPUOpenCurrentThread(
-    OUT LPWSATHREADID lpThreadId,
-    OUT LPINT lpErrno);
-
-INT
-WSPAPI
-WPUQueryBlockingCallback(
-    IN  DWORD dwCatalogEntryId,
-    OUT LPBLOCKINGCALLBACK FAR* lplpfnCallback,
-    OUT LPDWORD lpdwContext,
-    OUT LPINT lpErrno);
-
-INT
-WSPAPI
-WPUQuerySocketHandleContext(
-    IN  SOCKET s,
-    OUT LPDWORD lpContext,
-    OUT LPINT lpErrno);
-
-INT
-WSPAPI
-WPUQueueApc(
-    IN  LPWSATHREADID lpThreadId,
-    IN  LPWSAUSERAPC lpfnUserApc,
-    IN  DWORD dwContext,
-    OUT LPINT lpErrno);
-
-BOOL
-WSPAPI
-WPUResetEvent(
-    IN  WSAEVENT hEvent,
-    OUT LPINT lpErrno);
-
-BOOL
-WSPAPI
-WPUSetEvent(
-    IN  WSAEVENT hEvent,
-    OUT LPINT lpErrno);
-
-#endif /* __UPCALL_H */
-
-/* EOF */
diff --git a/dll/win32/ws2_32/include/ws2_32.h b/dll/win32/ws2_32/include/ws2_32.h
deleted file mode 100644 (file)
index 7272a14..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        include/ws2_32.h
- * PURPOSE:     WinSock 2 DLL header
- */
-#ifndef __WS2_32_H
-#define __WS2_32_H
-
-#include <stdlib.h>
-
-#define WIN32_NO_STATUS
-#include <winsock2.h>
-#include <ws2spi.h>
-#include <ws2tcpip.h>
-#include <windows.h>
-#define NTOS_MODE_USER
-#include <ndk/ntndk.h>
-
-#include <wsahelp.h>
-
-#undef assert
-#include <debug.h>
-#include <windns.h> // DNS_A_DATA
-
-#define EXPORT WINAPI
-
-extern HINSTANCE g_hInstDll;
-extern HANDLE GlobalHeap;
-extern BOOL WsaInitialized;    /* TRUE if WSAStartup() has been successfully called */
-extern WSPUPCALLTABLE UpcallTable;
-
-#define WS2_INTERNAL_MAX_ALIAS 16
-
-typedef struct _WINSOCK_GETSERVBYNAME_CACHE
-{
-    UINT Size;
-    SERVENT ServerEntry;
-    PCHAR Aliases[WS2_INTERNAL_MAX_ALIAS];
-    CHAR Data[1];
-} WINSOCK_GETSERVBYNAME_CACHE, *PWINSOCK_GETSERVBYNAME_CACHE;
-
-typedef struct _WINSOCK_GETSERVBYPORT_CACHE
-{
-    UINT Size;
-    SERVENT ServerEntry;
-    PCHAR Aliases[WS2_INTERNAL_MAX_ALIAS];
-    CHAR Data[1];
-} WINSOCK_GETSERVBYPORT_CACHE, *PWINSOCK_GETSERVBYPORT_CACHE;
-
-typedef struct _WINSOCK_THREAD_BLOCK
-{
-    INT LastErrorValue;     /* Error value from last function that failed */
-    CHAR Intoa[16];         /* Buffer for inet_ntoa() */
-    PWINSOCK_GETSERVBYNAME_CACHE
-    Getservbyname;          /* Buffer used by getservbyname */
-    PWINSOCK_GETSERVBYPORT_CACHE
-    Getservbyport;          /* Buffer used by getservbyname */
-    struct hostent* Hostent;
-} WINSOCK_THREAD_BLOCK, *PWINSOCK_THREAD_BLOCK;
-
-
-/* Macros */
-
-#define WSAINITIALIZED (WsaInitialized)
-
-#define WSASETINITIALIZED (WsaInitialized = TRUE)
-
-/* ws2_32 internal Functions */
-void check_hostent(struct hostent **he);
-void populate_hostent(struct hostent *he, char* name, DNS_A_DATA addr);
-void free_hostent(struct hostent *he);
-void free_servent(struct servent* s);
-
-#ifdef LE
-
-/* DWORD network to host byte order conversion for little endian machines */
-#define DN2H(dw) \
-  ((((dw) & 0xFF000000L) >> 24) | \
-   (((dw) & 0x00FF0000L) >> 8) | \
-        (((dw) & 0x0000FF00L) << 8) | \
-        (((dw) & 0x000000FFL) << 24))
-
-/* DWORD host to network byte order conversion for little endian machines */
-#define DH2N(dw) \
-       ((((dw) & 0xFF000000L) >> 24) | \
-        (((dw) & 0x00FF0000L) >> 8) | \
-        (((dw) & 0x0000FF00L) << 8) | \
-        (((dw) & 0x000000FFL) << 24))
-
-/* WORD network to host order conversion for little endian machines */
-#define WN2H(w) \
-       ((((w) & 0xFF00) >> 8) | \
-        (((w) & 0x00FF) << 8))
-
-/* WORD host to network byte order conversion for little endian machines */
-#define WH2N(w) \
-       ((((w) & 0xFF00) >> 8) | \
-        (((w) & 0x00FF) << 8))
-
-#else /* LE */
-
-/* DWORD network to host byte order conversion for big endian machines */
-#define DN2H(dw) \
-    (dw)
-
-/* DWORD host to network byte order conversion big endian machines */
-#define DH2N(dw) \
-    (dw)
-
-/* WORD network to host order conversion for big endian machines */
-#define WN2H(w) \
-    (w)
-
-/* WORD host to network byte order conversion for big endian machines */
-#define WH2N(w) \
-    (w)
-
-#endif /* LE */
-
-#endif /* __WS2_32_H */
-
-/* EOF */
diff --git a/dll/win32/ws2_32/misc/async.c b/dll/win32/ws2_32/misc/async.c
deleted file mode 100644 (file)
index 558960c..0000000
+++ /dev/null
@@ -1,706 +0,0 @@
-/* Async WINSOCK DNS services
- *
- * Copyright (C) 1993,1994,1996,1997 John Brezak, Erik Bos, Alex Korobka.
- * Copyright (C) 1999 Marcus Meissner
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * NOTE: If you make any changes to fix a particular app, make sure
- * they don't break something else like Netscape or telnet and ftp
- * clients and servers (www.winsite.com got a lot of those).
- *
- * FIXME:
- *     - Add WSACancel* and correct handle management. (works rather well for
- *       now without it.)
- *     - Verify & Check all calls for correctness
- *       (currently only WSAGetHostByName*, WSAGetServByPort* calls)
- *     - Check error returns.
- *     - mirc/mirc32 Finger @linux.kernel.org sometimes fails in threaded mode.
- *       (not sure why)
- *     - This implementation did ignore the "NOTE:" section above (since the
- *       whole stuff did not work anyway to other changes).
- */
-
-#include <windows.h>
-#include <winsock.h>
-
-#define WS_FD_SETSIZE FD_SETSIZE
-#define HAVE_GETPROTOBYNAME
-#define HAVE_GETPROTOBYNUMBER
-#define HAVE_GETSERVBYPORT
-typedef struct hostent WS_hostent;
-typedef struct servent WS_servent;
-typedef struct protoent WS_protoent;
-
-#include "wine/config.h"
-#include "wine/port.h"
-
-#ifndef __REACTOS__
-#include <stdarg.h>
-#include <string.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_IPC_H
-# include <sys/ipc.h>
-#endif
-#ifdef HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-#endif
-#ifdef HAVE_SYS_FILIO_H
-# include <sys/filio.h>
-#endif
-#if defined(__svr4__)
-#include <sys/ioccom.h>
-#ifdef HAVE_SYS_SOCKIO_H
-# include <sys/sockio.h>
-#endif
-#endif
-
-#if defined(__EMX__)
-# include <sys/so_ioctl.h>
-#endif
-
-#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-
-#ifdef HAVE_SYS_MSG_H
-# include <sys/msg.h>
-#endif
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
-#ifdef HAVE_SYS_ERRNO_H
-#include <sys/errno.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <stdlib.h>
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#endif
-#ifdef HAVE_RESOLV_H
-# include <resolv.h>
-#endif
-#endif
-
-#define CALLBACK __stdcall
-
-#include "wine/winbase16.h"
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winsock2.h"
-#include "ws2spi.h"
-#include "wownt32.h"
-#include "wine/winsock16.h"
-#include "winnt.h"
-
-#include "wine/debug.h"
-
-WINE_DEFAULT_DEBUG_CHANNEL(winsock);
-
-
-/* protoptypes of some functions in socket.c
- */
-
-#define AQ_WIN16       0x00
-#define AQ_WIN32       0x04
-#define HB_WIN32(hb) (hb->flags & AQ_WIN32)
-#define AQ_NUMBER      0x00
-#define AQ_NAME                0x08
-#define AQ_COPYPTR1    0x10
-#define AQ_DUPLOWPTR1  0x20
-#define AQ_MASKPTR1    0x30
-#define AQ_COPYPTR2    0x40
-#define AQ_DUPLOWPTR2  0x80
-#define AQ_MASKPTR2    0xC0
-
-#define AQ_GETHOST     0
-#define AQ_GETPROTO    1
-#define AQ_GETSERV     2
-#define AQ_GETMASK     3
-
-/* The handles used are pseudo-handles that can be simply casted. */
-/* 16-bit values are used internally (to be sure handle comparison works right in 16-bit apps). */
-#define WSA_H32(h16) ((HANDLE)(ULONG_PTR)(h16))
-
-/* ----------------------------------- helper functions - */
-
-static int list_size(char** l, int item_size)
-{
-  int i,j = 0;
-  if(l)
-  { for(i=0;l[i];i++)
-       j += (item_size) ? item_size : strlen(l[i]) + 1;
-    j += (i + 1) * sizeof(char*); }
-  return j;
-}
-
-static int list_dup(char** l_src, char* ref, char* base, int item_size)
-{
-   /* base is either either equal to ref or 0 or SEGPTR */
-
-   char*               p = ref;
-   char**              l_to = (char**)ref;
-   int                 i,j,k;
-
-   for(j=0;l_src[j];j++) ;
-   p += (j + 1) * sizeof(char*);
-   for(i=0;i<j;i++)
-   { l_to[i] = base + (p - ref);
-     k = ( item_size ) ? item_size : strlen(l_src[i]) + 1;
-     memcpy(p, l_src[i], k); p += k; }
-   l_to[i] = NULL;
-   return (p - ref);
-}
-
-/* ----- hostent */
-
-static int hostent_size(struct hostent* p_he)
-{
-  int size = 0;
-  if( p_he )
-  { size  = sizeof(struct hostent);
-    size += strlen(p_he->h_name) + 1;
-    size += list_size(p_he->h_aliases, 0);
-    size += list_size(p_he->h_addr_list, p_he->h_length ); }
-  return size;
-}
-
-/* Copy hostent to p_to, fix up inside pointers using p_base (different for
- * Win16 (linear vs. segmented). Return -neededsize on overrun.
- */
-static int WS_copy_he(char *p_to,char *p_base,int t_size,struct hostent* p_he, int flag)
-{
-       char* p_name,*p_aliases,*p_addr,*p;
-       struct ws_hostent16 *p_to16 = (struct ws_hostent16*)p_to;
-       WS_hostent *p_to32 = (WS_hostent*)p_to;
-       int     size = hostent_size(p_he) +
-               (
-               (flag & AQ_WIN16) ? sizeof(struct ws_hostent16) : sizeof(WS_hostent)
-               - sizeof(struct hostent)
-               );
-
-       if (t_size < size)
-               return -size;
-       p = p_to;
-       p += (flag & AQ_WIN16) ?
-               sizeof(struct ws_hostent16) : sizeof(WS_hostent);
-       p_name = p;
-       strcpy(p, p_he->h_name); p += strlen(p) + 1;
-       p_aliases = p;
-       p += list_dup(p_he->h_aliases, p, p_base + (p - (char*)p_to), 0);
-       p_addr = p;
-       list_dup(p_he->h_addr_list, p, p_base + (p - (char*)p_to), p_he->h_length);
-
-       if (flag & AQ_WIN16)
-       {
-           p_to16->h_addrtype = (INT16)p_he->h_addrtype;
-           p_to16->h_length = (INT16)p_he->h_length;
-           p_to16->h_name = (SEGPTR)(p_base + (p_name - p_to));
-           p_to16->h_aliases = (SEGPTR)(p_base + (p_aliases - p_to));
-           p_to16->h_addr_list = (SEGPTR)(p_base + (p_addr - p_to));
-       }
-       else
-       {
-           p_to32->h_addrtype = p_he->h_addrtype;
-           p_to32->h_length = p_he->h_length;
-           p_to32->h_name = (p_base + (p_name - p_to));
-           p_to32->h_aliases = (char **)(p_base + (p_aliases - p_to));
-           p_to32->h_addr_list = (char **)(p_base + (p_addr - p_to));
-       }
-
-       return size;
-}
-
-/* ----- protoent */
-
-static int protoent_size(struct protoent* p_pe)
-{
-  int size = 0;
-  if( p_pe )
-  { size  = sizeof(struct protoent);
-    size += strlen(p_pe->p_name) + 1;
-    size += list_size(p_pe->p_aliases, 0); }
-  return size;
-}
-
-/* Copy protoent to p_to, fix up inside pointers using p_base (different for
- * Win16 (linear vs. segmented). Return -neededsize on overrun.
- */
-static int WS_copy_pe(char *p_to,char *p_base,int t_size,struct protoent* p_pe, int flag)
-{
-       char* p_name,*p_aliases,*p;
-       struct ws_protoent16 *p_to16 = (struct ws_protoent16*)p_to;
-       WS_protoent *p_to32 = (WS_protoent*)p_to;
-       int     size = protoent_size(p_pe) +
-               (
-               (flag & AQ_WIN16) ? sizeof(struct ws_protoent16) : sizeof(WS_protoent)
-               - sizeof(struct protoent)
-               );
-
-       if (t_size < size)
-               return -size;
-       p = p_to;
-       p += (flag & AQ_WIN16) ?
-               sizeof(struct ws_protoent16) : sizeof(WS_protoent);
-       p_name = p;
-       strcpy(p, p_pe->p_name); p += strlen(p) + 1;
-       p_aliases = p;
-       list_dup(p_pe->p_aliases, p, p_base + (p - (char*)p_to), 0);
-
-       if (flag & AQ_WIN16)
-       {
-           p_to16->p_proto = (INT16)p_pe->p_proto;
-           p_to16->p_name = (SEGPTR)(p_base) + (p_name - p_to);
-           p_to16->p_aliases = (SEGPTR)((p_base) + (p_aliases - p_to));
-       }
-       else
-       {
-           p_to32->p_proto = p_pe->p_proto;
-           p_to32->p_name = (p_base) + (p_name - p_to);
-           p_to32->p_aliases = (char **)((p_base) + (p_aliases - p_to));
-       }
-
-       return size;
-}
-
-/* ----- servent */
-
-static int servent_size(struct servent* p_se)
-{
-       int size = 0;
-       if( p_se ) {
-               size += sizeof(struct servent);
-               size += strlen(p_se->s_proto) + strlen(p_se->s_name) + 2;
-               size += list_size(p_se->s_aliases, 0);
-       }
-       return size;
-}
-
-/* Copy servent to p_to, fix up inside pointers using p_base (different for
- * Win16 (linear vs. segmented). Return -neededsize on overrun.
- * Take care of different Win16/Win32 servent structs (packing !)
- */
-static int WS_copy_se(char *p_to,char *p_base,int t_size,struct servent* p_se, int flag)
-{
-       char* p_name,*p_aliases,*p_proto,*p;
-       struct ws_servent16 *p_to16 = (struct ws_servent16*)p_to;
-       WS_servent *p_to32 = (WS_servent*)p_to;
-       int     size = servent_size(p_se) +
-               (
-               (flag & AQ_WIN16) ? sizeof(struct ws_servent16) : sizeof(WS_servent)
-               - sizeof(struct servent)
-               );
-
-       if (t_size < size)
-               return -size;
-       p = p_to;
-       p += (flag & AQ_WIN16) ?
-               sizeof(struct ws_servent16) : sizeof(WS_servent);
-       p_name = p;
-       strcpy(p, p_se->s_name); p += strlen(p) + 1;
-       p_proto = p;
-       strcpy(p, p_se->s_proto); p += strlen(p) + 1;
-       p_aliases = p;
-       list_dup(p_se->s_aliases, p, p_base + (p - p_to), 0);
-
-       if (flag & AQ_WIN16)
-       {
-           p_to16->s_port = (INT16)p_se->s_port;
-           p_to16->s_name = (SEGPTR)(p_base + (p_name - p_to));
-           p_to16->s_proto = (SEGPTR)(p_base + (p_proto - p_to));
-           p_to16->s_aliases = (SEGPTR)(p_base + (p_aliases - p_to));
-       }
-       else
-       {
-           p_to32->s_port = p_se->s_port;
-           p_to32->s_name = (p_base + (p_name - p_to));
-           p_to32->s_proto = (p_base + (p_proto - p_to));
-           p_to32->s_aliases = (char **)(p_base + (p_aliases - p_to));
-       }
-
-       return size;
-}
-
-static HANDLE16 __ws_async_handle = 0xdead;
-
-/* Generic async query struct. we use symbolic names for the different queries
- * for readability.
- */
-typedef struct _async_query {
-       HWND16          hWnd;
-       UINT16          uMsg;
-       LPCSTR          ptr1;
-#define host_name      ptr1
-#define host_addr      ptr1
-#define serv_name      ptr1
-#define proto_name     ptr1
-       LPCSTR          ptr2;
-#define serv_proto     ptr2
-       int             int1;
-#define host_len       int1
-#define proto_number   int1
-#define serv_port      int1
-       int             int2;
-#define host_type      int2
-       SEGPTR          sbuf;
-       INT16           sbuflen;
-
-       HANDLE16        async_handle;
-       int             flags;
-       int             qt;
-    char xbuf[1];
-} async_query;
-
-
-/****************************************************************************
- * The async query function.
- *
- * It is either called as a thread startup routine or directly. It has
- * to free the passed arg from the process heap and PostMessageA the async
- * result or the error code.
- *
- * FIXME:
- *     - errorhandling not verified.
- */
-static DWORD WINAPI _async_queryfun(LPVOID arg) {
-       async_query     *aq = (async_query*)arg;
-       int             size = 0;
-       WORD            fail = 0;
-       char            *targetptr = (HB_WIN32(aq)?(char*)aq->sbuf:0/*(char*)MapSL(aq->sbuf)*/);
-
-       switch (aq->flags & AQ_GETMASK) {
-       case AQ_GETHOST: {
-                       struct hostent *he;
-                       char *copy_hostent = targetptr;
-                        char buf[100];
-                        if( !(aq->host_name)) {
-                            aq->host_name = buf;
-                            if( gethostname( buf, 100) == -1) {
-                                fail = WSAENOBUFS; /* appropriate ? */
-                                break;
-                            }
-                        }
-                       he = (aq->flags & AQ_NAME) ?
-                               gethostbyname(aq->host_name):
-                               gethostbyaddr(aq->host_addr,aq->host_len,aq->host_type);
-                        if (!he) fail = WSAGetLastError();
-                       if (he) {
-                               size = WS_copy_he(copy_hostent,(char*)aq->sbuf,aq->sbuflen,he,aq->flags);
-                               if (size < 0) {
-                                       fail = WSAENOBUFS;
-                                       size = -size;
-                               }
-                       }
-               }
-               break;
-       case AQ_GETPROTO: {
-#if defined(HAVE_GETPROTOBYNAME) && defined(HAVE_GETPROTOBYNUMBER)
-                       struct protoent *pe;
-                       char *copy_protoent = targetptr;
-                       pe = (aq->flags & AQ_NAME)?
-                               getprotobyname(aq->proto_name) :
-                               getprotobynumber(aq->proto_number);
-                       if (pe) {
-                               size = WS_copy_pe(copy_protoent,(char*)aq->sbuf,aq->sbuflen,pe,aq->flags);
-                               if (size < 0) {
-                                       fail = WSAENOBUFS;
-                                       size = -size;
-                               }
-                       } else {
-                            if (aq->flags & AQ_NAME)
-                                MESSAGE("protocol %s not found; You might want to add "
-                                        "this to /etc/protocols\n", debugstr_a(aq->proto_name) );
-                            else
-                                MESSAGE("protocol number %d not found; You might want to add "
-                                        "this to /etc/protocols\n", aq->proto_number );
-                            fail = WSANO_DATA;
-                       }
-#else
-                        fail = WSANO_DATA;
-#endif
-               }
-               break;
-       case AQ_GETSERV: {
-                       struct servent  *se;
-                       char *copy_servent = targetptr;
-                       se = (aq->flags & AQ_NAME)?
-                               getservbyname(aq->serv_name,aq->serv_proto) :
-#ifdef HAVE_GETSERVBYPORT
-                               getservbyport(aq->serv_port,aq->serv_proto);
-#else
-                                NULL;
-#endif
-                       if (se) {
-                               size = WS_copy_se(copy_servent,(char*)aq->sbuf,aq->sbuflen,se,aq->flags);
-                               if (size < 0) {
-                                       fail = WSAENOBUFS;
-                                       size = -size;
-                               }
-                       } else {
-                            if (aq->flags & AQ_NAME)
-                                MESSAGE("service %s protocol %s not found; You might want to add "
-                                        "this to /etc/services\n", debugstr_a(aq->serv_name) ,
-                                        aq->serv_proto ? debugstr_a(aq->serv_proto ):"*");
-                            else
-                                MESSAGE("service on port %d protocol %s not found; You might want to add "
-                                        "this to /etc/services\n", aq->serv_port,
-                                        aq->serv_proto ? debugstr_a(aq->serv_proto ):"*");
-                            fail = WSANO_DATA;
-                       }
-               }
-               break;
-       }
-       PostMessageA(HWND_32(aq->hWnd),aq->uMsg,(WPARAM) aq->async_handle,size|(fail<<16));
-       HeapFree(GetProcessHeap(),0,arg);
-       return 0;
-}
-
-/****************************************************************************
- * The main async help function.
- *
- * It either starts a thread or just calls the function directly for platforms
- * with no thread support. This relies on the fact that PostMessage() does
- * not actually call the windowproc before the function returns.
- */
-static HANDLE16        __WSAsyncDBQuery(
-       HWND hWnd, UINT uMsg,INT int1,LPCSTR ptr1, INT int2, LPCSTR ptr2,
-       void *sbuf, INT sbuflen, UINT flags
-)
-{
-        async_query*   aq;
-       char*           pto;
-       LPCSTR          pfm;
-       int             xbuflen = 0;
-
-       /* allocate buffer to copy protocol- and service name to */
-       /* note: this is done in the calling thread so we can return */
-       /* a decent error code if the Alloc fails */
-
-       switch (flags & AQ_MASKPTR1) {
-       case 0:                                                 break;
-       case AQ_COPYPTR1:       xbuflen += int1;                break;
-       case AQ_DUPLOWPTR1:     xbuflen += strlen(ptr1) + 1;    break;
-       }
-
-       switch (flags & AQ_MASKPTR2) {
-       case 0:                                                 break;
-       case AQ_COPYPTR2:       xbuflen += int2;                break;
-       case AQ_DUPLOWPTR2:     xbuflen += strlen(ptr2) + 1;    break;
-       }
-
-       if(!(aq = HeapAlloc(GetProcessHeap(),0,sizeof(async_query) + xbuflen))) {
-               SetLastError(WSAEWOULDBLOCK); /* insufficient resources */
-               return 0;
-       }
-
-       pto = aq->xbuf;
-       if (ptr1) switch (flags & AQ_MASKPTR1) {
-       case 0:                                                                                 break;
-       case AQ_COPYPTR1:   memcpy(pto, ptr1, int1); ptr1 = pto; pto += int1;                   break;
-       case AQ_DUPLOWPTR1: pfm = ptr1; ptr1 = pto; do *pto++ = tolower(*pfm); while (*pfm++);  break;
-       }
-       if (ptr2) switch (flags & AQ_MASKPTR2) {
-       case 0:                                                                                 break;
-       case AQ_COPYPTR2:   memcpy(pto, ptr2, int2); ptr2 = pto; pto += int2;                   break;
-       case AQ_DUPLOWPTR2: pfm = ptr2; ptr2 = pto; do *pto++ = tolower(*pfm); while (*pfm++);  break;
-       }
-
-       aq->hWnd        = HWND_16(hWnd);
-       aq->uMsg        = uMsg;
-       aq->int1        = int1;
-       aq->ptr1        = ptr1;
-       aq->int2        = int2;
-       aq->ptr2        = ptr2;
-       /* avoid async_handle = 0 */
-       aq->async_handle = (++__ws_async_handle ? __ws_async_handle : ++__ws_async_handle);
-       aq->flags       = flags;
-       aq->sbuf        = (SEGPTR)sbuf;
-       aq->sbuflen     = sbuflen;
-
-#if 1
-       if (CreateThread(NULL,0,_async_queryfun,aq,0,NULL) == INVALID_HANDLE_VALUE)
-#endif
-               _async_queryfun(aq);
-       return __ws_async_handle;
-}
-
-
-/***********************************************************************
- *       WSAAsyncGetHostByAddr (WINSOCK.102)
- */
-HANDLE16 WINAPI WSAAsyncGetHostByAddr16(HWND16 hWnd, UINT16 uMsg, LPCSTR addr,
-                               INT16 len, INT16 type, SEGPTR sbuf, INT16 buflen)
-{
-       TRACE("hwnd %04x, msg %04x, addr %08x[%i]\n",
-              hWnd, uMsg, (unsigned)addr , len );
-       return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,len,addr,type,NULL,
-                               (void*)sbuf,buflen,
-                               AQ_NUMBER|AQ_COPYPTR1|AQ_WIN16|AQ_GETHOST);
-}
-
-/***********************************************************************
- *       WSAAsyncGetHostByAddr        (WS2_32.102)
- */
-HANDLE WINAPI WSAAsyncGetHostByAddr(HWND hWnd, UINT uMsg, LPCSTR addr,
-                               INT len, INT type, LPSTR sbuf, INT buflen)
-{
-       TRACE("hwnd %p, msg %04x, addr %08x[%i]\n",
-              hWnd, uMsg, (unsigned)addr , len );
-       return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,len,addr,type,NULL,sbuf,buflen,
-                               AQ_NUMBER|AQ_COPYPTR1|AQ_WIN32|AQ_GETHOST));
-}
-
-/***********************************************************************
- *       WSAAsyncGetHostByName (WINSOCK.103)
- */
-HANDLE16 WINAPI WSAAsyncGetHostByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name,
-                                      SEGPTR sbuf, INT16 buflen)
-{
-       TRACE("hwnd %04x, msg %04x, host %s, buffer %i\n",
-             hWnd, uMsg, (name)?name:"<null>", (int)buflen );
-       return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,0,name,0,NULL,
-                               (void*)sbuf,buflen,
-                               AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN16|AQ_GETHOST);
-}
-
-/***********************************************************************
- *       WSAAsyncGetHostByName (WS2_32.103)
- */
-HANDLE WINAPI WSAAsyncGetHostByName(HWND hWnd, UINT uMsg, LPCSTR name,
-                                       LPSTR sbuf, INT buflen)
-{
-       TRACE("hwnd %p, msg %08x, host %s, buffer %i\n",
-              hWnd, uMsg, (name)?name:"<null>", (int)buflen );
-       return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,sbuf,buflen,
-                               AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN32|AQ_GETHOST));
-}
-
-/***********************************************************************
- *       WSAAsyncGetProtoByName        (WINSOCK.105)
- */
-HANDLE16 WINAPI WSAAsyncGetProtoByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name,
-                                         SEGPTR sbuf, INT16 buflen)
-{
-       TRACE("hwnd %04x, msg %08x, protocol %s\n",
-              hWnd, uMsg, (name)?name:"<null>" );
-       return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,0,name,0,NULL,
-                               (void*)sbuf,buflen,
-                               AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN16|AQ_GETPROTO);
-}
-
-/***********************************************************************
- *       WSAAsyncGetProtoByName       (WS2_32.105)
- */
-HANDLE WINAPI WSAAsyncGetProtoByName(HWND hWnd, UINT uMsg, LPCSTR name,
-                                         LPSTR sbuf, INT buflen)
-{
-       TRACE("hwnd %p, msg %08x, protocol %s\n",
-              hWnd, uMsg, (name)?name:"<null>" );
-       return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,sbuf,buflen,
-                               AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN32|AQ_GETPROTO));
-}
-
-
-/***********************************************************************
- *       WSAAsyncGetProtoByNumber      (WINSOCK.104)
- */
-HANDLE16 WINAPI WSAAsyncGetProtoByNumber16(HWND16 hWnd,UINT16 uMsg,INT16 number,
-                                           SEGPTR sbuf, INT16 buflen)
-{
-       TRACE("hwnd %04x, msg %04x, num %i\n", hWnd, uMsg, number );
-       return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,number,NULL,0,NULL,
-                               (void*)sbuf,buflen,
-                               AQ_GETPROTO|AQ_NUMBER|AQ_WIN16);
-}
-
-/***********************************************************************
- *       WSAAsyncGetProtoByNumber     (WS2_32.104)
- */
-HANDLE WINAPI WSAAsyncGetProtoByNumber(HWND hWnd, UINT uMsg, INT number,
-                                           LPSTR sbuf, INT buflen)
-{
-       TRACE("hwnd %p, msg %04x, num %i\n", hWnd, uMsg, number );
-       return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,number,NULL,0,NULL,sbuf,buflen,
-                               AQ_GETPROTO|AQ_NUMBER|AQ_WIN32));
-}
-
-/***********************************************************************
- *       WSAAsyncGetServByName (WINSOCK.107)
- */
-HANDLE16 WINAPI WSAAsyncGetServByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name,
-                                        LPCSTR proto, SEGPTR sbuf, INT16 buflen)
-{
-       TRACE("hwnd %04x, msg %04x, name %s, proto %s\n",
-              hWnd, uMsg, (name)?name:"<null>", (proto)?proto:"<null>");
-       return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,0,name,0,proto,
-                               (void*)sbuf,buflen,
-                               AQ_GETSERV|AQ_NAME|AQ_DUPLOWPTR1|AQ_DUPLOWPTR2|AQ_WIN16);
-}
-
-/***********************************************************************
- *       WSAAsyncGetServByName        (WS2_32.107)
- */
-HANDLE WINAPI WSAAsyncGetServByName(HWND hWnd, UINT uMsg, LPCSTR name,
-                                        LPCSTR proto, LPSTR sbuf, INT buflen)
-{
-       TRACE("hwnd %p, msg %04x, name %s, proto %s\n",
-              hWnd, uMsg, (name)?name:"<null>", (proto)?proto:"<null>");
-       return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,0,name,0,proto,sbuf,buflen,
-                               AQ_GETSERV|AQ_NAME|AQ_DUPLOWPTR1|AQ_DUPLOWPTR2|AQ_WIN32));
-}
-
-/***********************************************************************
- *       WSAAsyncGetServByPort (WINSOCK.106)
- */
-HANDLE16 WINAPI WSAAsyncGetServByPort16(HWND16 hWnd, UINT16 uMsg, INT16 port,
-                                        LPCSTR proto, SEGPTR sbuf, INT16 buflen)
-{
-       TRACE("hwnd %04x, msg %04x, port %i, proto %s\n",
-              hWnd, uMsg, port, (proto)?proto:"<null>" );
-       return __WSAsyncDBQuery(HWND_32(hWnd),uMsg,port,NULL,0,proto,
-                               (void*)sbuf,buflen,
-                               AQ_GETSERV|AQ_NUMBER|AQ_DUPLOWPTR2|AQ_WIN16);
-}
-
-/***********************************************************************
- *       WSAAsyncGetServByPort        (WS2_32.106)
- */
-HANDLE WINAPI WSAAsyncGetServByPort(HWND hWnd, UINT uMsg, INT port,
-                                        LPCSTR proto, LPSTR sbuf, INT buflen)
-{
-       TRACE("hwnd %p, msg %04x, port %i, proto %s\n",
-              hWnd, uMsg, port, (proto)?proto:"<null>" );
-       return WSA_H32( __WSAsyncDBQuery(hWnd,uMsg,port,NULL,0,proto,sbuf,buflen,
-                               AQ_GETSERV|AQ_NUMBER|AQ_DUPLOWPTR2|AQ_WIN32));
-}
diff --git a/dll/win32/ws2_32/misc/bsd.c b/dll/win32/ws2_32/misc/bsd.c
deleted file mode 100644 (file)
index 2e39c24..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        misc/bsd.c
- * PURPOSE:     Legacy BSD sockets APIs
- * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * REVISIONS:
- *   CSH 15/06-2001 Created
- */
-#include <ws2_32.h>
-
-/*
- * @implemented
- */
-ULONG
-EXPORT
-htonl(IN ULONG hostlong)
-{
-    return DH2N(hostlong);
-}
-
-
-/*
- * @implemented
- */
-USHORT
-EXPORT
-htons(IN USHORT hostshort)
-{
-    return WH2N(hostshort);
-}
-
-
-/*
- * @implemented
- */
-ULONG
-EXPORT
-ntohl(IN ULONG netlong)
-{
-    return DN2H(netlong);
-}
-
-
-/*
- * @implemented
- */
-USHORT
-EXPORT
-ntohs(IN USHORT netshort)
-{
-    return WN2H(netshort);
-}
-
-/* EOF */
diff --git a/dll/win32/ws2_32/misc/catalog.c b/dll/win32/ws2_32/misc/catalog.c
deleted file mode 100644 (file)
index 0dc13c4..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        misc/catalog.c
- * PURPOSE:     Service Provider Catalog
- * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * REVISIONS:
- *   CSH 01/09-2000 Created
- */
-#include <ws2_32.h>
-#include <catalog.h>
-
-
-LIST_ENTRY CatalogListHead;
-CRITICAL_SECTION CatalogLock;
-
-VOID
-ReferenceProviderByPointer(PCATALOG_ENTRY Provider)
-{
-    WS_DbgPrint(MAX_TRACE, ("Provider (0x%X).\n", Provider));
-
-    //EnterCriticalSection(&Provider->Lock);
-    Provider->ReferenceCount++;
-    //LeaveCriticalSection(&Provider->Lock);
-
-    WS_DbgPrint(MAX_TRACE, ("Leaving\n"));
-}
-
-
-VOID
-DereferenceProviderByPointer(PCATALOG_ENTRY Provider)
-{
-    WS_DbgPrint(MAX_TRACE, ("Provider (0x%X).\n", Provider));
-
-#if DBG
-    if (Provider->ReferenceCount <= 0)
-    {
-        WS_DbgPrint(MIN_TRACE, ("Provider at 0x%X has invalid reference count (%ld).\n",
-                    Provider, Provider->ReferenceCount));
-    }
-#endif
-
-    //EnterCriticalSection(&Provider->Lock);
-    Provider->ReferenceCount--;
-    //LeaveCriticalSection(&Provider->Lock);
-
-    if (Provider->ReferenceCount == 0)
-    {
-        WS_DbgPrint(MAX_TRACE, ("Provider at 0x%X has reference count 0 (unloading).\n",
-                    Provider));
-
-        DestroyCatalogEntry(Provider);
-    }
-}
-
-
-PCATALOG_ENTRY
-CreateCatalogEntry(LPWSTR LibraryName)
-{
-    PCATALOG_ENTRY Provider;
-
-    WS_DbgPrint(MAX_TRACE, ("LibraryName (%S).\n", LibraryName));
-
-    Provider = HeapAlloc(GlobalHeap, 0, sizeof(CATALOG_ENTRY));
-    if (!Provider)
-        return NULL;
-
-    ZeroMemory(Provider, sizeof(CATALOG_ENTRY));
-
-    if (!RtlCreateUnicodeString(&Provider->LibraryName, LibraryName))
-    {
-        RtlFreeHeap(GlobalHeap, 0, Provider);
-        return NULL;
-    }
-
-    Provider->ReferenceCount = 1;
-
-    InitializeCriticalSection(&Provider->Lock);
-    Provider->hModule = NULL;
-
-    Provider->Mapping = NULL;
-
-    //EnterCriticalSection(&CatalogLock);
-
-    InsertTailList(&CatalogListHead, &Provider->ListEntry);
-
-    //LeaveCriticalSection(&CatalogLock);
-
-    return Provider;
-}
-
-
-INT
-DestroyCatalogEntry(PCATALOG_ENTRY Provider)
-{
-    INT Status;
-
-    WS_DbgPrint(MAX_TRACE, ("Provider (0x%X).\n", Provider));
-
-    //EnterCriticalSection(&CatalogLock);
-    RemoveEntryList(&Provider->ListEntry);
-    //LeaveCriticalSection(&CatalogLock);
-
-    HeapFree(GlobalHeap, 0, Provider->Mapping);
-
-    if (NULL != Provider->hModule)
-    {
-        Status = UnloadProvider(Provider);
-    }
-    else
-    {
-        Status = NO_ERROR;
-    }
-
-    //DeleteCriticalSection(&Provider->Lock);
-
-    HeapFree(GlobalHeap, 0, Provider);
-
-    return Status;
-}
-
-
-PCATALOG_ENTRY
-LocateProvider(LPWSAPROTOCOL_INFOW lpProtocolInfo)
-{
-    PLIST_ENTRY CurrentEntry;
-    PCATALOG_ENTRY Provider;
-    UINT i;
-
-    WS_DbgPrint(MAX_TRACE, ("lpProtocolInfo (0x%X).\n", lpProtocolInfo));
-
-    //EnterCriticalSection(&CatalogLock);
-
-    CurrentEntry = CatalogListHead.Flink;
-    while (CurrentEntry != &CatalogListHead)
-    {
-        Provider = CONTAINING_RECORD(CurrentEntry,
-                                     CATALOG_ENTRY,
-                                     ListEntry);
-
-        for (i = 0; i < Provider->Mapping->Rows; i++)
-        {
-            if ((lpProtocolInfo->iAddressFamily == (INT) Provider->Mapping->Mapping[i].AddressFamily) &&
-                (lpProtocolInfo->iSocketType    == (INT) Provider->Mapping->Mapping[i].SocketType) &&
-                ((lpProtocolInfo->iProtocol     == (INT) Provider->Mapping->Mapping[i].Protocol) ||
-                (lpProtocolInfo->iSocketType    == SOCK_RAW)))
-            {
-                //LeaveCriticalSection(&CatalogLock);
-                WS_DbgPrint(MID_TRACE, ("Returning provider at (0x%X).\n", Provider));
-                return Provider;
-            }
-        }
-
-        CurrentEntry = CurrentEntry->Flink;
-    }
-
-    //LeaveCriticalSection(&CatalogLock);
-
-    return NULL;
-}
-
-
-PCATALOG_ENTRY
-LocateProviderById(DWORD CatalogEntryId)
-{
-    PLIST_ENTRY CurrentEntry;
-    PCATALOG_ENTRY Provider;
-
-    WS_DbgPrint(MAX_TRACE, ("CatalogEntryId (%d).\n", CatalogEntryId));
-
-    //EnterCriticalSection(&CatalogLock);
-    CurrentEntry = CatalogListHead.Flink;
-    while (CurrentEntry != &CatalogListHead)
-    {
-        Provider = CONTAINING_RECORD(CurrentEntry,
-                                     CATALOG_ENTRY,
-                                     ListEntry);
-
-        if (Provider->ProtocolInfo.dwCatalogEntryId == CatalogEntryId)
-        {
-            //LeaveCriticalSection(&CatalogLock);
-            WS_DbgPrint(MID_TRACE, ("Returning provider at (0x%X)  Name (%wZ).\n",
-                        Provider, &Provider->LibraryName));
-            return Provider;
-        }
-
-        CurrentEntry = CurrentEntry->Flink;
-    }
-    //LeaveCriticalSection(&CatalogLock);
-
-    WS_DbgPrint(MID_TRACE, ("Provider was not found.\n"));
-
-    return NULL;
-}
-
-
-INT
-LoadProvider(PCATALOG_ENTRY Provider,
-             LPWSAPROTOCOL_INFOW lpProtocolInfo)
-{
-    INT Status;
-
-    WS_DbgPrint(MID_TRACE, ("Loading provider at (0x%X)  Name (%wZ).\n",
-                Provider, &Provider->LibraryName));
-
-    if (NULL == Provider->hModule)
-    {
-        /* DLL is not loaded so load it now
-         * UNICODE_STRING objects are not null-terminated, but LoadLibraryW
-         * expects a null-terminated string
-         */
-        Provider->LibraryName.Buffer[Provider->LibraryName.Length / sizeof(WCHAR)] = L'\0';
-        Provider->hModule = LoadLibraryW(Provider->LibraryName.Buffer);
-        if (NULL != Provider->hModule)
-        {
-            Provider->WSPStartup = (LPWSPSTARTUP)GetProcAddress(Provider->hModule,
-                                                                "WSPStartup");
-            if (Provider->WSPStartup)
-            {
-                WS_DbgPrint(MAX_TRACE, ("Calling WSPStartup at (0x%X).\n",
-                            Provider->WSPStartup));
-                Status = Provider->WSPStartup(MAKEWORD(2, 2),
-                                              &Provider->WSPData,
-                                              lpProtocolInfo,
-                                              UpcallTable,
-                                              &Provider->ProcTable);
-
-                /* FIXME: Validate the procedure table */
-            }
-            else
-                Status = ERROR_BAD_PROVIDER;
-        }
-        else
-            Status = ERROR_DLL_NOT_FOUND;
-    }
-    else
-        Status = NO_ERROR;
-
-    WS_DbgPrint(MID_TRACE, ("Status (%d).\n", Status));
-
-    return Status;
-}
-
-
-INT
-UnloadProvider(PCATALOG_ENTRY Provider)
-{
-    INT Status = NO_ERROR;
-
-    WS_DbgPrint(MAX_TRACE, ("Unloading provider at (0x%X)\n", Provider));
-
-    if (NULL != Provider->hModule)
-    {
-        WS_DbgPrint(MAX_TRACE, ("Calling WSPCleanup at (0x%X).\n",
-        Provider->ProcTable.lpWSPCleanup));
-        Provider->ProcTable.lpWSPCleanup(&Status);
-
-        WS_DbgPrint(MAX_TRACE, ("Calling FreeLibrary(0x%X).\n", Provider->hModule));
-        if (!FreeLibrary(Provider->hModule))
-        {
-            WS_DbgPrint(MIN_TRACE, ("Could not free library at (0x%X).\n", Provider->hModule));
-            Status = GetLastError();
-        }
-
-        Provider->hModule = NULL;
-    }
-
-    WS_DbgPrint(MAX_TRACE, ("Status (%d).\n", Status));
-
-    return Status;
-}
-
-
-VOID
-CreateCatalog(VOID)
-{
-    PCATALOG_ENTRY Provider;
-
-    InitializeCriticalSection(&CatalogLock);
-
-    InitializeListHead(&CatalogListHead);
-
-    /* FIXME: Read service provider catalog from registry
-
-    Catalog info is saved somewhere under
-    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2
-    */
-
-#if 1
-    Provider = CreateCatalogEntry(L"msafd.dll");
-    if (!Provider)
-    {
-        WS_DbgPrint(MIN_TRACE, ("Could not create catalog entry.\n"));
-        return;
-    }
-
-    /* Assume one Service Provider with id 1 */
-    Provider->ProtocolInfo.dwCatalogEntryId = 1;
-
-    Provider->Mapping = HeapAlloc(GlobalHeap,
-                                  0,
-                                  6 * sizeof(WINSOCK_MAPPING) + 3 * sizeof(DWORD));
-    if (!Provider->Mapping)
-        return;
-
-    Provider->Mapping->Rows    = 6;
-    Provider->Mapping->Columns = 3;
-
-    Provider->Mapping->Mapping[0].AddressFamily = AF_INET;
-    Provider->Mapping->Mapping[0].SocketType    = SOCK_STREAM;
-    Provider->Mapping->Mapping[0].Protocol      = 0;
-
-    Provider->Mapping->Mapping[1].AddressFamily = AF_INET;
-    Provider->Mapping->Mapping[1].SocketType    = SOCK_STREAM;
-    Provider->Mapping->Mapping[1].Protocol      = IPPROTO_TCP;
-
-    Provider->Mapping->Mapping[2].AddressFamily = AF_INET;
-    Provider->Mapping->Mapping[2].SocketType    = SOCK_DGRAM;
-    Provider->Mapping->Mapping[2].Protocol      = 0;
-
-    Provider->Mapping->Mapping[3].AddressFamily = AF_INET;
-    Provider->Mapping->Mapping[3].SocketType    = SOCK_DGRAM;
-    Provider->Mapping->Mapping[3].Protocol      = IPPROTO_UDP;
-
-    Provider->Mapping->Mapping[4].AddressFamily = AF_INET;
-    Provider->Mapping->Mapping[4].SocketType    = SOCK_RAW;
-    Provider->Mapping->Mapping[4].Protocol      = IPPROTO_ICMP;
-
-    Provider->Mapping->Mapping[5].AddressFamily = AF_INET;
-    Provider->Mapping->Mapping[5].SocketType    = SOCK_RAW;
-    Provider->Mapping->Mapping[5].Protocol      = 0;
-#endif
-}
-
-
-VOID DestroyCatalog(VOID)
-{
-    PLIST_ENTRY CurrentEntry;
-    PLIST_ENTRY NextEntry;
-    PCATALOG_ENTRY Provider;
-
-    CurrentEntry = CatalogListHead.Flink;
-    while (CurrentEntry != &CatalogListHead)
-    {
-        NextEntry = CurrentEntry->Flink;
-        Provider = CONTAINING_RECORD(CurrentEntry,
-                                     CATALOG_ENTRY,
-                                     ListEntry);
-        DestroyCatalogEntry(Provider);
-        CurrentEntry = NextEntry;
-    }
-    //DeleteCriticalSection(&CatalogLock);
-}
-
-/* EOF */
diff --git a/dll/win32/ws2_32/misc/dllmain.c b/dll/win32/ws2_32/misc/dllmain.c
deleted file mode 100644 (file)
index 78793cb..0000000
+++ /dev/null
@@ -1,896 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        misc/dllmain.c
- * PURPOSE:     DLL entry point
- * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * REVISIONS:
- *   CSH 01/09-2000 Created
- */
-
-#include <w32api.h>
-#include <ws2_32.h>
-#include <catalog.h>
-#include <handle.h>
-#include <upcall.h>
-
-#if DBG
-
-/* See debug.h for debug/trace constants */
-//DWORD DebugTraceLevel = MIN_TRACE;
-//DWORD DebugTraceLevel = MAX_TRACE;
-//DWORD DebugTraceLevel = DEBUG_ULTRA;
-DWORD DebugTraceLevel = 0;
-#endif /* DBG */
-
-/* To make the linker happy */
-VOID WINAPI KeBugCheck (ULONG BugCheckCode) {}
-
-HINSTANCE g_hInstDll;
-HANDLE GlobalHeap;
-BOOL WsaInitialized = FALSE;    /* TRUE if WSAStartup() has been successfully called */
-WSPUPCALLTABLE UpcallTable;
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSAGetLastError(VOID)
-{
-    return GetLastError();
-}
-
-
-/*
- * @implemented
- */
-VOID
-EXPORT
-WSASetLastError(IN INT iError)
-{
-    SetLastError(iError);
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSAStartup(IN  WORD wVersionRequested,
-           OUT LPWSADATA lpWSAData)
-{
-    BYTE Low, High;
-
-    WS_DbgPrint(MAX_TRACE, ("WSAStartup of ws2_32.dll\n"));
-
-    if (!g_hInstDll)
-        return WSASYSNOTREADY;
-
-    if (lpWSAData == NULL)
-        return WSAEFAULT;
-
-    Low = LOBYTE(wVersionRequested);
-    High  = HIBYTE(wVersionRequested);
-
-    if (Low < 1)
-    {
-        WS_DbgPrint(MAX_TRACE, ("Bad winsock version requested, %d,%d", Low, High));
-        return WSAVERNOTSUPPORTED;
-    }
-
-    if (Low == 1)
-    {
-        if (High == 0)
-        {
-            lpWSAData->wVersion = wVersionRequested;
-        }
-        else
-        {
-            lpWSAData->wVersion = MAKEWORD(1, 1);
-        }
-    }
-    else if (Low == 2)
-    {
-        if (High <= 2)
-        {
-            lpWSAData->wVersion = MAKEWORD(2, High);
-        }
-        else
-        {
-            lpWSAData->wVersion = MAKEWORD(2, 2);
-        }
-    }
-    else
-    {
-        lpWSAData->wVersion = MAKEWORD(2, 2);
-    }
-
-    lpWSAData->wVersion     = wVersionRequested;
-    lpWSAData->wHighVersion = MAKEWORD(2,2);
-    lstrcpyA(lpWSAData->szDescription, "WinSock 2.2");
-    lstrcpyA(lpWSAData->szSystemStatus, "Running");
-    lpWSAData->iMaxSockets  = 0;
-    lpWSAData->iMaxUdpDg    = 0;
-    lpWSAData->lpVendorInfo = NULL;
-
-    /*FIXME: increment internal counter */
-
-    WSASETINITIALIZED;
-
-    return NO_ERROR;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSACleanup(VOID)
-{
-    WS_DbgPrint(MAX_TRACE, ("WSACleanup of ws2_32.dll\n"));
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return WSANOTINITIALISED;
-    }
-
-    return NO_ERROR;
-}
-
-
-/*
- * @implemented
- */
-SOCKET
-EXPORT
-socket(IN  INT af,
-       IN  INT type,
-       IN  INT protocol)
-{
-    return WSASocketW(af,
-                      type,
-                      protocol,
-                      NULL,
-                      0,
-                      0);
-}
-
-
-/*
- * @implemented
- */
-SOCKET
-EXPORT
-WSASocketA(IN  INT af,
-           IN  INT type,
-           IN  INT protocol,
-           IN  LPWSAPROTOCOL_INFOA lpProtocolInfo,
-           IN  GROUP g,
-           IN  DWORD dwFlags)
-/*
- * FUNCTION: Creates a new socket
- */
-{
-    WSAPROTOCOL_INFOW ProtocolInfoW;
-    LPWSAPROTOCOL_INFOW p;
-    UNICODE_STRING StringU;
-    ANSI_STRING StringA;
-
-    WS_DbgPrint(MAX_TRACE, ("af (%d)  type (%d)  protocol (%d).\n",
-    af, type, protocol));
-
-    if (lpProtocolInfo)
-    {
-        memcpy(&ProtocolInfoW,
-               lpProtocolInfo,
-               sizeof(WSAPROTOCOL_INFOA) - sizeof(CHAR) * (WSAPROTOCOL_LEN + 1));
-        RtlInitAnsiString(&StringA, (LPSTR)lpProtocolInfo->szProtocol);
-        RtlInitUnicodeString(&StringU, (LPWSTR)&ProtocolInfoW.szProtocol);
-        RtlAnsiStringToUnicodeString(&StringU, &StringA, FALSE);
-        p = &ProtocolInfoW;
-    }
-    else
-    {
-        p = NULL;
-    }
-
-    return WSASocketW(af,
-                      type,
-                      protocol,
-                      p,
-                      g,
-                      dwFlags);
-}
-
-
-/*
- * @implemented
- */
-SOCKET
-EXPORT
-WSASocketW(IN  INT af,
-           IN  INT type,
-           IN  INT protocol,
-           IN  LPWSAPROTOCOL_INFOW lpProtocolInfo,
-           IN  GROUP g,
-           IN  DWORD dwFlags)
-/*
- * FUNCTION: Creates a new socket descriptor
- * ARGUMENTS:
- *     af             = Address family
- *     type           = Socket type
- *     protocol       = Protocol type
- *     lpProtocolInfo = Pointer to protocol information
- *     g              = Reserved
- *     dwFlags        = Socket flags
- * RETURNS:
- *     Created socket descriptor, or INVALID_SOCKET if it could not be created
- */
-{
-    INT Status;
-    SOCKET Socket;
-    PCATALOG_ENTRY Provider;
-    WSAPROTOCOL_INFOW ProtocolInfo;
-
-    WS_DbgPrint(MAX_TRACE, ("af (%d)  type (%d)  protocol (%d).\n",
-                af, type, protocol));
-
-    if (!WSAINITIALIZED)
-    {
-        WS_DbgPrint(MAX_TRACE, ("af (%d)  type (%d)  protocol (%d) = WSANOTINITIALISED.\n",
-                  af, type, protocol));
-        WSASetLastError(WSANOTINITIALISED);
-        return INVALID_SOCKET;
-    }
-
-    if (!lpProtocolInfo)
-    {
-        lpProtocolInfo = &ProtocolInfo;
-        ZeroMemory(&ProtocolInfo, sizeof(WSAPROTOCOL_INFOW));
-
-        ProtocolInfo.iAddressFamily = af;
-        ProtocolInfo.iSocketType    = type;
-        ProtocolInfo.iProtocol      = protocol;
-    }
-
-    Provider = LocateProvider(lpProtocolInfo);
-    if (!Provider)
-    {
-        WS_DbgPrint(MAX_TRACE, ("af (%d)  type (%d)  protocol (%d) = WSAEAFNOSUPPORT.\n",
-                    af, type, protocol));
-        WSASetLastError(WSAEAFNOSUPPORT);
-        return INVALID_SOCKET;
-    }
-
-    Status = LoadProvider(Provider, lpProtocolInfo);
-    if (Status != NO_ERROR)
-    {
-        WS_DbgPrint(MAX_TRACE, ("af (%d)  type (%d)  protocol (%d) = %d.\n",
-                    af, type, protocol, Status));
-        WSASetLastError(Status);
-        return INVALID_SOCKET;
-    }
-
-    WS_DbgPrint(MAX_TRACE, ("Calling WSPSocket at (0x%X).\n",
-                Provider->ProcTable.lpWSPSocket));
-
-    assert(Provider->ProcTable.lpWSPSocket);
-
-    WS_DbgPrint(MAX_TRACE,("About to call provider socket fn\n"));
-
-    Socket = Provider->ProcTable.lpWSPSocket(af,
-                                             type,
-                                             protocol,
-                                             lpProtocolInfo,
-                                             g,
-                                             dwFlags,
-                                             &Status);
-
-    WS_DbgPrint(MAX_TRACE,("Socket: %x, Status: %x\n", Socket, Status));
-
-    if (Status != NO_ERROR)
-    {
-        WSASetLastError(Status);
-        return INVALID_SOCKET;
-    }
-
-    WS_DbgPrint(MAX_TRACE,("Status: %x\n", Status));
-
-    return Socket;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-closesocket(IN  SOCKET s)
-/*
- * FUNCTION: Closes a socket descriptor
- * ARGUMENTS:
- *     s = Socket descriptor
- * RETURNS:
- *     0, or SOCKET_ERROR if an error ocurred
- */
-{
-    PCATALOG_ENTRY Provider;
-    INT Status;
-    INT Errno;
-
-    WS_DbgPrint(MAX_TRACE, ("s (0x%X).\n", s));
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    CloseProviderHandle((HANDLE)s);
-
-    WS_DbgPrint(MAX_TRACE,("DereferenceProviderByHandle\n"));
-
-    DereferenceProviderByPointer(Provider);
-
-    WS_DbgPrint(MAX_TRACE,("DereferenceProviderByHandle Done\n"));
-
-    Status = Provider->ProcTable.lpWSPCloseSocket(s, &Errno);
-
-    WS_DbgPrint(MAX_TRACE,("Provider Close Done\n"));
-
-    if (Status == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-    WS_DbgPrint(MAX_TRACE,("Returning success\n"));
-
-    return 0;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-select(IN      INT nfds,
-       IN OUT  LPFD_SET readfds,
-       IN OUT  LPFD_SET writefds,
-       IN OUT  LPFD_SET exceptfds,
-       IN      CONST struct timeval *timeout)
-/*
- * FUNCTION: Returns status of one or more sockets
- * ARGUMENTS:
- *     nfds      = Always ignored
- *     readfds   = Pointer to socket set to be checked for readability (optional)
- *     writefds  = Pointer to socket set to be checked for writability (optional)
- *     exceptfds = Pointer to socket set to be checked for errors (optional)
- *     timeout   = Pointer to a TIMEVAL structure indicating maximum wait time
- *                 (NULL means wait forever)
- * RETURNS:
- *     Number of ready socket descriptors, or SOCKET_ERROR if an error ocurred
- */
-{
-    PCATALOG_ENTRY Provider = NULL;
-    INT Count;
-    INT Errno;
-
-    WS_DbgPrint(MAX_TRACE, ("readfds (0x%X)  writefds (0x%X)  exceptfds (0x%X).\n",
-                readfds, writefds, exceptfds));
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        WS_DbgPrint(MID_TRACE,("Not initialized\n"));
-        return SOCKET_ERROR;
-    }
-
-    /* FIXME: Sockets in FD_SETs should be sorted by their provider */
-
-    /* FIXME: For now, assume only one service provider */
-    if ((readfds != NULL) && (readfds->fd_count > 0))
-    {
-        if (!ReferenceProviderByHandle((HANDLE)readfds->fd_array[0],
-                                       &Provider))
-        {
-            WSASetLastError(WSAENOTSOCK);
-            WS_DbgPrint(MID_TRACE,("No provider (read)\n"));
-            return SOCKET_ERROR;
-        }
-    }
-    else if ((writefds != NULL) && (writefds->fd_count > 0))
-    {
-        if (!ReferenceProviderByHandle((HANDLE)writefds->fd_array[0],
-                                       &Provider))
-        {
-            WSASetLastError(WSAENOTSOCK);
-            WS_DbgPrint(MID_TRACE,("No provider (write)\n"));
-            return SOCKET_ERROR;
-        }
-    }
-    else if ((exceptfds != NULL) && (exceptfds->fd_count > 0))
-    {
-        if (!ReferenceProviderByHandle((HANDLE)exceptfds->fd_array[0], &Provider))
-        {
-            WSASetLastError(WSAENOTSOCK);
-            WS_DbgPrint(MID_TRACE,("No provider (err)\n"));
-            return SOCKET_ERROR;
-        }
-#if 0 /* XXX empty select is not an error */
-    }
-    else
-    {
-        WSASetLastError(WSAEINVAL);
-        return SOCKET_ERROR;
-#endif
-    }
-
-    if ( !Provider )
-    {
-        if ( timeout )
-        {
-            WS_DbgPrint(MID_TRACE,("Select: used as timer\n"));
-            Sleep( timeout->tv_sec * 1000 + (timeout->tv_usec / 1000) );
-        }
-        return 0;
-    }
-    else if (Provider->ProcTable.lpWSPSelect)
-    {
-        WS_DbgPrint(MID_TRACE,("Calling WSPSelect:%x\n", Provider->ProcTable.lpWSPSelect));
-        Count = Provider->ProcTable.lpWSPSelect(nfds,
-                                                readfds,
-                                                writefds,
-                                                exceptfds,
-                                                (LPTIMEVAL)timeout,
-                                                &Errno);
-
-        WS_DbgPrint(MAX_TRACE, ("[%x] Select: Count %d Errno %x\n",
-                    Provider, Count, Errno));
-
-        DereferenceProviderByPointer(Provider);
-
-        if (Errno != NO_ERROR)
-        {
-            WSASetLastError(Errno);
-            return SOCKET_ERROR;
-        }
-    }
-    else
-    {
-        WSASetLastError(WSAEINVAL);
-        return SOCKET_ERROR;
-    }
-
-    return Count;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-bind(IN SOCKET s,
-     IN CONST struct sockaddr *name,
-     IN INT namelen)
-{
-    PCATALOG_ENTRY Provider;
-    INT Status;
-    INT Errno;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s,
-                                   &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-#if (__W32API_MAJOR_VERSION < 2 || __W32API_MINOR_VERSION < 5)
-    Status = Provider->ProcTable.lpWSPBind(s,
-                                           (CONST LPSOCKADDR)name,
-                                           namelen,
-                                           &Errno);
-#else
-    Status = Provider->ProcTable.lpWSPBind(s,
-                                           name,
-                                           namelen,
-                                           &Errno);
-#endif /* __W32API_MAJOR_VERSION < 2 || __W32API_MINOR_VERSION < 5 */
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Status == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-  return Status;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-listen(IN SOCKET s,
-       IN INT backlog)
-{
-    PCATALOG_ENTRY Provider;
-    INT Status;
-    INT Errno;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s,
-                                   &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Status = Provider->ProcTable.lpWSPListen(s,
-                                             backlog,
-                                             &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Status == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-    return Status;
-}
-
-
-/*
- * @implemented
- */
-SOCKET
-EXPORT
-accept(IN  SOCKET s,
-       OUT LPSOCKADDR addr,
-       OUT INT FAR* addrlen)
-{
-  return WSAAccept(s,
-                   addr,
-                   addrlen,
-                   NULL,
-                   0);
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-ioctlsocket(IN     SOCKET s,
-            IN     LONG cmd,
-            IN OUT ULONG FAR* argp)
-{
-    return WSAIoctl(s,
-                    cmd,
-                    argp,
-                    sizeof(ULONG),
-                    argp,
-                    sizeof(ULONG),
-                    argp,
-                    0,
-                    0);
-}
-
-
-/*
- * @implemented
- */
-SOCKET
-EXPORT
-WSAAccept(IN     SOCKET s,
-          OUT    LPSOCKADDR addr,
-          IN OUT LPINT addrlen,
-          IN     LPCONDITIONPROC lpfnCondition,
-          IN     DWORD dwCallbackData)
-{
-    PCATALOG_ENTRY Provider;
-    SOCKET Socket;
-    INT Errno;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    WS_DbgPrint(MAX_TRACE,("Calling provider accept\n"));
-
-    Socket = Provider->ProcTable.lpWSPAccept(s,
-                                             addr,
-                                             addrlen,
-                                             lpfnCondition,
-                                             dwCallbackData,
-                                             &Errno);
-
-    WS_DbgPrint(MAX_TRACE,("Calling provider accept -> Socket %x, Errno %x\n",
-                Socket, Errno));
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Socket == INVALID_SOCKET)
-        WSASetLastError(Errno);
-
-    if ( addr )
-    {
-#if DBG
-        LPSOCKADDR_IN sa = (LPSOCKADDR_IN)addr;
-        WS_DbgPrint(MAX_TRACE,("Returned address: %d %s:%d (len %d)\n",
-                               sa->sin_family,
-                               inet_ntoa(sa->sin_addr),
-                               ntohs(sa->sin_port),
-                               *addrlen));
-#endif
-    }
-
-    return Socket;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-connect(IN  SOCKET s,
-        IN  CONST struct sockaddr *name,
-        IN  INT namelen)
-{
-  return WSAConnect(s,
-                    name,
-                    namelen,
-                    NULL,
-                    NULL,
-                    NULL,
-                    NULL);
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSAConnect(IN  SOCKET s,
-           IN  CONST struct sockaddr *name,
-           IN  INT namelen,
-           IN  LPWSABUF lpCallerData,
-           OUT LPWSABUF lpCalleeData,
-           IN  LPQOS lpSQOS,
-           IN  LPQOS lpGQOS)
-{
-    PCATALOG_ENTRY Provider;
-    INT Status;
-    INT Errno;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-#if (__W32API_MAJOR_VERSION < 2 || __W32API_MINOR_VERSION < 5)
-    Status = Provider->ProcTable.lpWSPConnect(s,
-                                              (CONST LPSOCKADDR)name,
-                                              namelen,
-                                              lpCallerData,
-                                              lpCalleeData,
-                                              lpSQOS,
-                                              lpGQOS,
-                                              &Errno);
-#else
-    Status = Provider->ProcTable.lpWSPConnect(s,
-                                              name,
-                                              namelen,
-                                              lpCallerData,
-                                              lpCalleeData,
-                                              lpSQOS,
-                                              lpGQOS,
-                                              &Errno);
-#endif
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Status == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-    return Status;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSAIoctl(IN  SOCKET s,
-         IN  DWORD dwIoControlCode,
-         IN  LPVOID lpvInBuffer,
-         IN  DWORD cbInBuffer,
-         OUT LPVOID lpvOutBuffer,
-         IN  DWORD cbOutBuffer,
-         OUT LPDWORD lpcbBytesReturned,
-         IN  LPWSAOVERLAPPED lpOverlapped,
-         IN  LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
-{
-    PCATALOG_ENTRY Provider;
-    INT Status;
-    INT Errno;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Status = Provider->ProcTable.lpWSPIoctl(s,
-                                            dwIoControlCode,
-                                            lpvInBuffer,
-                                            cbInBuffer,
-                                            lpvOutBuffer,
-                                            cbOutBuffer,
-                                            lpcbBytesReturned,
-                                            lpOverlapped,
-                                            lpCompletionRoutine,
-                                            NULL /* lpThreadId */,
-                                            &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Status == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-    return Status;
-}
-
-/*
- * @implemented
- */
-INT
-EXPORT
-__WSAFDIsSet(SOCKET s, LPFD_SET set)
-{
-    unsigned int i;
-
-    for ( i = 0; i < set->fd_count; i++ )
-    if ( set->fd_array[i] == s ) return TRUE;
-
-    return FALSE;
-}
-
-void free_winsock_thread_block(PWINSOCK_THREAD_BLOCK p)
-{
-    if (p)
-    {
-        if (p->Hostent) { free_hostent(p->Hostent); p->Hostent = 0; }
-        if (p->Getservbyname){}
-        if (p->Getservbyport) {}
-    }
-}
-
-BOOL
-WINAPI
-DllMain(HANDLE hInstDll,
-        ULONG dwReason,
-        LPVOID lpReserved)
-{
-    PWINSOCK_THREAD_BLOCK p;
-
-    WS_DbgPrint(MAX_TRACE, ("DllMain of ws2_32.dll.\n"));
-
-    switch (dwReason)
-    {
-        case DLL_PROCESS_ATTACH:
-        {
-            GlobalHeap = GetProcessHeap();
-
-            g_hInstDll = hInstDll;
-
-            CreateCatalog();
-
-            InitProviderHandleTable();
-
-            UpcallTable.lpWPUCloseEvent         = WPUCloseEvent;
-            UpcallTable.lpWPUCloseSocketHandle  = WPUCloseSocketHandle;
-            UpcallTable.lpWPUCreateEvent        = WPUCreateEvent;
-            UpcallTable.lpWPUCreateSocketHandle = WPUCreateSocketHandle;
-            UpcallTable.lpWPUFDIsSet            = WPUFDIsSet;
-            UpcallTable.lpWPUGetProviderPath    = WPUGetProviderPath;
-            UpcallTable.lpWPUModifyIFSHandle    = WPUModifyIFSHandle;
-            UpcallTable.lpWPUPostMessage        = PostMessageW;
-            UpcallTable.lpWPUQueryBlockingCallback    = WPUQueryBlockingCallback;
-            UpcallTable.lpWPUQuerySocketHandleContext = WPUQuerySocketHandleContext;
-            UpcallTable.lpWPUQueueApc           = WPUQueueApc;
-            UpcallTable.lpWPUResetEvent         = WPUResetEvent;
-            UpcallTable.lpWPUSetEvent           = WPUSetEvent;
-            UpcallTable.lpWPUOpenCurrentThread  = WPUOpenCurrentThread;
-            UpcallTable.lpWPUCloseThread        = WPUCloseThread;
-
-            /* Fall through to thread attachment handler */
-        }
-        case DLL_THREAD_ATTACH:
-        {
-            p = HeapAlloc(GlobalHeap, 0, sizeof(WINSOCK_THREAD_BLOCK));
-
-            WS_DbgPrint(MAX_TRACE, ("Thread block at 0x%X.\n", p));
-
-            if (!p) {
-              return FALSE;
-            }
-
-            p->Hostent = NULL;
-            p->LastErrorValue = NO_ERROR;
-            p->Getservbyname  = NULL;
-            p->Getservbyport  = NULL;
-
-            NtCurrentTeb()->WinSockData = p;
-        }
-        break;
-
-        case DLL_PROCESS_DETACH:
-        {
-            DestroyCatalog();
-
-            FreeProviderHandleTable();
-        }
-        break;
-
-        case DLL_THREAD_DETACH:
-        {
-            p = NtCurrentTeb()->WinSockData;
-
-            if (p)
-              HeapFree(GlobalHeap, 0, p);
-        }
-        break;
-    }
-
-    WS_DbgPrint(MAX_TRACE, ("DllMain of ws2_32.dll. Leaving.\n"));
-
-    return TRUE;
-}
-
-/* EOF */
diff --git a/dll/win32/ws2_32/misc/event.c b/dll/win32/ws2_32/misc/event.c
deleted file mode 100644 (file)
index dcc5416..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        misc/event.c
- * PURPOSE:     Event handling
- * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * REVISIONS:
- *   CSH 01/09-2000 Created
- */
-#include <ws2_32.h>
-#include <handle.h>
-
-
-/*
- * @implemented
- */
-BOOL
-EXPORT
-WSACloseEvent(IN WSAEVENT hEvent)
-{
-    BOOL Success;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return FALSE;
-    }
-
-    Success = CloseHandle((HANDLE)hEvent);
-
-    if (!Success)
-        WSASetLastError(WSA_INVALID_HANDLE);
-
-    return Success;
-}
-
-
-/*
- * @implemented
- */
-WSAEVENT
-EXPORT
-WSACreateEvent(VOID)
-{
-    HANDLE Event;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return FALSE;
-    }
-
-    Event = CreateEventW(NULL, TRUE, FALSE, NULL);
-
-    if (Event == INVALID_HANDLE_VALUE)
-        WSASetLastError(WSA_INVALID_HANDLE);
-
-    return (WSAEVENT)Event;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-EXPORT
-WSAResetEvent(IN WSAEVENT hEvent)
-{
-    BOOL Success;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return FALSE;
-    }
-
-    Success = ResetEvent((HANDLE)hEvent);
-
-    if (!Success)
-        WSASetLastError(WSA_INVALID_HANDLE);
-
-    return Success;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-EXPORT
-WSASetEvent(IN WSAEVENT hEvent)
-{
-    BOOL Success;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return FALSE;
-    }
-
-    Success = SetEvent((HANDLE)hEvent);
-
-    if (!Success)
-        WSASetLastError(WSA_INVALID_HANDLE);
-
-    return Success;
-}
-
-
-/*
- * @implemented
- */
-DWORD
-EXPORT
-WSAWaitForMultipleEvents(IN  DWORD cEvents,
-                         IN  CONST WSAEVENT FAR* lphEvents,
-                         IN  BOOL fWaitAll,
-                         IN  DWORD dwTimeout,
-                         IN  BOOL fAlertable)
-{
-    DWORD Status;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return FALSE;
-    }
-
-    Status = WaitForMultipleObjectsEx(cEvents,
-                                      lphEvents,
-                                      fWaitAll,
-                                      dwTimeout,
-                                      fAlertable);
-    if (Status == WAIT_FAILED)
-    {
-        Status = GetLastError();
-
-        if (Status == ERROR_NOT_ENOUGH_MEMORY)
-            WSASetLastError(WSA_NOT_ENOUGH_MEMORY);
-        else if (Status == ERROR_INVALID_HANDLE)
-            WSASetLastError(WSA_INVALID_HANDLE);
-        else
-            WSASetLastError(WSA_INVALID_PARAMETER);
-
-        return WSA_WAIT_FAILED;
-    }
-
-    return Status;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSAEnumNetworkEvents(IN  SOCKET s,
-                     IN  WSAEVENT hEventObject,
-                     OUT LPWSANETWORKEVENTS lpNetworkEvents)
-{
-    PCATALOG_ENTRY Provider;
-    INT Status;
-    INT Errno;
-
-    WS_DbgPrint(MID_TRACE,("Called (Socket %x, hEventObject %x, "
-                "lpNetworkEvents %x)\n",
-                s,
-                hEventObject,
-                lpNetworkEvents));
-
-    if (!lpNetworkEvents)
-    {
-        WSASetLastError(WSAEINVAL);
-        return SOCKET_ERROR;
-    }
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s,
-                                   &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Status = Provider->ProcTable.lpWSPEnumNetworkEvents(s,
-                                                        hEventObject,
-                                                        lpNetworkEvents,
-                                                        &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Status == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-    WS_DbgPrint(MID_TRACE,("Leaving %x\n", Status));
-
-    return Status;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSAEventSelect(IN  SOCKET s,
-               IN  WSAEVENT hEventObject,
-               IN  LONG lNetworkEvents)
-{
-    PCATALOG_ENTRY Provider;
-    INT Status;
-    INT Errno;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Status = Provider->ProcTable.lpWSPEventSelect(s,
-                                                  hEventObject,
-                                                  lNetworkEvents,
-                                                  &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Status == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-    return Status;
-}
-
-/* EOF */
diff --git a/dll/win32/ws2_32/misc/handle.c b/dll/win32/ws2_32/misc/handle.c
deleted file mode 100644 (file)
index d5b54e3..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        misc/handle.c
- * PURPOSE:     Provider handle management
- * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * REVISIONS:
- *   CSH 01/09-2000 Created
- */
-#include <ws2_32.h>
-#include <handle.h>
-#include <catalog.h>
-
-PPROVIDER_HANDLE_BLOCK ProviderHandleTable;
-CRITICAL_SECTION ProviderHandleTableLock;
-
-PPROVIDER_HANDLE
-GetProviderByHandle(PPROVIDER_HANDLE_BLOCK HandleTable,
-                    HANDLE Handle)
-/*
- * FUNCTION: Get the data structure for a handle
- * ARGUMENTS:
- *     HandleTable = Pointer to handle table
- *     Handle      = Handle to get data structure for
- * RETURNS:
- *     Pointer to the data structure identified by the handle on success,
- *     NULL on failure
- */
-{
-    PPROVIDER_HANDLE_BLOCK Current;
-    PLIST_ENTRY CurrentEntry;
-    ULONG i;
-
-    WS_DbgPrint(MAX_TRACE, ("HandleTable (0x%X)  Handle (0x%X).\n", HandleTable, Handle));
-
-    CurrentEntry = HandleTable->Entry.Flink;
-
-    while (CurrentEntry != &HandleTable->Entry)
-    {
-        Current = CONTAINING_RECORD(CurrentEntry, PROVIDER_HANDLE_BLOCK, Entry);
-
-        for (i = 0; i < HANDLE_BLOCK_ENTRIES; i++)
-        {
-            if ((Current->Handles[i].Provider != NULL) &&
-                (Current->Handles[i].Handle == Handle))
-            {
-                return &Current->Handles[i];
-            }
-        }
-        CurrentEntry = CurrentEntry->Flink;
-    }
-
-    return NULL;
-}
-
-
-VOID
-CloseAllHandles(PPROVIDER_HANDLE_BLOCK HandleTable)
-{
-    PPROVIDER_HANDLE_BLOCK Current;
-    PLIST_ENTRY CurrentEntry;
-    PCATALOG_ENTRY Provider;
-    ULONG i;
-
-    WS_DbgPrint(MAX_TRACE, ("HandleTable (0x%X).\n", HandleTable));
-
-    CurrentEntry = HandleTable->Entry.Flink;
-
-    while (CurrentEntry != &HandleTable->Entry)
-    {
-        Current = CONTAINING_RECORD(CurrentEntry, PROVIDER_HANDLE_BLOCK, Entry);
-
-        for (i = 0; i < HANDLE_BLOCK_ENTRIES; i++)
-        {
-            Provider = Current->Handles[i].Provider;
-            if (Provider != NULL)
-            {
-                DereferenceProviderByPointer(Provider);
-                Current->Handles[i].Handle   = (HANDLE)0;
-                Current->Handles[i].Provider = NULL;
-            }
-        }
-        CurrentEntry = CurrentEntry->Flink;
-    }
-}
-
-
-VOID
-DeleteHandleTable(PPROVIDER_HANDLE_BLOCK HandleTable)
-{
-    PPROVIDER_HANDLE_BLOCK Current;
-    PLIST_ENTRY CurrentEntry;
-
-    CloseAllHandles(HandleTable);
-
-    CurrentEntry = RemoveHeadList(&HandleTable->Entry);
-
-    while (CurrentEntry != &HandleTable->Entry)
-    {
-        Current = CONTAINING_RECORD(CurrentEntry,
-                                    PROVIDER_HANDLE_BLOCK,
-                                    Entry);
-
-        HeapFree(GlobalHeap, 0, Current);
-
-        CurrentEntry = RemoveHeadList(&HandleTable->Entry);
-    }
-}
-
-
-PCATALOG_ENTRY
-DeleteProviderHandle(PPROVIDER_HANDLE_BLOCK HandleTable,
-                     HANDLE Handle)
-{
-    PPROVIDER_HANDLE Entry;
-    PCATALOG_ENTRY Provider;
-
-    WS_DbgPrint(MAX_TRACE, ("HandleTable (0x%X)  Handle (0x%X).\n", HandleTable, Handle));
-
-    Entry = GetProviderByHandle(HandleTable, Handle);
-    if (!Entry)
-        return NULL;
-
-    Provider = Entry->Provider;
-    Entry->Handle = (HANDLE)0;
-    Entry->Provider = NULL;
-
-    return Provider;
-}
-
-
-HANDLE
-CreateProviderHandleTable(PPROVIDER_HANDLE_BLOCK HandleTable,
-                          HANDLE Handle,
-                          PCATALOG_ENTRY Provider)
-{
-    PPROVIDER_HANDLE_BLOCK NewBlock;
-    PLIST_ENTRY CurrentEntry;
-    ULONG i;
-
-    WS_DbgPrint(MAX_TRACE, ("HandleTable (0x%X)  Handle (0x%X)  Provider (0x%X).\n",
-    HandleTable, Handle, Provider));
-
-    /* Scan through the currently allocated handle blocks looking for a free slot */
-    CurrentEntry = HandleTable->Entry.Flink;
-    while (CurrentEntry != &HandleTable->Entry)
-    {
-        PPROVIDER_HANDLE_BLOCK Block = CONTAINING_RECORD(CurrentEntry,
-                                                         PROVIDER_HANDLE_BLOCK,
-                                                         Entry);
-
-        for (i = 0; i < HANDLE_BLOCK_ENTRIES; i++)
-        {
-            WS_DbgPrint(MAX_TRACE, ("Considering slot %ld containing 0x%X.\n",
-                        i,
-                        Block->Handles[i].Provider));
-            if (Block->Handles[i].Provider == NULL)
-            {
-                Block->Handles[i].Handle   = Handle;
-                Block->Handles[i].Provider = Provider;
-                return Handle;
-            }
-        }
-        CurrentEntry = CurrentEntry->Flink;
-    }
-
-    /* Add a new handle block to the end of the list */
-    NewBlock = (PPROVIDER_HANDLE_BLOCK)HeapAlloc(GlobalHeap,
-                                                 0,
-                                                 sizeof(PROVIDER_HANDLE_BLOCK));
-
-    WS_DbgPrint(MID_TRACE,("using table entry %x\n", NewBlock));
-
-    if (!NewBlock)
-        return (HANDLE)0;
-
-    ZeroMemory(NewBlock, sizeof(PROVIDER_HANDLE_BLOCK));
-    InsertTailList(&HandleTable->Entry,
-                   &NewBlock->Entry);
-
-    NewBlock->Handles[0].Handle   = Handle;
-    NewBlock->Handles[0].Provider = Provider;
-
-    return Handle;
-}
-
-
-HANDLE
-CreateProviderHandle(HANDLE Handle,
-                     PCATALOG_ENTRY Provider)
-{
-    HANDLE h;
-
-    EnterCriticalSection(&ProviderHandleTableLock);
-
-    h = CreateProviderHandleTable(ProviderHandleTable,
-                                  Handle,
-                                  Provider);
-
-    LeaveCriticalSection(&ProviderHandleTableLock);
-
-    if (h != NULL)
-        ReferenceProviderByPointer(Provider);
-
-    return h;
-}
-
-
-BOOL
-ReferenceProviderByHandle(HANDLE Handle,
-                          PCATALOG_ENTRY* Provider)
-/*
- * FUNCTION: Increments the reference count for a provider and returns a pointer to it
- * ARGUMENTS:
- *     Handle   = Handle for the provider
- *     Provider = Address of buffer to place pointer to provider
- * RETURNS:
- *     TRUE if handle was valid, FALSE if not
- */
-{
-    PPROVIDER_HANDLE ProviderHandle;
-
-    WS_DbgPrint(MID_TRACE, ("Handle (0x%X)  Provider (0x%X).\n", Handle, Provider));
-
-    EnterCriticalSection(&ProviderHandleTableLock);
-
-    ProviderHandle = GetProviderByHandle(ProviderHandleTable,
-                                         Handle);
-
-    WS_DbgPrint(MID_TRACE, ("ProviderHandle is %x\n", ProviderHandle));
-
-    LeaveCriticalSection(&ProviderHandleTableLock);
-
-    if (ProviderHandle)
-    {
-        ReferenceProviderByPointer(ProviderHandle->Provider);
-        *Provider = ProviderHandle->Provider;
-    }
-
-    return (ProviderHandle != NULL);
-}
-
-
-BOOL
-CloseProviderHandle(HANDLE Handle)
-{
-    PCATALOG_ENTRY Provider;
-
-    WS_DbgPrint(MAX_TRACE, ("Handle (0x%X).\n", Handle));
-
-    EnterCriticalSection(&ProviderHandleTableLock);
-
-    Provider = DeleteProviderHandle(ProviderHandleTable,
-                                    Handle);
-    if (!Provider)
-        return FALSE;
-
-    LeaveCriticalSection(&ProviderHandleTableLock);
-
-    DereferenceProviderByPointer(Provider);
-
-    return TRUE;
-}
-
-
-BOOL
-InitProviderHandleTable(VOID)
-{
-    ProviderHandleTable =
-        (PPROVIDER_HANDLE_BLOCK)HeapAlloc(GlobalHeap,
-                                          0,
-                                          sizeof(PROVIDER_HANDLE_BLOCK));
-    if (!ProviderHandleTable)
-        return FALSE;
-
-    WS_DbgPrint(MID_TRACE,("Called\n"));
-
-    ZeroMemory(ProviderHandleTable,
-               sizeof(PROVIDER_HANDLE_BLOCK));
-
-    InitializeListHead(&ProviderHandleTable->Entry);
-
-    InitializeCriticalSection(&ProviderHandleTableLock);
-
-    return TRUE;
-}
-
-
-VOID
-FreeProviderHandleTable(VOID)
-{
-    DeleteHandleTable(ProviderHandleTable);
-
-    DeleteCriticalSection(&ProviderHandleTableLock);
-}
-
-/* EOF */
diff --git a/dll/win32/ws2_32/misc/ns.c b/dll/win32/ws2_32/misc/ns.c
deleted file mode 100644 (file)
index bb89ead..0000000
+++ /dev/null
@@ -1,1547 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        misc/ns.c
- * PURPOSE:     Namespace APIs
- * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * REVISIONS:
- *   CSH 01/09-2000 Created
- */
-#include <ctype.h>
-#include <ws2_32.h>
-#include <winbase.h>
-
-#ifndef BUFSIZ
-#define BUFSIZ 1024
-#endif/*BUFSIZ*/
-
-#ifndef MAX_HOSTNAME_LEN
-#define MAX_HOSTNAME_LEN 256
-#endif
-
-/* Name resolution APIs */
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAAddressToStringA(IN      LPSOCKADDR lpsaAddress,
-                    IN      DWORD dwAddressLength,
-                    IN      LPWSAPROTOCOL_INFOA lpProtocolInfo,
-                    OUT     LPSTR lpszAddressString,
-                    IN OUT  LPDWORD lpdwAddressStringLength)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAAddressToStringW(IN      LPSOCKADDR lpsaAddress,
-                    IN      DWORD dwAddressLength,
-                    IN      LPWSAPROTOCOL_INFOW lpProtocolInfo,
-                    OUT     LPWSTR lpszAddressString,
-                    IN OUT  LPDWORD lpdwAddressStringLength)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAEnumNameSpaceProvidersA(IN OUT  LPDWORD lpdwBufferLength,
-                           OUT     LPWSANAMESPACE_INFOA lpnspBuffer)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAEnumNameSpaceProvidersW(IN OUT  LPDWORD lpdwBufferLength,
-                           OUT     LPWSANAMESPACE_INFOW lpnspBuffer)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAGetServiceClassInfoA(IN      LPGUID lpProviderId,
-                        IN      LPGUID lpServiceClassId,
-                        IN OUT  LPDWORD lpdwBufferLength,
-                        OUT     LPWSASERVICECLASSINFOA lpServiceClassInfo)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAGetServiceClassInfoW(IN      LPGUID lpProviderId,
-                        IN      LPGUID lpServiceClassId,
-                        IN OUT  LPDWORD lpdwBufferLength,
-                        OUT     LPWSASERVICECLASSINFOW lpServiceClassInfo)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAGetServiceClassNameByClassIdA(IN      LPGUID lpServiceClassId,
-                                 OUT     LPSTR lpszServiceClassName,
-                                 IN OUT  LPDWORD lpdwBufferLength)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAGetServiceClassNameByClassIdW(IN      LPGUID lpServiceClassId,
-                                 OUT     LPWSTR lpszServiceClassName,
-                                 IN OUT  LPDWORD lpdwBufferLength)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAInstallServiceClassA(IN  LPWSASERVICECLASSINFOA lpServiceClassInfo)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAInstallServiceClassW(IN  LPWSASERVICECLASSINFOW lpServiceClassInfo)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSALookupServiceBeginA(IN  LPWSAQUERYSETA lpqsRestrictions,
-                       IN  DWORD dwControlFlags,
-                       OUT LPHANDLE lphLookup)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSALookupServiceBeginW(IN  LPWSAQUERYSETW lpqsRestrictions,
-                       IN  DWORD dwControlFlags,
-                       OUT LPHANDLE lphLookup)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSALookupServiceEnd(IN  HANDLE hLookup)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSALookupServiceNextA(IN      HANDLE hLookup,
-                      IN      DWORD dwControlFlags,
-                      IN OUT  LPDWORD lpdwBufferLength,
-                      OUT     LPWSAQUERYSETA lpqsResults)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSALookupServiceNextW(IN      HANDLE hLookup,
-                      IN      DWORD dwControlFlags,
-                      IN OUT  LPDWORD lpdwBufferLength,
-                      OUT     LPWSAQUERYSETW lpqsResults)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSARemoveServiceClass(IN  LPGUID lpServiceClassId)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSASetServiceA(IN  LPWSAQUERYSETA lpqsRegInfo,
-               IN  WSAESETSERVICEOP essOperation,
-               IN  DWORD dwControlFlags)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSASetServiceW(IN  LPWSAQUERYSETW lpqsRegInfo,
-               IN  WSAESETSERVICEOP essOperation,
-               IN  DWORD dwControlFlags)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAStringToAddressA(IN     LPSTR AddressString,
-                    IN     INT AddressFamily,
-                    IN     LPWSAPROTOCOL_INFOA lpProtocolInfo,
-                    OUT    LPSOCKADDR lpAddress,
-                    IN OUT LPINT lpAddressLength)
-{
-    INT ret, len;
-    LPWSTR szTemp;
-    LPWSAPROTOCOL_INFOW lpProtoInfoW = NULL;
-
-    len = MultiByteToWideChar(CP_ACP,
-                              0,
-                              AddressString,
-                              -1,
-                              NULL,
-                              0);
-
-    szTemp = HeapAlloc(GetProcessHeap(),
-                       0,
-                       len * sizeof(WCHAR));
-
-    MultiByteToWideChar(CP_ACP,
-                        0,
-                        AddressString,
-                        -1,
-                        szTemp,
-                        len);
-
-    if (lpProtocolInfo)
-    {
-        len =   WSAPROTOCOL_LEN+1;
-        lpProtoInfoW = HeapAlloc(GetProcessHeap(),
-                                 0,
-                                 len * sizeof(WCHAR) );
-
-        memcpy(lpProtoInfoW,
-               lpProtocolInfo,
-               sizeof(LPWSAPROTOCOL_INFOA));
-
-        MultiByteToWideChar(CP_ACP,
-                            0,
-                            lpProtocolInfo->szProtocol,
-                            -1,
-                            lpProtoInfoW->szProtocol,
-                            len);
-    }
-
-    ret = WSAStringToAddressW(szTemp,
-                              AddressFamily,
-                              lpProtoInfoW,
-                              lpAddress,
-                              lpAddressLength);
-
-    HeapFree(GetProcessHeap(),
-             0,
-             szTemp );
-
-    if (lpProtocolInfo)
-        HeapFree(GetProcessHeap(),
-                 0,
-                 lpProtoInfoW);
-
-    WSASetLastError(ret);
-        return ret;
-}
-
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSAStringToAddressW(IN      LPWSTR AddressString,
-                    IN      INT AddressFamily,
-                    IN      LPWSAPROTOCOL_INFOW lpProtocolInfo,
-                    OUT     LPSOCKADDR lpAddress,
-                    IN OUT  LPINT lpAddressLength)
-{
-    int pos=0;
-    int res=0;
-    LONG inetaddr = 0;
-    LPWSTR *bp=NULL;
-    SOCKADDR_IN *sockaddr;
-
-    if (!lpAddressLength || !lpAddress || !AddressString)
-    {
-        WSASetLastError(WSAEINVAL);
-        return SOCKET_ERROR;
-    }
-
-    sockaddr = (SOCKADDR_IN *) lpAddress;
-
-    /* Set right adress family */
-    if (lpProtocolInfo!=NULL)
-       sockaddr->sin_family = lpProtocolInfo->iAddressFamily;
-
-    else sockaddr->sin_family = AddressFamily;
-
-    /* Report size */
-    if (AddressFamily == AF_INET)
-    {
-        if (*lpAddressLength < (INT)sizeof(SOCKADDR_IN))
-        {
-            *lpAddressLength = sizeof(SOCKADDR_IN);
-            res = WSAEFAULT;
-        }
-        else
-        {
-            // translate ip string to ip
-
-            /* rest sockaddr.sin_addr.s_addr
-                   for we need to be sure it is zero when we come to while */
-            memset(lpAddress,0,sizeof(SOCKADDR_IN));
-
-            /* Set right adress family */
-            sockaddr->sin_family = AF_INET;
-
-            /* Get port number */
-            pos = wcscspn(AddressString,L":") + 1;
-
-            if (pos < (int)wcslen(AddressString))
-                sockaddr->sin_port = wcstol(&AddressString[pos],
-                                            bp,
-                                            10);
-
-            else
-                sockaddr->sin_port = 0;
-
-            /* Get ip number */
-            pos=0;
-            inetaddr=0;
-
-            while (pos < (int)wcslen(AddressString))
-            {
-                inetaddr = (inetaddr<<8) + ((UCHAR)wcstol(&AddressString[pos],
-                                                          bp,
-                                                          10));
-                pos += wcscspn( &AddressString[pos],L".") +1 ;
-            }
-
-            res = 0;
-            sockaddr->sin_addr.s_addr = inetaddr;
-
-        }
-    }
-
-    WSASetLastError(res);
-    if (!res) return 0;
-        return SOCKET_ERROR;
-}
-
-void check_hostent(struct hostent **he)
-{
-    struct hostent *new_he;
-
-    WS_DbgPrint(MID_TRACE,("*he: %x\n",*he));
-
-    if(!*he)
-    {
-        new_he = HeapAlloc(GlobalHeap,
-                           0,
-                           sizeof(struct hostent) + MAX_HOSTNAME_LEN + 1);
-
-        new_he->h_name = (PCHAR)(new_he + 1);
-        new_he->h_aliases = 0;
-        new_he->h_addrtype = 0; // AF_INET
-        new_he->h_length = 0;   // sizeof(in_addr)
-        new_he->h_addr_list = HeapAlloc(GlobalHeap,
-                                        0,
-                                        sizeof(char *) * 2);
-
-        RtlZeroMemory(new_he->h_addr_list,
-                      sizeof(char *) * 2);
-        *he = new_he;
-    }
-}
-
-void populate_hostent(struct hostent *he, char* name, DNS_A_DATA addr)
-{
-    ASSERT(he);
-
-    //he = HeapAlloc(GlobalHeap, 0, sizeof(struct hostent));
-    //he->h_name = HeapAlloc(GlobalHeap, 0, MAX_HOSTNAME_LEN+1);
-
-    strncpy(he->h_name,
-            name,
-            MAX_HOSTNAME_LEN);
-
-    if( !he->h_aliases ) {
-       he->h_aliases = HeapAlloc(GlobalHeap, 0, sizeof(char *));
-       he->h_aliases[0] = 0;
-    }
-    he->h_addrtype = AF_INET;
-    he->h_length = sizeof(IN_ADDR); //sizeof(struct in_addr);
-
-    if( he->h_addr_list[0] )
-    {
-        HeapFree(GlobalHeap,
-                 0,
-                 he->h_addr_list[0]);
-    }
-
-    he->h_addr_list[0] = HeapAlloc(GlobalHeap,
-                                   0,
-                                   MAX_HOSTNAME_LEN + 1);
-
-    WS_DbgPrint(MID_TRACE,("he->h_addr_list[0] %x\n", he->h_addr_list[0]));
-
-    RtlCopyMemory(he->h_addr_list[0],
-                  (char*)&addr.IpAddress,
-                  sizeof(addr.IpAddress));
-
-    he->h_addr_list[1] = 0;
-}
-
-
-#define HFREE(x) if(x) { HeapFree(GlobalHeap, 0, (x)); x=0; }
-void free_hostent(struct hostent *he)
-{
-    if(he)
-    {
-       char *next = 0;
-        HFREE(he->h_name);
-        if(he->h_aliases)
-       {
-           next = he->h_aliases[0];
-           while(next) { HFREE(next); next++; }
-       }
-       if(he->h_addr_list)
-       {
-           next = he->h_addr_list[0];
-           while(next) { HFREE(next); next++; }
-       }
-        HFREE(he->h_addr_list);
-       HFREE(he->h_aliases);
-        HFREE(he);
-    }
-}
-
-/* WinSock 1.1 compatible name resolution APIs */
-
-/*
- * @unimplemented
- */
-LPHOSTENT
-EXPORT
-gethostbyaddr(IN  CONST CHAR FAR* addr,
-              IN  INT len,
-              IN  INT type)
-{
-    UNIMPLEMENTED
-
-    return (LPHOSTENT)NULL;
-}
-
-/*
-  Assumes rfc 1123 - adam *
-   addr[1] = 0;
-    addr[0] = inet_addr(name);
-    strcpy( hostname, name );
-    if(addr[0] == 0xffffffff) return NULL;
-    he.h_addr_list = (void *)addr;
-    he.h_name = hostname;
-    he.h_aliases = NULL;
-    he.h_addrtype = AF_INET;
-    he.h_length = sizeof(addr);
-    return &he;
-
-<RANT>
-From the MSDN Platform SDK: Windows Sockets 2
-"The gethostbyname function cannot resolve IP address strings passed to it.
-Such a request is treated exactly as if an unknown host name were passed."
-</RANT>
-
-Defferring to the the documented behaviour, rather than the unix behaviour
-What if the hostname is in the HOSTS file? see getservbyname
-
- * @implemented
- */
-
-/* DnsQuery -- lib/dnsapi/dnsapi/query.c */
-   /* see ws2_32.h, winsock2.h*/
-    /*getnetworkparameters - iphlp api */
-/*
-REFERENCES
-
-servent -- w32api/include/winsock2.h
-PWINSOCK_THREAD_BLOCK -- ws2_32.h
-dllmain.c -- threadlocal memory allocation / deallocation
-lib/dnsapi
-
-
-*/
-      /* lib/adns/src/adns.h XXX */
-
-
-/*
-struct  hostent {
-        char    *h_name;
-        char    **h_aliases;
-        short   h_addrtype;
-        short   h_length;
-        char    **h_addr_list;
-#define h_addr h_addr_list[0]
-};
-struct  servent {
-        char    *s_name;
-        char    **s_aliases;
-        short   s_port;
-        char    *s_proto;
-};
-
-
-struct hostent defined in w32api/include/winsock2.h
-*/
-
-void free_servent(struct servent* s)
-{
-    char* next;
-    HFREE(s->s_name);
-    next = s->s_aliases[0];
-    while(next) { HFREE(next); next++; }
-    s->s_port = 0;
-    HFREE(s->s_proto);
-    HFREE(s);
-}
-
-
-
-LPHOSTENT
-EXPORT
-gethostbyname(IN  CONST CHAR FAR* name)
-{
-    enum addr_type
-    {
-        GH_INVALID,
-        GH_IPV6,
-        GH_IPV4,
-        GH_RFC1123_DNS
-    };
-    typedef enum addr_type addr_type;
-    addr_type addr;
-    int ret = 0;
-    char* found = 0;
-    DNS_STATUS dns_status = {0};
-    /* include/WinDNS.h -- look up DNS_RECORD on MSDN */
-    PDNS_RECORD dp = 0;
-    PWINSOCK_THREAD_BLOCK p;
-
-    addr = GH_INVALID;
-
-    p = NtCurrentTeb()->WinSockData;
-
-    if( !p )
-    {
-        WSASetLastError( WSANOTINITIALISED );
-        return NULL;
-    }
-
-    check_hostent(&p->Hostent);   /*XXX alloc_hostent*/
-
-    /* Hostname NULL - behave like gethostname */
-    if(name == NULL)
-    {
-        ret = gethostname(p->Hostent->h_name, MAX_HOSTNAME_LEN);
-        return p->Hostent;
-    }
-
-    if(ret)
-    {
-        WSASetLastError( WSAHOST_NOT_FOUND ); //WSANO_DATA  ??
-        return NULL;
-    }
-
-    /* Is it an IPv6 address? */
-    found = strstr(name, ":");
-    if( found != NULL )
-    {
-        addr = GH_IPV6;
-        goto act;
-    }
-
-    /* Is it an IPv4 address? */
-    if (!isalpha(name[0]))
-    {
-        addr = GH_IPV4;
-        goto act;
-    }
-
-    addr = GH_RFC1123_DNS;
-
- /* Broken out in case we want to get fancy later */
- act:
-    switch(addr)
-    {
-        case GH_IPV6:
-            WSASetLastError(STATUS_NOT_IMPLEMENTED);
-            return NULL;
-        break;
-
-        case GH_INVALID:
-            WSASetLastError(WSAEFAULT);
-            return NULL;
-        break;
-
-        /* Note: If passed an IP address, MSDN says that gethostbyname()
-                 treats it as an unknown host.
-           This is different from the unix implementation. Use inet_addr()
-        */
-        case GH_IPV4:
-        case GH_RFC1123_DNS:
-        /* DNS_TYPE_A: include/WinDNS.h */
-        /* DnsQuery -- lib/dnsapi/dnsapi/query.c */
-        dns_status = DnsQuery_A(name,
-                                DNS_TYPE_A,
-                                DNS_QUERY_STANDARD,
-                                0,
-                                /* extra dns servers */ &dp,
-                                0);
-
-        if(dns_status == 0)
-        {
-            //ASSERT(dp->wType == DNS_TYPE_A);
-            //ASSERT(dp->wDataLength == sizeof(DNS_A_DATA));
-            PDNS_RECORD curr;
-            for(curr=dp;
-                curr != NULL && curr->wType != DNS_TYPE_A;
-                curr = curr->pNext )
-            {
-                WS_DbgPrint(MID_TRACE,("wType: %i\n", curr->wType));
-                /*empty */
-            }
-
-            if(curr)
-            {
-                WS_DbgPrint(MID_TRACE,("populating hostent\n"));
-                WS_DbgPrint(MID_TRACE,("pName is (%s)\n", curr->pName));
-                populate_hostent(p->Hostent, (PCHAR)curr->pName, curr->Data.A);
-                DnsRecordListFree(dp, DnsFreeRecordList);
-                return p->Hostent;
-            }
-            else
-            {
-                DnsRecordListFree(dp, DnsFreeRecordList);
-            }
-        }
-
-        WS_DbgPrint(MID_TRACE,("Called DnsQuery, but host not found. Err: %i\n",
-                    dns_status));
-        WSASetLastError(WSAHOST_NOT_FOUND);
-        return NULL;
-
-        break;
-
-        default:
-            WSASetLastError(WSANO_RECOVERY);
-            return NULL;
-        break;
-    }
-
-    WSASetLastError(WSANO_RECOVERY);
-    return NULL;
-}
-
-/*
- * @implemented
- */
-INT
-EXPORT
-gethostname(OUT CHAR FAR* name,
-            IN  INT namelen)
-{
-    DWORD size = namelen;
-
-    int ret = GetComputerNameExA(ComputerNameDnsHostname,
-                                 name,
-                                 &size);
-    if(ret == 0)
-    {
-        WSASetLastError(WSAEFAULT);
-        return SOCKET_ERROR;
-    }
-    else
-    {
-        name[namelen-1] = '\0';
-        return 0;
-    }
-}
-
-
-/*
- * XXX arty -- Partial implementation pending a better one.  This one will
- * do for normal purposes.#include <ws2_32.h>
- *
- * Return the address of a static LPPROTOENT corresponding to the named
- * protocol.  These structs aren't very interesting, so I'm not too ashamed
- * to have this function work on builtins for now.
- *
- * @unimplemented
- */
-static CHAR *no_aliases = 0;
-static PROTOENT protocols[] =
-{
-    {"icmp",&no_aliases, IPPROTO_ICMP},
-    {"tcp", &no_aliases, IPPROTO_TCP},
-    {"udp", &no_aliases, IPPROTO_UDP},
-    {NULL, NULL, 0}
-};
-LPPROTOENT
-EXPORT
-getprotobyname(IN  CONST CHAR FAR* name)
-{
-    UINT i;
-    for (i = 0; protocols[i].p_name; i++)
-    {
-       if (_stricmp(protocols[i].p_name, name) == 0)
-         return &protocols[i];
-    }
-    return NULL;
-}
-
-/*
- * @unimplemented
- */
-LPPROTOENT
-EXPORT
-getprotobynumber(IN  INT number)
-{
-    UINT i;
-    for (i = 0; protocols[i].p_name; i++)
-    {
-       if (protocols[i].p_proto == number)
-         return &protocols[i];
-    }
-    return NULL;
-}
-
-#define SKIPWS(ptr,act) \
-{while(*ptr && isspace(*ptr)) ptr++; if(!*ptr) act;}
-#define SKIPANDMARKSTR(ptr,act) \
-{while(*ptr && !isspace(*ptr)) ptr++; \
- if(!*ptr) {act;} else { *ptr = 0; ptr++; }}
-
-
-static BOOL
-DecodeServEntFromString(IN  PCHAR ServiceString,
-                        OUT PCHAR *ServiceName,
-                        OUT PCHAR *PortNumberStr,
-                        OUT PCHAR *ProtocolStr,
-                        IN  PCHAR *Aliases,
-                        IN  DWORD MaxAlias)
-{
-    UINT NAliases = 0;
-
-    WS_DbgPrint(MAX_TRACE, ("Parsing service ent [%s]\n", ServiceString));
-
-    SKIPWS(ServiceString, return FALSE);
-    *ServiceName = ServiceString;
-    SKIPANDMARKSTR(ServiceString, return FALSE);
-    SKIPWS(ServiceString, return FALSE);
-    *PortNumberStr = ServiceString;
-    SKIPANDMARKSTR(ServiceString, ;);
-
-    while( *ServiceString && NAliases < MaxAlias - 1 )
-    {
-        SKIPWS(ServiceString, break);
-        if( *ServiceString )
-        {
-            SKIPANDMARKSTR(ServiceString, ;);
-            if( strlen(ServiceString) )
-            {
-                WS_DbgPrint(MAX_TRACE, ("Alias: %s\n", ServiceString));
-                *Aliases++ = ServiceString;
-                NAliases++;
-            }
-        }
-    }
-    *Aliases = NULL;
-
-    *ProtocolStr = strchr(*PortNumberStr,'/');
-    if( !*ProtocolStr ) return FALSE;
-    **ProtocolStr = 0; (*ProtocolStr)++;
-
-    WS_DbgPrint(MAX_TRACE, ("Parsing done: %s %s %s %d\n",
-                *ServiceName, *ProtocolStr, *PortNumberStr,
-                NAliases));
-
-    return TRUE;
-}
-
-#define ADJ_PTR(p,b1,b2) p = (p - b1) + b2
-
-/*
- * @implemented
- */
-LPSERVENT
-EXPORT
-getservbyname(IN  CONST CHAR FAR* name,
-              IN  CONST CHAR FAR* proto)
-{
-    BOOL  Found = FALSE;
-    HANDLE ServicesFile;
-    CHAR ServiceDBData[BUFSIZ] = { 0 };
-    PCHAR SystemDirectory = ServiceDBData; /* Reuse this stack space */
-    PCHAR ServicesFileLocation = "\\drivers\\etc\\services";
-    PCHAR ThisLine = 0, NextLine = 0, ServiceName = 0, PortNumberStr = 0,
-    ProtocolStr = 0, Comment = 0;
-    PCHAR Aliases[WS2_INTERNAL_MAX_ALIAS] = { 0 };
-    UINT i,SizeNeeded = 0,
-    SystemDirSize = sizeof(ServiceDBData) - 1;
-    DWORD ReadSize = 0, ValidData = 0;
-    PWINSOCK_THREAD_BLOCK p = NtCurrentTeb()->WinSockData;
-
-    if( !p )
-    {
-        WSASetLastError( WSANOTINITIALISED );
-        return NULL;
-    }
-
-    if( !name )
-    {
-        WSASetLastError( WSANO_RECOVERY );
-        return NULL;
-    }
-
-    if( !GetSystemDirectoryA( SystemDirectory, SystemDirSize ) )
-    {
-        WSASetLastError( WSANO_RECOVERY );
-        WS_DbgPrint(MIN_TRACE, ("Could not get windows system directory.\n"));
-        return NULL; /* Can't get system directory */
-    }
-
-    strncat(SystemDirectory,
-            ServicesFileLocation,
-            SystemDirSize );
-
-    ServicesFile = CreateFileA(SystemDirectory,
-                               GENERIC_READ,
-                               FILE_SHARE_READ,
-                               NULL,
-                               OPEN_EXISTING,
-                               FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
-                               NULL );
-
-    if( ServicesFile == INVALID_HANDLE_VALUE )
-    {
-        WSASetLastError( WSANO_RECOVERY );
-        return NULL;
-    }
-
-    /* Scan the services file ...
-     *
-     * We will read up to BUFSIZ bytes per pass, until the buffer does not
-     * contain a full line, then we will try to read more.
-     *
-     * We fall from the loop if the buffer does not have a line terminator.
-     */
-
-    /* Initial Read */
-    while(!Found &&
-          ReadFile(ServicesFile,
-                   ServiceDBData + ValidData,
-                   sizeof( ServiceDBData ) - ValidData,
-                   &ReadSize,
-                   NULL))
-    {
-        ValidData += ReadSize;
-        ReadSize = 0;
-        NextLine = ThisLine = ServiceDBData;
-
-        /* Find the beginning of the next line */
-        while(NextLine < ServiceDBData + ValidData &&
-              *NextLine != '\r' && *NextLine != '\n' )
-        {
-            NextLine++;
-        }
-
-        /* Zero and skip, so we can treat what we have as a string */
-        if( NextLine >= ServiceDBData + ValidData )
-            break;
-
-        *NextLine = 0; NextLine++;
-
-        Comment = strchr( ThisLine, '#' );
-        if( Comment ) *Comment = 0; /* Terminate at comment start */
-
-        if(DecodeServEntFromString(ThisLine,
-                                   &ServiceName,
-                                   &PortNumberStr,
-                                   &ProtocolStr,
-                                   Aliases,
-                                   WS2_INTERNAL_MAX_ALIAS) &&
-           !strcmp( ServiceName, name ) &&
-           (proto ? !strcmp( ProtocolStr, proto ) : TRUE) )
-        {
-
-            WS_DbgPrint(MAX_TRACE,("Found the service entry.\n"));
-            Found = TRUE;
-            SizeNeeded = sizeof(WINSOCK_GETSERVBYNAME_CACHE) +
-                (NextLine - ThisLine);
-            break;
-        }
-
-        /* Get rid of everything we read so far */
-        while( NextLine <= ServiceDBData + ValidData &&
-               isspace( *NextLine ) )
-        {
-            NextLine++;
-        }
-
-        WS_DbgPrint(MAX_TRACE,("About to move %d chars\n",
-                    ServiceDBData + ValidData - NextLine));
-
-        memmove(ServiceDBData,
-                NextLine,
-                ServiceDBData + ValidData - NextLine );
-        ValidData -= NextLine - ServiceDBData;
-        WS_DbgPrint(MAX_TRACE,("Valid bytes: %d\n", ValidData));
-    }
-
-    /* This we'll do no matter what */
-    CloseHandle( ServicesFile );
-
-    if( !Found )
-    {
-        WS_DbgPrint(MAX_TRACE,("Not found\n"));
-        WSASetLastError( WSANO_DATA );
-        return NULL;
-    }
-
-    if( !p->Getservbyname || p->Getservbyname->Size < SizeNeeded )
-    {
-        /* Free previous getservbyname buffer, allocate bigger */
-        if( p->Getservbyname )
-            HeapFree(GlobalHeap, 0, p->Getservbyname);
-        p->Getservbyname = HeapAlloc(GlobalHeap, 0, SizeNeeded);
-        if( !p->Getservbyname )
-        {
-            WS_DbgPrint(MIN_TRACE,("Couldn't allocate %d bytes\n",
-                        SizeNeeded));
-            WSASetLastError( WSATRY_AGAIN );
-            return NULL;
-        }
-        p->Getservbyname->Size = SizeNeeded;
-    }
-
-    /* Copy the data */
-    memmove(p->Getservbyname->Data,
-            ThisLine,
-            NextLine - ThisLine );
-
-    ADJ_PTR(ServiceName,ThisLine,p->Getservbyname->Data);
-    ADJ_PTR(ProtocolStr,ThisLine,p->Getservbyname->Data);
-    WS_DbgPrint(MAX_TRACE, ("ServiceName: %s, Protocol: %s\n",
-                ServiceName,
-                ProtocolStr));
-
-    for( i = 0; Aliases[i]; i++ )
-    {
-        ADJ_PTR(Aliases[i],ThisLine,p->Getservbyname->Data);
-        WS_DbgPrint(MAX_TRACE,("Aliase %d: %s\n", i, Aliases[i]));
-    }
-
-    memcpy(p->Getservbyname,
-           Aliases,
-           sizeof(Aliases));
-
-    /* Create the struct proper */
-    p->Getservbyname->ServerEntry.s_name = ServiceName;
-    p->Getservbyname->ServerEntry.s_aliases = p->Getservbyname->Aliases;
-    p->Getservbyname->ServerEntry.s_port = htons(atoi(PortNumberStr));
-    p->Getservbyname->ServerEntry.s_proto = ProtocolStr;
-
-    return &p->Getservbyname->ServerEntry;
-}
-
-
-/*
- * @implemented
- */
-LPSERVENT
-EXPORT
-getservbyport(IN  INT port,
-              IN  CONST CHAR FAR* proto)
-{
-    BOOL  Found = FALSE;
-    HANDLE ServicesFile;
-    CHAR ServiceDBData[BUFSIZ] = { 0 };
-    PCHAR SystemDirectory = ServiceDBData; /* Reuse this stack space */
-    PCHAR ServicesFileLocation = "\\drivers\\etc\\services";
-    PCHAR ThisLine = 0, NextLine = 0, ServiceName = 0, PortNumberStr = 0,
-    ProtocolStr = 0, Comment = 0;
-    PCHAR Aliases[WS2_INTERNAL_MAX_ALIAS] = { 0 };
-    UINT i,SizeNeeded = 0,
-    SystemDirSize = sizeof(ServiceDBData) - 1;
-    DWORD ReadSize = 0, ValidData = 0;
-    PWINSOCK_THREAD_BLOCK p = NtCurrentTeb()->WinSockData;
-
-    if( !p )
-    {
-        WSASetLastError( WSANOTINITIALISED );
-        return NULL;
-    }
-
-    if ( !port )
-    {
-        WSASetLastError( WSANO_RECOVERY );
-        return NULL;
-    }
-
-    if( !GetSystemDirectoryA( SystemDirectory, SystemDirSize ) )
-    {
-        WSASetLastError( WSANO_RECOVERY );
-        WS_DbgPrint(MIN_TRACE, ("Could not get windows system directory.\n"));
-        return NULL; /* Can't get system directory */
-    }
-
-    strncat(SystemDirectory,
-            ServicesFileLocation,
-            SystemDirSize );
-
-    ServicesFile = CreateFileA(SystemDirectory,
-                               GENERIC_READ,
-                               FILE_SHARE_READ,
-                               NULL,
-                               OPEN_EXISTING,
-                               FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
-                               NULL );
-
-    if( ServicesFile == INVALID_HANDLE_VALUE )
-    {
-        WSASetLastError( WSANO_RECOVERY );
-        return NULL;
-    }
-
-    /* Scan the services file ...
-     *
-     * We will read up to BUFSIZ bytes per pass, until the buffer does not
-     * contain a full line, then we will try to read more.
-     *
-     * We fall from the loop if the buffer does not have a line terminator.
-     */
-
-    /* Initial Read */
-    while(!Found &&
-          ReadFile(ServicesFile,
-                   ServiceDBData + ValidData,
-                   sizeof( ServiceDBData ) - ValidData,
-                   &ReadSize, NULL ) )
-    {
-        ValidData += ReadSize;
-        ReadSize = 0;
-        NextLine = ThisLine = ServiceDBData;
-
-        /* Find the beginning of the next line */
-        while( NextLine < ServiceDBData + ValidData &&
-               *NextLine != '\r' && *NextLine != '\n' ) NextLine++;
-
-        /* Zero and skip, so we can treat what we have as a string */
-        if( NextLine >= ServiceDBData + ValidData )
-            break;
-
-        *NextLine = 0; NextLine++;
-
-        Comment = strchr( ThisLine, '#' );
-        if( Comment ) *Comment = 0; /* Terminate at comment start */
-
-        if(DecodeServEntFromString(ThisLine,
-                                   &ServiceName,
-                                   &PortNumberStr,
-                                   &ProtocolStr,
-                                   Aliases,
-                                   WS2_INTERNAL_MAX_ALIAS ) &&
-           (htons(atoi( PortNumberStr )) == port ) &&
-           (proto ? !strcmp( ProtocolStr, proto ) : TRUE) )
-        {
-
-            WS_DbgPrint(MAX_TRACE,("Found the port entry.\n"));
-
-            Found = TRUE;
-            SizeNeeded = sizeof(WINSOCK_GETSERVBYPORT_CACHE) +
-            (NextLine - ThisLine);
-            break;
-        }
-
-        /* Get rid of everything we read so far */
-        while( NextLine <= ServiceDBData + ValidData &&
-               isspace( *NextLine ) )
-        {
-            NextLine++;
-        }
-
-        WS_DbgPrint(MAX_TRACE,("About to move %d chars\n",
-                    ServiceDBData + ValidData - NextLine));
-
-        memmove(ServiceDBData,
-                NextLine,
-                ServiceDBData + ValidData - NextLine );
-        ValidData -= NextLine - ServiceDBData;
-        WS_DbgPrint(MAX_TRACE,("Valid bytes: %d\n", ValidData));
-    }
-
-    /* This we'll do no matter what */
-    CloseHandle( ServicesFile );
-
-    if( !Found )
-    {
-        WS_DbgPrint(MAX_TRACE,("Not found\n"));
-        WSASetLastError( WSANO_DATA );
-        return NULL;
-    }
-
-    if( !p->Getservbyport || p->Getservbyport->Size < SizeNeeded )
-    {
-        /* Free previous getservbyport buffer, allocate bigger */
-        if( p->Getservbyport )
-            HeapFree(GlobalHeap, 0, p->Getservbyport);
-        p->Getservbyport = HeapAlloc(GlobalHeap,
-                                     0,
-                                     SizeNeeded);
-        if( !p->Getservbyport )
-        {
-            WS_DbgPrint(MIN_TRACE,("Couldn't allocate %d bytes\n",
-                        SizeNeeded));
-            WSASetLastError( WSATRY_AGAIN );
-            return NULL;
-        }
-        p->Getservbyport->Size = SizeNeeded;
-    }
-    /* Copy the data */
-    memmove(p->Getservbyport->Data,
-            ThisLine,
-            NextLine - ThisLine );
-
-    ADJ_PTR(PortNumberStr,ThisLine,p->Getservbyport->Data);
-    ADJ_PTR(ProtocolStr,ThisLine,p->Getservbyport->Data);
-    WS_DbgPrint(MAX_TRACE, ("Port Number: %s, Protocol: %s\n",
-                PortNumberStr, ProtocolStr));
-
-    for( i = 0; Aliases[i]; i++ )
-    {
-        ADJ_PTR(Aliases[i],ThisLine,p->Getservbyport->Data);
-        WS_DbgPrint(MAX_TRACE,("Aliases %d: %s\n", i, Aliases[i]));
-    }
-
-    memcpy(p->Getservbyport,Aliases,sizeof(Aliases));
-
-    /* Create the struct proper */
-    p->Getservbyport->ServerEntry.s_name = ServiceName;
-    p->Getservbyport->ServerEntry.s_aliases = p->Getservbyport->Aliases;
-    p->Getservbyport->ServerEntry.s_port = port;
-    p->Getservbyport->ServerEntry.s_proto = ProtocolStr;
-
-    WS_DbgPrint(MID_TRACE,("s_name: %s\n", ServiceName));
-
-    return &p->Getservbyport->ServerEntry;
-
-}
-
-
-/*
- * @implemented
- */
-ULONG
-EXPORT
-inet_addr(IN  CONST CHAR FAR* cp)
-/*
- * FUNCTION: Converts a string containing an IPv4 address to an unsigned long
- * ARGUMENTS:
- *     cp = Pointer to string with address to convert
- * RETURNS:
- *     Binary representation of IPv4 address, or INADDR_NONE
- */
-{
-    UINT i;
-    PCHAR p;
-    ULONG u = 0;
-
-    p = (PCHAR)cp;
-
-    if (!p)
-    {
-        WSASetLastError(WSAEFAULT);
-        return INADDR_NONE;
-    }
-
-    if (strlen(p) == 0)
-        return INADDR_NONE;
-
-    if (strcmp(p, " ") == 0)
-        return 0;
-
-    for (i = 0; i <= 3; i++)
-    {
-        u += (strtoul(p, &p, 0) << (i * 8));
-
-        if (strlen(p) == 0)
-            return u;
-
-        if (p[0] != '.')
-            return INADDR_NONE;
-
-        p++;
-    }
-
-    return u;
-}
-
-
-/*
- * @implemented
- */
-CHAR FAR*
-EXPORT
-inet_ntoa(IN  IN_ADDR in)
-{
-    CHAR b[10];
-    PCHAR p;
-
-    p = ((PWINSOCK_THREAD_BLOCK)NtCurrentTeb()->WinSockData)->Intoa;
-    _itoa(in.S_un.S_addr & 0xFF, b, 10);
-    strcpy(p, b);
-    _itoa((in.S_un.S_addr >> 8) & 0xFF, b, 10);
-    strcat(p, ".");
-    strcat(p, b);
-    _itoa((in.S_un.S_addr >> 16) & 0xFF, b, 10);
-    strcat(p, ".");
-    strcat(p, b);
-    _itoa((in.S_un.S_addr >> 24) & 0xFF, b, 10);
-    strcat(p, ".");
-    strcat(p, b);
-
-    return (CHAR FAR*)p;
-}
-
-
-/*
- * @implemented
- */
-VOID
-EXPORT
-freeaddrinfo(struct addrinfo *pAddrInfo)
-{
-    struct addrinfo *next, *cur;
-    cur = pAddrInfo;
-    while (cur)
-    {
-        next = cur->ai_next;
-        if (cur->ai_addr)
-          HeapFree(GetProcessHeap(), 0, cur->ai_addr);
-        if (cur->ai_canonname)
-          HeapFree(GetProcessHeap(), 0, cur->ai_canonname);
-        HeapFree(GetProcessHeap(), 0, cur);
-        cur = next;
-    }
-}
-
-
-struct addrinfo *
-new_addrinfo(struct addrinfo *prev)
-{
-    struct addrinfo *ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct addrinfo));
-    if (prev)
-      prev->ai_next = ret;
-    return ret;
-}
-
-/*
- * @implemented
- */
-INT
-EXPORT
-getaddrinfo(const char FAR * nodename,
-            const char FAR * servname,
-            const struct addrinfo FAR * hints,
-            struct addrinfo FAR * FAR * res)
-{
-    struct addrinfo *ret = NULL, *ai;
-    ULONG addr;
-    USHORT port;
-    struct servent *se;
-    char *proto;
-    LPPROTOENT pent;
-    DNS_STATUS dns_status;
-    PDNS_RECORD dp, currdns;
-    struct sockaddr_in *sin;
-
-    if (res == NULL)
-        return WSAEINVAL;
-    if (nodename == NULL && servname == NULL)
-        return WSAHOST_NOT_FOUND;
-        
-    if (!WSAINITIALIZED)
-        return WSANOTINITIALISED;
-
-    if (servname)
-    {
-        /* converting port number */
-        port = strtoul(servname, NULL, 10);
-        /* service name was specified? */
-        if (port == 0)
-        {
-            /* protocol was specified? */
-            if (hints && hints->ai_protocol)
-            {
-                pent = getprotobynumber(hints->ai_protocol);
-                if (pent == NULL)
-                  return WSAEINVAL;
-                proto = pent->p_name;
-            }
-            else
-                proto = NULL;
-            se = getservbyname(servname, proto);
-            if (se == NULL)
-                return WSATYPE_NOT_FOUND;
-            port = se->s_port;
-        }
-        else
-            port = htons(port);
-    }
-    else
-        port = 0;
-
-    if (nodename)
-    {
-        /* Is it an IPv6 address? */
-        if (strstr(nodename, ":"))
-            return WSAHOST_NOT_FOUND;
-            
-        /* Is it an IPv4 address? */
-        addr = inet_addr(nodename);
-        if (addr != INADDR_NONE)
-        {
-            ai = new_addrinfo(NULL);
-            ai->ai_family = PF_INET;
-            ai->ai_addrlen = sizeof(struct sockaddr_in);
-            ai->ai_addr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ai->ai_addrlen);
-            sin = (struct sockaddr_in *)ai->ai_addr;
-            sin->sin_family = AF_INET;
-            sin->sin_port = port;
-            RtlCopyMemory(&sin->sin_addr, &addr, sizeof(sin->sin_addr));
-            if (hints)
-            {
-                if (ai->ai_socktype == 0)
-                    ai->ai_socktype = hints->ai_socktype;
-                if (ai->ai_protocol == 0)
-                    ai->ai_protocol = hints->ai_protocol;
-            }
-            ret = ai;
-        }
-        else
-        {
-           /* resolving host name */
-            dns_status = DnsQuery_A(nodename,
-                                    DNS_TYPE_A,
-                                    DNS_QUERY_STANDARD,
-                                    0,
-                                    /* extra dns servers */ &dp,
-                                    0);
-
-            if (dns_status == 0)
-            {
-                ai = NULL;
-                for (currdns = dp; currdns; currdns = currdns->pNext )
-                {
-                    /* accept only A records */
-                    if (currdns->wType != DNS_TYPE_A) continue;
-                    
-                    ai = new_addrinfo(ai);
-                    if (ret == NULL)
-                      ret = ai;
-                    ai->ai_family = PF_INET;
-                    ai->ai_addrlen = sizeof(struct sockaddr_in);
-                    ai->ai_addr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ai->ai_addrlen);
-                    sin = (struct sockaddr_in *)ret->ai_addr;
-                    sin->sin_family = AF_INET;
-                    sin->sin_port = port;
-                    RtlCopyMemory(&sin->sin_addr, &currdns->Data.A.IpAddress, sizeof(sin->sin_addr));
-                    if (hints)
-                    {
-                        if (ai->ai_socktype == 0)
-                            ai->ai_socktype = hints->ai_socktype;
-                        if (ai->ai_protocol == 0)
-                            ai->ai_protocol = hints->ai_protocol;
-                    }
-                }
-                DnsRecordListFree(dp, DnsFreeRecordList);
-            }
-        }
-    }
-    else
-    {
-        ai = new_addrinfo(NULL);
-        ai->ai_family = PF_INET;
-        ai->ai_addrlen = sizeof(struct sockaddr_in);
-        ai->ai_addr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ai->ai_addrlen);
-        sin = (struct sockaddr_in *)ai->ai_addr;
-        sin->sin_family = AF_INET;
-        sin->sin_port = port;
-        if (hints)
-        {
-            if (!(hints->ai_flags & AI_PASSIVE))
-            {
-                sin->sin_addr.S_un.S_un_b.s_b1 = 127;
-                sin->sin_addr.S_un.S_un_b.s_b2 = 0;
-                sin->sin_addr.S_un.S_un_b.s_b3 = 0;
-                sin->sin_addr.S_un.S_un_b.s_b4 = 1;
-            }
-            if (ai->ai_socktype == 0)
-                ai->ai_socktype = hints->ai_socktype;
-            if (ai->ai_protocol == 0)
-                ai->ai_protocol = hints->ai_protocol;
-        }
-        ret = ai;
-    }
-
-    if (ret == NULL)
-        return WSAHOST_NOT_FOUND;
-        
-    if (hints && hints->ai_family != PF_UNSPEC && hints->ai_family != PF_INET)
-    {
-        freeaddrinfo(ret);
-        return WSAEAFNOSUPPORT;
-    }
-
-    *res = ret;
-    return 0;
-}
-
-/* EOF */
diff --git a/dll/win32/ws2_32/misc/sndrcv.c b/dll/win32/ws2_32/misc/sndrcv.c
deleted file mode 100644 (file)
index f1b68fe..0000000
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        misc/sndrcv.c
- * PURPOSE:     Send/receive functions
- * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * REVISIONS:
- *   CSH 01/09-2000 Created
- */
-
-#include <w32api.h>
-#include <ws2_32.h>
-#include <catalog.h>
-#include <handle.h>
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-recv(IN  SOCKET s,
-     OUT CHAR FAR* buf,
-     IN  INT len,
-     IN  INT flags)
-{
-    DWORD Error;
-    DWORD BytesReceived;
-    WSABUF WSABuf;
-
-    WS_DbgPrint(MAX_TRACE, ("s (0x%X)  buf (0x%X)  len (0x%X) flags (0x%X).\n",
-                s,
-                buf,
-                len,
-                flags));
-
-    WSABuf.len = len;
-    WSABuf.buf = (CHAR FAR*)buf;
-
-    Error = WSARecv(s,
-                    &WSABuf,
-                    1,
-                    &BytesReceived,
-                    (LPDWORD)&flags,
-                    NULL,
-                    NULL);
-
-    if( Error )
-        return -1;
-    else
-        return BytesReceived;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-recvfrom(IN      SOCKET s,
-         OUT     CHAR FAR* buf,
-         IN      INT len,
-         IN      INT flags,
-         OUT     LPSOCKADDR from,
-         IN OUT  INT FAR* fromlen)
-{
-    DWORD Error;
-    DWORD BytesReceived;
-    WSABUF WSABuf;
-
-    WS_DbgPrint(MAX_TRACE, ("s (0x%X)  buf (0x%X)  len (0x%X) flags (0x%X).\n",
-                s,
-                buf,
-                len,
-                flags));
-
-    WSABuf.len = len;
-    WSABuf.buf = (CHAR FAR*)buf;
-
-    Error = WSARecvFrom(s,
-                        &WSABuf,
-                        1,
-                        &BytesReceived,
-                        (LPDWORD)&flags,
-                        from,
-                        fromlen,
-                        NULL,
-                        NULL);
-
-    if( Error )
-        return -1;
-    else
-        return BytesReceived;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-send(IN  SOCKET s,
-     IN  CONST CHAR FAR* buf,
-     IN  INT len,
-     IN  INT flags)
-{
-    DWORD BytesSent;
-    DWORD Error;
-    WSABUF WSABuf;
-
-    WS_DbgPrint(MAX_TRACE, ("s (0x%X)  buf (0x%X)  len (0x%X) flags (0x%X).\n",
-                s,
-                buf,
-                len,
-                flags));
-
-    WSABuf.len = len;
-    WSABuf.buf = (CHAR FAR*)buf;
-
-    Error = WSASend(s,
-                    &WSABuf,
-                    1,
-                    &BytesSent,
-                    flags,
-                    NULL,
-                    NULL);
-
-    if( Error )
-    {
-        WS_DbgPrint(MAX_TRACE,("Reporting error %d\n", Error));
-        return -1;
-    }
-    else
-    {
-        WS_DbgPrint(MAX_TRACE,("Read %d bytes\n", BytesSent));
-        return BytesSent;
-    }
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-sendto(IN  SOCKET s,
-       IN  CONST CHAR FAR* buf,
-       IN  INT len,
-       IN  INT flags,
-       IN  CONST struct sockaddr *to,
-       IN  INT tolen)
-{
-    DWORD Error;
-    DWORD BytesSent;
-    WSABUF WSABuf;
-
-    WS_DbgPrint(MAX_TRACE, ("s (0x%X)  buf (0x%X)  len (0x%X) flags (0x%X).\n",
-                s,
-                buf,
-                len,
-                flags));
-
-    WSABuf.len = len;
-    WSABuf.buf = (CHAR FAR*)buf;
-
-    Error = WSASendTo(s,
-                      &WSABuf,
-                      1,
-                      &BytesSent,
-                      flags,
-                      to,
-                      tolen,
-                      NULL,
-                      NULL);
-
-    if( Error )
-        return -1;
-    else
-        return BytesSent;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSARecv(IN      SOCKET s,
-        IN OUT  LPWSABUF lpBuffers,
-        IN      DWORD dwBufferCount,
-        OUT     LPDWORD lpNumberOfBytesRecvd,
-        IN OUT  LPDWORD lpFlags,
-        IN      LPWSAOVERLAPPED lpOverlapped,
-        IN      LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
-{
-    PCATALOG_ENTRY Provider;
-    INT Errno;
-    INT Code;
-
-    WS_DbgPrint(MAX_TRACE, ("Called.\n"));
-
-    if (!ReferenceProviderByHandle((HANDLE)s,
-                                   &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    assert(Provider->ProcTable.lpWSPRecv);
-
-    Code = Provider->ProcTable.lpWSPRecv(s,
-                                         lpBuffers,
-                                         dwBufferCount,
-                                         lpNumberOfBytesRecvd,
-                                         lpFlags,
-                                         lpOverlapped,
-                                         lpCompletionRoutine,
-                                         NULL /* lpThreadId */,
-                                         &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Code == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-    return Code;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSARecvDisconnect(IN  SOCKET s,
-                  OUT LPWSABUF lpInboundDisconnectData)
-{
-    UNIMPLEMENTED
-
-    return 0;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSARecvFrom(IN      SOCKET s,
-            IN OUT  LPWSABUF lpBuffers,
-            IN      DWORD dwBufferCount,
-            OUT     LPDWORD lpNumberOfBytesRecvd,
-            IN OUT  LPDWORD lpFlags,
-            OUT     LPSOCKADDR lpFrom,
-            IN OUT  LPINT lpFromlen,
-            IN      LPWSAOVERLAPPED lpOverlapped,
-            IN      LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
-{
-    PCATALOG_ENTRY Provider;
-    INT Errno;
-    INT Code;
-
-    WS_DbgPrint(MAX_TRACE, ("Called.\n"));
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    assert(Provider->ProcTable.lpWSPRecvFrom);
-
-    Code = Provider->ProcTable.lpWSPRecvFrom(s,
-                                             lpBuffers,
-                                             dwBufferCount,
-                                             lpNumberOfBytesRecvd,
-                                             lpFlags,
-                                             lpFrom,
-                                             lpFromlen,
-                                             lpOverlapped,
-                                             lpCompletionRoutine,
-                                             NULL /* lpThreadId */,
-                                             &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Code == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-    return Code;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSASend(IN  SOCKET s,
-        IN  LPWSABUF lpBuffers,
-        IN  DWORD dwBufferCount,
-        OUT LPDWORD lpNumberOfBytesSent,
-        IN  DWORD dwFlags,
-        IN  LPWSAOVERLAPPED lpOverlapped,
-        IN  LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
-{
-    PCATALOG_ENTRY Provider;
-    INT Errno;
-    INT Code;
-
-    WS_DbgPrint(MAX_TRACE, ("Called.\n"));
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    assert(Provider->ProcTable.lpWSPSend);
-
-    Code = Provider->ProcTable.lpWSPSend(s,
-                                         lpBuffers,
-                                         dwBufferCount,
-                                         lpNumberOfBytesSent,
-                                         dwFlags,
-                                         lpOverlapped,
-                                         lpCompletionRoutine,
-                                         NULL /* lpThreadId */,
-                                         &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Code == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-    return Code;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSASendDisconnect(IN  SOCKET s,
-                  IN  LPWSABUF lpOutboundDisconnectData)
-{
-    UNIMPLEMENTED
-
-    return 0;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSASendTo(IN  SOCKET s,
-          IN  LPWSABUF lpBuffers,
-          IN  DWORD dwBufferCount,
-          OUT LPDWORD lpNumberOfBytesSent,
-          IN  DWORD dwFlags,
-          IN  CONST struct sockaddr *lpTo,
-          IN  INT iToLen,
-          IN  LPWSAOVERLAPPED lpOverlapped,
-          IN  LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
-{
-    PCATALOG_ENTRY Provider;
-    INT Errno;
-    INT Code;
-
-    WS_DbgPrint(MAX_TRACE, ("Called.\n"));
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    assert(Provider->ProcTable.lpWSPSendTo);
-
-#if (__W32API_MAJOR_VERSION < 2 || __W32API_MINOR_VERSION < 5)
-    Code = Provider->ProcTable.lpWSPSendTo(s,
-                                           lpBuffers,
-                                           dwBufferCount,
-                                           lpNumberOfBytesSent,
-                                           dwFlags,
-                                           (CONST LPSOCKADDR)lpTo,
-                                           iToLen,
-                                           lpOverlapped,
-                                           lpCompletionRoutine,
-                                           NULL /* lpThreadId */,
-                                           &Errno);
-#else
-    Code = Provider->ProcTable.lpWSPSendTo(s,
-                                           lpBuffers,
-                                           dwBufferCount,
-                                           lpNumberOfBytesSent,
-                                           dwFlags,
-                                           lpTo,
-                                           iToLen,
-                                           lpOverlapped,
-                                           lpCompletionRoutine,
-                                           NULL /* lpThreadId */,
-                                           &Errno);
-#endif /* __W32API_MAJOR_VERSION < 2 || __W32API_MINOR_VERSION < 5 */
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Code == SOCKET_ERROR)
-        WSASetLastError(Errno);
-
-    return Code;
-}
-
-/* EOF */
diff --git a/dll/win32/ws2_32/misc/stubs.c b/dll/win32/ws2_32/misc/stubs.c
deleted file mode 100644 (file)
index 408f282..0000000
+++ /dev/null
@@ -1,938 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        misc/stubs.c
- * PURPOSE:     Stubs
- * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * REVISIONS:
- *   CSH 01/09-2000 Created
- */
-#include <ws2_32.h>
-#include <catalog.h>
-#include <handle.h>
-
-/*
- * @implemented
- */
-INT
-EXPORT
-getpeername(IN     SOCKET s,
-            OUT    LPSOCKADDR name,
-            IN OUT INT FAR* namelen)
-{
-    int Error;
-    INT Errno;
-    PCATALOG_ENTRY Provider;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Error = Provider->ProcTable.lpWSPGetPeerName(s,
-                                                 name,
-                                                 namelen,
-                                                 &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Error == SOCKET_ERROR)
-    {
-        WSASetLastError(Errno);
-    }
-
-    return Error;
-}
-
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-getsockname(IN     SOCKET s,
-            OUT    LPSOCKADDR name,
-            IN OUT INT FAR* namelen)
-{
-    int Error;
-    INT Errno;
-    PCATALOG_ENTRY Provider;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s,
-                                   &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Error = Provider->ProcTable.lpWSPGetSockName(s,
-                                                 name,
-                                                 namelen,
-                                                 &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Error == SOCKET_ERROR)
-    {
-        WSASetLastError(Errno);
-    }
-
-    return Error;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-getsockopt(IN      SOCKET s,
-           IN      INT level,
-           IN      INT optname,
-           OUT     CHAR FAR* optval,
-           IN OUT  INT FAR* optlen)
-{
-    PCATALOG_ENTRY Provider;
-    INT Errno;
-    int Error;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s,
-                                   &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Error = Provider->ProcTable.lpWSPGetSockOpt(s,
-                                                level,
-                                                optname,
-                                                optval,
-                                                optlen,
-                                                &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Error == SOCKET_ERROR)
-    {
-        WSASetLastError(Errno);
-    }
-
-    return Error;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT __stdcall
-setsockopt(IN  SOCKET s,
-           IN  INT level,
-           IN  INT optname,
-           IN  CONST CHAR FAR* optval,
-           IN  INT optlen)
-{
-    PCATALOG_ENTRY Provider;
-    INT Errno;
-    int Error;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if(IS_INTRESOURCE(optval))
-    {
-        SetLastError(WSAEFAULT);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Error = Provider->ProcTable.lpWSPSetSockOpt(s,
-                                                  level,
-                                                optname,
-                                                optval,
-                                                optlen,
-                                                &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Error == SOCKET_ERROR)
-    {
-        WSASetLastError(Errno);
-    }
-
-    return Error;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-shutdown(IN  SOCKET s,
-         IN  INT how)
-{
-    PCATALOG_ENTRY Provider;
-    INT Errno;
-    int Error;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Error = Provider->ProcTable.lpWSPShutdown(s,
-                                              how,
-                                              &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Error == SOCKET_ERROR)
-    {
-        WSASetLastError(Errno);
-    }
-
-    return Error;
-}
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSAAsyncSelect(IN  SOCKET s,
-               IN  HWND hWnd,
-               IN  UINT wMsg,
-               IN  LONG lEvent)
-{
-    PCATALOG_ENTRY Provider;
-    INT Errno;
-    int Error;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Error = Provider->ProcTable.lpWSPAsyncSelect(s,
-                                                 hWnd,
-                                                 wMsg,
-                                                 lEvent,
-                                                 &Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Error == SOCKET_ERROR)
-    {
-        WSASetLastError(Errno);
-    }
-
-    return Error;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSACancelBlockingCall(VOID)
-{
-#if 0
-    INT Errno;
-    int Error;
-    PCATALOG_ENTRY Provider;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Error = Provider->ProcTable.lpWSPCancelBlockingCall(&Errno);
-
-    DereferenceProviderByPointer(Provider);
-
-    if (Error == SOCKET_ERROR)
-    {
-        WSASetLastError(Errno);
-    }
-
-    return Error;
-#endif
-
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSADuplicateSocketA(IN  SOCKET s,
-                    IN  DWORD dwProcessId,
-                    OUT LPWSAPROTOCOL_INFOA lpProtocolInfo)
-{
-#if 0
-    WSAPROTOCOL_INFOA ProtocolInfoU;
-
-    Error  = WSADuplicateSocketW(s,
-                               dwProcessId,
-                               &ProtocolInfoU);
-
-    if (Error == NO_ERROR)
-    {
-        UnicodeToAnsi(lpProtocolInfo,
-                      ProtocolInfoU,
-                      sizeof(
-
-    }
-
-    return Error;
-#endif
-
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-
-/*
- * @implemented
- */
-INT
-EXPORT
-WSADuplicateSocketW(IN  SOCKET s,
-                    IN  DWORD dwProcessId,
-                    OUT LPWSAPROTOCOL_INFOW lpProtocolInfo)
-{
-    INT Errno;
-    int Error;
-    PCATALOG_ENTRY Provider;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Error = Provider->ProcTable.lpWSPDuplicateSocket(s,
-                                                     dwProcessId,
-                                                     lpProtocolInfo,
-                                                     &Errno);
-    DereferenceProviderByPointer(Provider);
-
-    if (Error == SOCKET_ERROR)
-    {
-        WSASetLastError(Errno);
-    }
-
-    return Error;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAEnumProtocolsA(IN      LPINT lpiProtocols,
-                  OUT     LPWSAPROTOCOL_INFOA lpProtocolBuffer,
-                  IN OUT  LPDWORD lpdwBufferLength)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAEnumProtocolsW(IN      LPINT lpiProtocols,
-                  OUT     LPWSAPROTOCOL_INFOW lpProtocolBuffer,
-                  IN OUT  LPDWORD lpdwBufferLength)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-EXPORT
-WSAGetOverlappedResult(IN  SOCKET s,
-                       IN  LPWSAOVERLAPPED lpOverlapped,
-                       OUT LPDWORD lpcbTransfer,
-                       IN  BOOL fWait,
-                       OUT LPDWORD lpdwFlags)
-{
-    INT Errno;
-    BOOL Success;
-    PCATALOG_ENTRY Provider;
-
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &Provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    Success = Provider->ProcTable.lpWSPGetOverlappedResult(s,
-                                                          lpOverlapped,
-                                                          lpcbTransfer,
-                                                          fWait,
-                                                          lpdwFlags,
-                                                          &Errno);
-    DereferenceProviderByPointer(Provider);
-
-    if (Success == FALSE)
-    {
-        WSASetLastError(Errno);
-    }
-
-    return Success;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-EXPORT
-WSAGetQOSByName(IN      SOCKET s,
-                IN OUT  LPWSABUF lpQOSName,
-                OUT     LPQOS lpQOS)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAHtonl(IN  SOCKET s,
-         IN  ULONG hostLONG,
-         OUT ULONG FAR* lpnetlong)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAHtons(IN  SOCKET s,
-         IN  USHORT hostshort,
-         OUT USHORT FAR* lpnetshort)
-{
-    PCATALOG_ENTRY provider;
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    switch (provider->ProtocolInfo.iNetworkByteOrder)
-    {
-    case BIGENDIAN:
-        *lpnetshort = htons(hostshort);
-        break;
-    case LITTLEENDIAN:
-#ifdef LE
-        *lpnetshort = hostshort;
-#else
-        *lpnetshort = (((hostshort & 0xFF00) >> 8) | ((hostshort & 0x00FF) << 8));
-#endif
-        break;
-    }
-    return 0;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-EXPORT
-WSAIsBlocking(VOID)
-{
-    UNIMPLEMENTED
-
-    return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-SOCKET
-EXPORT
-WSAJoinLeaf(IN  SOCKET s,
-            IN  CONST struct sockaddr *name,
-            IN  INT namelen,
-            IN  LPWSABUF lpCallerData,
-            OUT LPWSABUF lpCalleeData,
-            IN  LPQOS lpSQOS,
-            IN  LPQOS lpGQOS,
-            IN  DWORD dwFlags)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return INVALID_SOCKET;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSANtohl(IN  SOCKET s,
-         IN  ULONG netlong,
-         OUT ULONG FAR* lphostlong)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSANtohs(IN  SOCKET s,
-         IN  USHORT netshort,
-         OUT USHORT FAR* lphostshort)
-{
-    PCATALOG_ENTRY provider;
-    if (!WSAINITIALIZED)
-    {
-        WSASetLastError(WSANOTINITIALISED);
-        return SOCKET_ERROR;
-    }
-
-    if (!ReferenceProviderByHandle((HANDLE)s, &provider))
-    {
-        WSASetLastError(WSAENOTSOCK);
-        return SOCKET_ERROR;
-    }
-
-    switch (provider->ProtocolInfo.iNetworkByteOrder)
-    {
-    case BIGENDIAN:
-        *lphostshort = ntohs(netshort);
-        break;
-    case LITTLEENDIAN:
-#ifdef LE
-        *lphostshort = netshort;
-#else
-        *lphostshort = (((netshort & 0xFF00) >> 8) | ((netshort & 0x00FF) << 8));
-#endif
-        break;
-    }
-    return 0;
-}
-
-
-/*
- * @unimplemented
- */
-FARPROC
-EXPORT
-WSASetBlockingHook(IN  FARPROC lpBlockFunc)
-{
-    UNIMPLEMENTED
-
-    return (FARPROC)0;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAUnhookBlockingHook(VOID)
-{
-    UNIMPLEMENTED
-
-    return 0;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSAProviderConfigChange(IN OUT  LPHANDLE lpNotificationHandle,
-                        IN      LPWSAOVERLAPPED lpOverlapped,
-                        IN      LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSACancelAsyncRequest(IN  HANDLE hAsyncTaskHandle)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-/* WinSock Service Provider support functions */
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WPUCompleteOverlappedRequest(IN  SOCKET s,
-                             IN  LPWSAOVERLAPPED lpOverlapped,
-                             IN  DWORD dwError,
-                             IN  DWORD cbTransferred,
-                             OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSCDeinstallProvider(IN  LPGUID lpProviderId,
-                     OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSCEnumProtocols(IN      LPINT lpiProtocols,
-                 OUT     LPWSAPROTOCOL_INFOW lpProtocolBuffer,
-                 IN OUT  LPDWORD lpdwBufferLength,
-                 OUT     LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSCGetProviderPath(IN      LPGUID lpProviderId,
-                   OUT     LPWSTR lpszProviderDllPath,
-                   IN OUT  LPINT lpProviderDllPathLen,
-                   OUT     LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSCInstallProvider(IN  LPGUID lpProviderId,
-                   IN  CONST WCHAR* lpszProviderDllPath,
-                   IN  CONST LPWSAPROTOCOL_INFOW lpProtocolInfoList,
-                   IN  DWORD dwNumberOfEntries,
-                   OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSCEnableNSProvider(IN  LPGUID lpProviderId,
-                    IN  BOOL fEnable)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSCInstallNameSpace(IN  LPWSTR lpszIdentifier,
-                    IN  LPWSTR lpszPathName,
-                    IN  DWORD dwNameSpace,
-                    IN  DWORD dwVersion,
-                    IN  LPGUID lpProviderId)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSCUnInstallNameSpace(IN  LPGUID lpProviderId)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSCWriteProviderOrder(IN  LPDWORD lpwdCatalogEntryId,
-                      IN  DWORD dwNumberOfEntries)
-{
-    UNIMPLEMENTED
-
-    return WSASYSCALLFAILURE;
-}
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSANSPIoctl(HANDLE           hLookup,
-            DWORD            dwControlCode,
-            LPVOID           lpvInBuffer,
-            DWORD            cbInBuffer,
-            LPVOID           lpvOutBuffer,
-            DWORD            cbOutBuffer,
-            LPDWORD          lpcbBytesReturned,
-            LPWSACOMPLETION  lpCompletion)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSCUpdateProvider(LPGUID lpProviderId,
-                  const WCHAR FAR * lpszProviderDllPath,
-                  const LPWSAPROTOCOL_INFOW lpProtocolInfoList,
-                  DWORD dwNumberOfEntries,
-                  LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-WSCWriteNameSpaceOrder(LPGUID lpProviderId,
-                       DWORD dwNumberOfEntries)
-{
-    UNIMPLEMENTED
-
-    return WSASYSCALLFAILURE;
-}
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-getnameinfo(const struct sockaddr FAR * sa,
-            socklen_t       salen,
-            char FAR *      host,
-            DWORD           hostlen,
-            char FAR *      serv,
-            DWORD           servlen,
-            INT             flags)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(WSASYSCALLFAILURE);
-    return SOCKET_ERROR;
-}
-
-/*
- * @unimplemented
- */
-VOID EXPORT WEP()
-{
-    UNIMPLEMENTED
-}
-
-/*
- * @unimplemented
- */
-BOOL EXPORT WSApSetPostRoutine(PVOID Routine)
-{
-    UNIMPLEMENTED
-
-    return FALSE;
-}
-
-/*
- * @unimplemented
- */
-INT
-EXPORT
-GetAddrInfoW(IN PCWSTR pszNodeName,
-             IN PCWSTR pszServiceName,
-             IN const ADDRINFOW *ptHints,
-             OUT PADDRINFOW *pptResult)
-{
-    UNIMPLEMENTED
-
-    WSASetLastError(EAI_FAIL);
-    return EAI_FAIL;
-}
-
-
-/* EOF */
diff --git a/dll/win32/ws2_32/misc/upcall.c b/dll/win32/ws2_32/misc/upcall.c
deleted file mode 100644 (file)
index 3ba3b41..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS WinSock 2 DLL
- * FILE:        misc/upcall.c
- * PURPOSE:     Upcall functions
- * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
- * REVISIONS:
- *   CSH 01/09-2000 Created
- */
-#include <ws2_32.h>
-#include <catalog.h>
-#include <handle.h>
-
-/*
- * @implemented
- */
-BOOL
-WSPAPI
-WPUCloseEvent(IN  WSAEVENT hEvent,
-              OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-WSPAPI
-WPUCloseSocketHandle(IN  SOCKET s,
-                     OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return 0;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-WSPAPI
-WPUCloseThread(IN  LPWSATHREADID lpThreadId,
-               OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return 0;
-}
-
-
-/*
- * @unimplemented
- */
-WSAEVENT
-WSPAPI
-WPUCreateEvent(OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return (WSAEVENT)0;
-}
-
-
-/*
- * @unimplemented
- */
-SOCKET
-WSPAPI
-WPUCreateSocketHandle(IN  DWORD dwCatalogEntryId,
-                      IN  DWORD dwContext,
-                      OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return (SOCKET)0;
-}
-
-
-/*
- * @unimplemented
- */
-int
-WSPAPI
-WPUFDIsSet(IN  SOCKET s,
-           IN  LPFD_SET set)
-{
-    UNIMPLEMENTED
-
-    return (SOCKET)0;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-WSPAPI
-WPUGetProviderPath(IN      LPGUID lpProviderId,
-                   OUT     LPWSTR lpszProviderDllPath,
-                   IN OUT  LPINT lpProviderDllPathLen,
-                   OUT     LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return 0;
-}
-
-
-/*
- * @implemented
- */
-SOCKET
-WSPAPI
-WPUModifyIFSHandle(IN  DWORD dwCatalogEntryId,
-                   IN  SOCKET ProposedHandle,
-                   OUT LPINT lpErrno)
-{
-    PCATALOG_ENTRY Provider;
-    SOCKET Socket;
-
-    WS_DbgPrint(MID_TRACE, ("dwCatalogEntryId (%d)  ProposedHandle (0x%X).\n",
-    dwCatalogEntryId, ProposedHandle));
-
-    Provider = LocateProviderById(dwCatalogEntryId);
-    if (!Provider)
-    {
-        WS_DbgPrint(MIN_TRACE, ("Provider with catalog entry id (%d) was not found.\n",
-                    dwCatalogEntryId));
-        if( lpErrno ) *lpErrno = WSAEINVAL;
-        WS_DbgPrint(MID_TRACE, ("Returning invalid socket\n"));
-        return INVALID_SOCKET;
-    }
-
-    Socket = (SOCKET)CreateProviderHandle((HANDLE)ProposedHandle,
-                                          Provider);
-
-    if( lpErrno ) *lpErrno = NO_ERROR;
-
-    WS_DbgPrint(MID_TRACE, ("Socket: %x\n", Socket));
-    return Socket;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-WSPAPI
-WPUOpenCurrentThread(OUT LPWSATHREADID lpThreadId,
-                     OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return 0;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-WSPAPI
-WPUQueryBlockingCallback(IN  DWORD dwCatalogEntryId,
-                         OUT LPBLOCKINGCALLBACK FAR* lplpfnCallback,
-                         OUT LPDWORD lpdwContext,
-                         OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return 0;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-WSPAPI
-WPUQuerySocketHandleContext(IN  SOCKET s,
-                            OUT LPDWORD lpContext,
-                            OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return 0;
-}
-
-
-/*
- * @unimplemented
- */
-INT
-WSPAPI
-WPUQueueApc(IN  LPWSATHREADID lpThreadId,
-            IN  LPWSAUSERAPC lpfnUserApc,
-            IN  DWORD dwContext,
-            OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return 0;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-WSPAPI
-WPUResetEvent(IN  WSAEVENT hEvent,
-              OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-WSPAPI
-WPUSetEvent(IN  WSAEVENT hEvent,
-            OUT LPINT lpErrno)
-{
-    UNIMPLEMENTED
-
-    return FALSE;
-}
-
-/* EOF */
diff --git a/dll/win32/ws2_32/tests/setup.c b/dll/win32/ws2_32/tests/setup.c
deleted file mode 100644 (file)
index 9a715f6..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <windows.h>
-#include "regtests.h"
-
-extern BOOL
-WINAPI
-DllMain(HANDLE hInstDll,
-        ULONG dwReason,
-        LPVOID lpReserved);
-
-_SetupOnce()
-{
-  DllMain(NULL, DLL_PROCESS_ATTACH, NULL);
-}
diff --git a/dll/win32/ws2_32/tests/stubs.tst b/dll/win32/ws2_32/tests/stubs.tst
deleted file mode 100644 (file)
index d94069d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-kernel32.dll  CreateEventW@16
-kernel32.dll  InitializeCriticalSection@4
-kernel32.dll  DeleteCriticalSection@4
-kernel32.dll  EnterCriticalSection@4
-kernel32.dll  ExitProcess@4
-kernel32.dll  FreeLibrary@4
-kernel32.dll  GetLastError@0
-kernel32.dll  GetProcAddress@8
-kernel32.dll  GetProcessHeap@0
-ntdll.dll  HeapAlloc@12=RtlAllocateHeap
-ntdll.dll  HeapFree@12=RtlFreeHeap
-kernel32.dll  LeaveCriticalSection@4
-kernel32.dll  LoadLibraryW@4
-kernel32.dll  lstrcpyA@8
-ntdll.dll  ResetEvent@4
-ntdll.dll  SetEvent@4
-kernel32.dll  Sleep@4
-ntdll.dll  WaitForMultipleObjectsEx@20
-kernel32.dll  CloseHandle@4
diff --git a/dll/win32/ws2_32/tests/tests/WinsockEvent.c b/dll/win32/ws2_32/tests/tests/WinsockEvent.c
deleted file mode 100644 (file)
index 63bad75..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#include <windows.h>
-#include <winsock2.h>
-#include "regtests.h"
-
-#define TestHandle (HANDLE) 1
-
-static BOOL CloseHandleSuccessCalled = FALSE;
-
-static BOOL WINAPI
-MockCloseHandleSuccess(HANDLE hObject)
-{
-  CloseHandleSuccessCalled = TRUE;
-  _AssertEqualValue(TestHandle, hObject);
-  return TRUE;
-}
-
-static HOOK HooksSuccess[] =
-{
-  {"CloseHandle", MockCloseHandleSuccess},
-  {NULL, NULL}
-};
-
-static void
-TestWSACloseEventSuccess()
-{
-  BOOL result;
-
-  _SetHooks(HooksSuccess);
-  result = WSACloseEvent(TestHandle);
-  _AssertTrue(result);
-  _AssertEqualValue(NO_ERROR, WSAGetLastError());
-  _AssertTrue(CloseHandleSuccessCalled);
-  _UnsetAllHooks();
-}
-
-
-static BOOL CloseHandleFailureCalled = FALSE;
-
-static BOOL WINAPI
-MockCloseHandleFailure(HANDLE hObject)
-{
-  CloseHandleFailureCalled = TRUE;
-  return FALSE;
-}
-
-static HOOK HooksFailure[] =
-{
-  {"CloseHandle", MockCloseHandleFailure},
-  {NULL, NULL}
-};
-
-static void
-TestWSACloseEventFailure()
-{
-  BOOL result;
-
-  _SetHooks(HooksFailure);
-  result = WSACloseEvent(TestHandle);
-  _AssertFalse(result);
-  _AssertEqualValue(WSA_INVALID_HANDLE, WSAGetLastError());
-  _AssertTrue(CloseHandleFailureCalled);
-  _UnsetAllHooks();
-}
-
-
-static void
-TestWSACloseEvent()
-{
-  TestWSACloseEventSuccess();
-  TestWSACloseEventFailure();
-}
-
-static void
-RunTest()
-{
-  WSADATA WSAData;
-
-  WSAStartup(MAKEWORD(2, 0), &WSAData);
-  TestWSACloseEvent();
-  WSACleanup();
-}
-
-_Dispatcher(WinsockeventTest, "Winsock 2 event")
diff --git a/dll/win32/ws2_32/ws2_32.rbuild b/dll/win32/ws2_32/ws2_32.rbuild
deleted file mode 100644 (file)
index 849ed1c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<module name="ws2_32" type="win32dll" baseaddress="${BASEADDRESS_WS2_32}" installbase="system32" installname="ws2_32.dll" unicode="yes">
-       <importlibrary definition="ws2_32.spec" />
-       <include base="ws2_32">include</include>
-       <include base="ReactOS">include/reactos/wine</include>
-       <define name="LE" />
-       <library>wine</library>
-       <library>ntdll</library>
-       <library>kernel32</library>
-       <library>user32</library>
-       <library>advapi32</library>
-       <library>dnsapi</library>
-       <directory name="include">
-               <pch>ws2_32.h</pch>
-       </directory>
-       <directory name="misc">
-               <file>bsd.c</file>
-               <file>catalog.c</file>
-               <file>dllmain.c</file>
-               <file>event.c</file>
-               <file>handle.c</file>
-               <file>ns.c</file>
-               <file>sndrcv.c</file>
-               <file>stubs.c</file>
-               <file>upcall.c</file>
-               <file>async.c</file>
-       </directory>
-       <file>ws2_32.rc</file>
-</module>
-
diff --git a/dll/win32/ws2_32/ws2_32.rc b/dll/win32/ws2_32/ws2_32.rc
deleted file mode 100644 (file)
index cb16cfa..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* $Id$ */
-
-#define REACTOS_VERSION_DLL
-#define REACTOS_STR_FILE_DESCRIPTION   "Windows Sockets 2 DLL\0"
-#define REACTOS_STR_INTERNAL_NAME      "ws2_32\0"
-#define REACTOS_STR_ORIGINAL_FILENAME  "ws2_32.dll\0"
-#include <reactos/version.rc>
diff --git a/dll/win32/ws2_32/ws2_32.spec b/dll/win32/ws2_32/ws2_32.spec
deleted file mode 100644 (file)
index f36ddca..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-1   stdcall  accept(long ptr ptr)
-2   stdcall  bind(long ptr long)
-3   stdcall  closesocket(long)
-4   stdcall  connect(long ptr long)
-5   stdcall  getpeername(long ptr ptr)
-6   stdcall  getsockname(long ptr ptr)
-7   stdcall  getsockopt(long long long ptr ptr)
-8   stdcall  htonl(long)
-9   stdcall  htons(long)
-10  stdcall  ioctlsocket(long long ptr)
-11  stdcall  inet_addr(str)
-12  stdcall  inet_ntoa(ptr)
-13  stdcall  listen(long long)
-14  stdcall  ntohl(long)
-15  stdcall  ntohs(long)
-16  stdcall  recv(long ptr long long)
-17  stdcall  recvfrom(long ptr long long ptr ptr)
-18  stdcall  select(long ptr ptr ptr ptr)
-19  stdcall  send(long ptr long long)
-20  stdcall  sendto(long ptr long long ptr long)
-21  stdcall  setsockopt(long long long ptr long)
-22  stdcall  shutdown(long long)
-23  stdcall  socket(long long long)
-51  stdcall  gethostbyaddr(ptr long long)
-52  stdcall  gethostbyname(str)
-53  stdcall  getprotobyname(str)
-54  stdcall  getprotobynumber(long)
-55  stdcall  getservbyname(str str)
-56  stdcall  getservbyport(long str)
-57  stdcall  gethostname(ptr long)
-
-101 stdcall WSAAsyncSelect(long long long long)
-102 stdcall WSAAsyncGetHostByAddr(long long ptr long long ptr long)
-103 stdcall WSAAsyncGetHostByName(long long str ptr long)
-104 stdcall WSAAsyncGetProtoByNumber(long long long ptr long)
-105 stdcall WSAAsyncGetProtoByName(long long str ptr long)
-106 stdcall WSAAsyncGetServByPort(long long long str ptr long)
-107 stdcall WSAAsyncGetServByName(long long str str ptr long)
-108 stdcall WSACancelAsyncRequest(long)
-109 stdcall WSASetBlockingHook(ptr)
-110 stdcall WSAUnhookBlockingHook()
-111 stdcall WSAGetLastError()
-112 stdcall WSASetLastError(long)
-113 stdcall WSACancelBlockingCall()
-114 stdcall WSAIsBlocking()
-115 stdcall WSAStartup(long ptr)
-116 stdcall WSACleanup()
-
-151 stdcall  __WSAFDIsSet(long ptr)
-
-500 stub     WEP
-
-@ stdcall GetAddrInfoW(wstr wstr ptr ptr)
-@ stdcall WSApSetPostRoutine(ptr)
-@ stdcall WPUCompleteOverlappedRequest(long ptr long long ptr)
-@ stdcall WSAAccept(long ptr ptr ptr long)
-@ stdcall WSAAddressToStringA(ptr long ptr ptr ptr)
-@ stdcall WSAAddressToStringW(ptr long ptr ptr ptr)
-@ stdcall WSACloseEvent(long)
-@ stdcall WSAConnect(long ptr long ptr ptr ptr ptr)
-@ stdcall WSACreateEvent ()
-@ stdcall WSADuplicateSocketA(long long ptr)
-@ stdcall WSADuplicateSocketW(long long ptr)
-@ stdcall WSAEnumNameSpaceProvidersA(ptr ptr)
-@ stdcall WSAEnumNameSpaceProvidersW(ptr ptr)
-@ stdcall WSAEnumNetworkEvents(long long ptr)
-@ stdcall WSAEnumProtocolsA(ptr ptr ptr)
-@ stdcall WSAEnumProtocolsW(ptr ptr ptr)
-@ stdcall WSAEventSelect(long long long)
-@ stdcall WSAGetOverlappedResult(long ptr ptr long ptr)
-@ stdcall WSAGetQOSByName(long ptr ptr)
-@ stdcall WSAGetServiceClassInfoA(ptr ptr ptr ptr)
-@ stdcall WSAGetServiceClassInfoW(ptr ptr ptr ptr)
-@ stdcall WSAGetServiceClassNameByClassIdA(ptr ptr ptr)
-@ stdcall WSAGetServiceClassNameByClassIdW(ptr ptr ptr)
-@ stdcall WSAHtonl(long long ptr)
-@ stdcall WSAHtons(long long ptr)
-@ stdcall WSAInstallServiceClassA(ptr)
-@ stdcall WSAInstallServiceClassW(ptr)
-@ stdcall WSAIoctl(long long ptr long ptr long ptr ptr ptr)
-@ stdcall WSAJoinLeaf(long ptr long ptr ptr ptr ptr long)
-@ stdcall WSALookupServiceBeginA(ptr long ptr)
-@ stdcall WSALookupServiceBeginW(ptr long ptr)
-@ stdcall WSALookupServiceEnd(long)
-@ stdcall WSALookupServiceNextA(long long ptr ptr)
-@ stdcall WSALookupServiceNextW(long long ptr ptr)
-@ stub    WSANSPIoctl
-@ stdcall WSANtohl(long long ptr)
-@ stdcall WSANtohs(long long ptr)
-@ stdcall WSAProviderConfigChange(ptr ptr ptr)
-@ stdcall WSARecv(long ptr long ptr ptr ptr ptr)
-@ stdcall WSARecvDisconnect(long ptr)
-@ stdcall WSARecvFrom(long ptr long ptr ptr ptr ptr ptr ptr ) 
-@ stdcall WSARemoveServiceClass(ptr)
-@ stdcall WSAResetEvent(long) kernel32.ResetEvent
-@ stdcall WSASend(long ptr long ptr long ptr ptr)
-@ stdcall WSASendDisconnect(long ptr)
-@ stdcall WSASendTo(long ptr long ptr long ptr long ptr ptr)
-@ stdcall WSASetEvent(long) kernel32.SetEvent
-@ stdcall WSASetServiceA(ptr long long)
-@ stdcall WSASetServiceW(ptr long long)
-@ stdcall WSASocketA(long long long ptr long long)
-@ stdcall WSASocketW(long long long ptr long long)
-@ stdcall WSAStringToAddressA(str long ptr ptr ptr)
-@ stdcall WSAStringToAddressW(wstr long ptr ptr ptr)
-@ stdcall WSAWaitForMultipleEvents(long ptr long long long) kernel32.WaitForMultipleObjectsEx
-@ stdcall WSCDeinstallProvider(ptr ptr)
-@ stdcall WSCEnableNSProvider(ptr long)
-@ stdcall WSCEnumProtocols(ptr ptr ptr ptr)
-@ stdcall WSCGetProviderPath(ptr ptr ptr ptr)
-@ stdcall WSCInstallNameSpace(wstr wstr long long ptr)
-@ stdcall WSCInstallProvider(ptr wstr ptr long ptr)
-@ stdcall WSCUnInstallNameSpace(ptr)
-@ stub    WSCUpdateProvider
-@ stub    WSCWriteNameSpaceOrder
-@ stdcall WSCWriteProviderOrder(ptr long)
-@ stdcall freeaddrinfo(ptr)
-@ stdcall getaddrinfo(str str ptr ptr)
-@ stdcall getnameinfo(ptr long ptr long ptr long long)