Index: /trunk/src/VBox/Runtime/r3/socket.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/socket.cpp	(revision 27503)
+++ /trunk/src/VBox/Runtime/r3/socket.cpp	(revision 27504)
@@ -34,5 +34,6 @@
 *******************************************************************************/
 #ifdef RT_OS_WINDOWS
-# include <winsock.h>
+//# include <winsock.h>
+# include <winsock2.h>
 #else /* !RT_OS_WINDOWS */
 # include <errno.h>
@@ -74,4 +75,6 @@
 # define MSG_NOSIGNAL           0
 #endif
+
+/* Windows has different names for SHUT_XXX. */
 #ifndef SHUT_RDWR
 # ifdef SD_BOTH
@@ -88,4 +91,11 @@
 # endif
 #endif
+#ifndef SHUT_RD
+# ifdef SD_RECEIVE
+#  define SHUT_RD               SD_RECEIVE
+# else
+#  define SHUT_RD               0
+# endif
+#endif
 
 /* fixup backlevel OSes. */
@@ -117,5 +127,5 @@
     SOCKET              hNative;
     /** The event semaphore we've associated with the socket handle.
-     * This is INVALID_HANDLE_VALUE if not done. */
+     * This is WSA_INVALID_EVENT if not done. */
     WSAEVENT            hEvent;
     /** The pollset currently polling this socket.  This is NIL if no one is
@@ -252,6 +262,6 @@
     pThis->hNative      = hNative;
 #ifdef RT_OS_WINDOWS
-    pThis->hEvent       = INVALID_HANDLE_VALUE;
-    pThis->hPollSet     = 0;
+    pThis->hEvent       = WSA_INVALID_EVENT;
+    pThis->hPollSet     = NIL_RTPOLLSET;
     pThis->fPollEvts    = 0;
 #endif
@@ -318,11 +328,11 @@
     int rc = VINF_SUCCESS;
 #ifdef RT_OS_WINDOWS
-    if (pThis->hEvent == INVALID_HANDLE_VALUE)
-    {
-        CloseHandle(pThis->hEvent);
-        pThis->hEvent = INVALID_HANDLE_VALUE;
-    }
-
-    if (pThis->hNative != INVALID_HANDLE_VALUE)
+    if (pThis->hEvent == WSA_INVALID_EVENT)
+    {
+        WSACloseEvent(pThis->hEvent);
+        pThis->hEvent = WSA_INVALID_EVENT;
+    }
+
+    if (pThis->hNative != INVALID_SOCKET)
     {
         rc = closesocket(pThis->hNative);
@@ -334,5 +344,5 @@
             AssertMsgFailed(("\"%s\": closesocket(%p) -> %Rrc\n", pThis->hNative, rc));
         }
-        pThis->hNative = INVALID_HANDLE_VALUE;
+        pThis->hNative = INVALID_SOCKET;
     }
 
@@ -371,5 +381,5 @@
     int rc = VINF_SUCCESS;
 #ifdef RT_OS_WINDOWS
-    if (!SetHandleInformation(pThis->hNative, HANDLE_FLAG_INHERIT, fInheritable ? HANDLE_FLAG_INHERIT : 0))
+    if (!SetHandleInformation((HANDLE)pThis->hNative, HANDLE_FLAG_INHERIT, fInheritable ? HANDLE_FLAG_INHERIT : 0))
         rc = RTErrConvertFromWin32(GetLastError());
 #else
Index: /trunk/src/VBox/Runtime/r3/tcp.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/tcp.cpp	(revision 27503)
+++ /trunk/src/VBox/Runtime/r3/tcp.cpp	(revision 27504)
@@ -34,5 +34,5 @@
 *******************************************************************************/
 #ifdef RT_OS_WINDOWS
-# include <winsock.h>
+# include <winsock2.h>
 #else /* !RT_OS_WINDOWS */
 # include <errno.h>
@@ -103,48 +103,4 @@
 *   Structures and Typedefs                                                    *
 *******************************************************************************/
-/**
- * Socket handle data.
- *
- * This is mainly required for implementing RTPollSet on Windows.
- */
-typedef struct RTSOCKETINT
-{
-    /** Magic number (RTTCPSOCKET_MAGIC). */
-    uint32_t            u32Magic;
-    /** Usage count.  This is used to prevent two threads from accessing the
-     *  handle concurrently. */
-    uint32_t volatile   cUsers;
-#ifdef RT_OS_WINDOWS
-    /** The native socket handle. */
-    SOCKET              hNative;
-    /** The event semaphore we've associated with the socket handle.
-     * This is INVALID_HANDLE_VALUE if not done. */
-    WSAEVENT            hEvent;
-    /** The pollset currently polling this socket.  This is NIL if no one is
-     * polling. */
-    RTPOLLSET           hPollSet;
-    /** The events we're polling for. */
-    uint32_t            fPollEvts;
-#else
-    /** The native socket handle. */
-    int                 hNative;
-#endif
-} RTSOCKETINT;
-
-
-/**
- * Address union used internally for things like getpeername and getsockname.
- */
-typedef union RTSOCKADDRUNION
-{
-    struct sockaddr     Addr;
-    struct sockaddr_in  Ipv4;
-#ifdef IPRT_WITH_TCPIP_V6
-    struct sockaddr_in6 Ipv6;
-#endif
-} RTSOCKADDRUNION;
-
-
-
 /**
  * TCP Server state.
