Index: trunk/src/VBox/Devices/Network/DrvNATlibslirp.cpp
===================================================================
--- trunk/src/VBox/Devices/Network/DrvNATlibslirp.cpp	(revision 108820)
+++ trunk/src/VBox/Devices/Network/DrvNATlibslirp.cpp	(revision 109079)
@@ -271,5 +271,5 @@
 static int  drvNATTimersAdjustTimeoutDown(PDRVNAT pThis, int cMsTimeout);
 static void drvNATTimersRunExpired(PDRVNAT pThis);
-static DECLCALLBACK(int) drvNAT_AddPollCb(int iFd, int iEvents, void *opaque);
+static DECLCALLBACK(int) drvNAT_AddPollCb(slirp_os_socket hFd, int iEvents, void *opaque);
 static DECLCALLBACK(int64_t) drvNAT_ClockGetNsCb(void *opaque);
 static DECLCALLBACK(int) drvNAT_GetREventsCb(int idx, void *opaque);
@@ -771,6 +771,6 @@
         pThis->pNATState->nsock = 1;
 
-        int cMsTimeout = DRVNAT_DEFAULT_TIMEOUT;
-        slirp_pollfds_fill(pThis->pNATState->pSlirp, &cMsTimeout, drvNAT_AddPollCb /* SlirpAddPollCb */, pThis /* opaque */);
+        uint32_t cMsTimeout = DRVNAT_DEFAULT_TIMEOUT;
+        slirp_pollfds_fill_socket(pThis->pNATState->pSlirp, &cMsTimeout, drvNAT_AddPollCb /* SlirpAddPollCb */, pThis /* opaque */);
         cMsTimeout = drvNATTimersAdjustTimeoutDown(pThis, cMsTimeout);
 
@@ -1384,8 +1384,12 @@
  * Registers poll. Unused function (other than logging).
  */
-static DECLCALLBACK(void) drvNAT_RegisterPoll(int fd, void *opaque)
-{
-    RT_NOREF(fd, opaque);
-    Log4(("Poll registered: fd=%d\n", fd));
+static DECLCALLBACK(void) drvNAT_RegisterPoll(slirp_os_socket socket, void *opaque)
+{
+    RT_NOREF(socket, opaque);
+#ifdef RT_OS_WINDOWS
+    Log4(("Poll registered: fd=%p\n", socket));
+#else
+    Log4(("Poll registered: fd=%d\n", socket));
+#endif
 }
 
@@ -1393,8 +1397,12 @@
  * Unregisters poll. Unused function (other than logging).
  */
-static DECLCALLBACK(void) drvNAT_UnregisterPoll(int fd, void *opaque)
-{
-    RT_NOREF(fd, opaque);
-    Log4(("Poll unregistered: fd=%d\n", fd));
+static DECLCALLBACK(void) drvNAT_UnregisterPoll(slirp_os_socket socket, void *opaque)
+{
+    RT_NOREF(socket, opaque);
+#ifdef RT_OS_WINDOWS
+    Log4(("Poll unregistered: fd=%p\n", socket));
+#else
+    Log4(("Poll unregistered: fd=%d\n", socket));
+#endif
 }
 
@@ -1411,5 +1419,5 @@
  * @thread  ?
  */
-static DECLCALLBACK(int) drvNAT_AddPollCb(int iFd, int iEvents, void *opaque)
+static DECLCALLBACK(int) drvNAT_AddPollCb(slirp_os_socket hFd, int iEvents, void *opaque)
 {
     PDRVNAT pThis = (PDRVNAT)opaque;
@@ -1430,9 +1438,5 @@
     unsigned int uIdx = pThis->pNATState->nsock;
     Assert(uIdx < INT_MAX);
-#ifdef RT_OS_WINDOWS
-    pThis->pNATState->polls[uIdx].fd = libslirp_wrap_RTHandleTableLookup(iFd);
-#else
-    pThis->pNATState->polls[uIdx].fd = iFd;
-#endif
+    pThis->pNATState->polls[uIdx].fd = hFd;
     pThis->pNATState->polls[uIdx].events = drvNAT_PollEventSlirpToHost(iEvents);
     pThis->pNATState->polls[uIdx].revents = 0;
@@ -1686,5 +1690,5 @@
     static SlirpCb slirpCallbacks = { 0 };
 
-    slirpCfg.version = 4;
+    slirpCfg.version = 6;
     slirpCfg.restricted = false;
     slirpCfg.in_enabled = true;
@@ -1731,9 +1735,9 @@
     slirpCallbacks.timer_free = drvNAT_TimerFreeCb;
     slirpCallbacks.timer_mod = drvNAT_TimerModCb;
-    slirpCallbacks.register_poll_fd = drvNAT_RegisterPoll;
-    slirpCallbacks.unregister_poll_fd = drvNAT_UnregisterPoll;
     slirpCallbacks.notify = drvNAT_NotifyCb;
     slirpCallbacks.init_completed = NULL;
     slirpCallbacks.timer_new_opaque = NULL;
+    slirpCallbacks.register_poll_socket = drvNAT_RegisterPoll;
+    slirpCallbacks.unregister_poll_socket = drvNAT_UnregisterPoll;
 
     /*
@@ -1788,23 +1792,4 @@
     rc = RTWinSocketPair(AF_INET, SOCK_DGRAM, 0, pThis->ahWakeupSockPair);
     AssertRCReturn(rc, rc);
-
-    uint32_t hReadFd = 0;
-    uint32_t hWriteFd = 0;
-
-    rc = libslirp_wrap_RTHandleTableAlloc(pThis->ahWakeupSockPair[0], &hReadFd);
-    AssertRCReturn(rc, rc);
-
-    rc = libslirp_wrap_RTHandleTableAlloc(pThis->ahWakeupSockPair[1], &hWriteFd);
-    AssertRCReturn(rc, rc);
-
-    Log4Func(("Created wakeup socket pair.\nSocket details - read:%d, write%d\n \
-               Handle details - read:%d, write%d\n", pThis->ahWakeupSockPair[0],
-               pThis->ahWakeupSockPair[1], hReadFd, hWriteFd));
-
-    /**
-     * @todo r=jack: should probably use the internal handles up in the io
-     * thread. Will fix (or just update libslirp and this translation stuff
-     * might go away).
-     */
 #else
     /* Create the control pipe. */
