Index: /trunk/include/VBox/VBoxNetSend.h
===================================================================
--- /trunk/include/VBox/VBoxNetSend.h	(revision 50378)
+++ /trunk/include/VBox/VBoxNetSend.h	(revision 50379)
@@ -25,30 +25,32 @@
  */
 
-#ifndef __VBoxNetSend_h__
-#define __VBoxNetSend_h__
+/** @todo move this to src/VBox/HostDrivers/darwin as a .cpp file. */
+#ifndef ___VBox_VBoxNetSend_h
+#define ___VBox_VBoxNetSend_h
 
 #if defined(RT_OS_DARWIN)
 
-#include <iprt/err.h>
-#include <iprt/assert.h>
-#include <iprt/string.h>
+# include <iprt/err.h>
+# include <iprt/assert.h>
+# include <iprt/string.h>
 
-#include <sys/socket.h>
-#include <net/kpi_interface.h>
+# include <sys/socket.h>
+# include <net/kpi_interface.h>
 RT_C_DECLS_BEGIN /* Buggy 10.4 headers, fixed in 10.5. */
-#include <sys/kpi_mbuf.h>
+# include <sys/kpi_mbuf.h>
 RT_C_DECLS_END
-#include <net/if.h>
+# include <net/if.h>
 
 RT_C_DECLS_BEGIN
 
-#if defined(IN_RING0)
+# if defined(IN_RING0)
 
 /**
- * Constructs and submits a dummy packet to ifnet_input(). This is a workaround
- * for "stuck dock icon" issue. When the first packet goes through the interface
- * DLIL grabs a reference to the thread that submits the packet and holds it
- * until the interface is destroyed. By submitting this dummy we make DLIL grab
- * the thread of a non-GUI process.
+ * Constructs and submits a dummy packet to ifnet_input().
+ *
+ * This is a workaround for "stuck dock icon" issue. When the first packet goes
+ * through the interface DLIL grabs a reference to the thread that submits the
+ * packet and holds it until the interface is destroyed. By submitting this
+ * dummy we make DLIL grab the thread of a non-GUI process.
  *
  * Most of this function was copied from vboxNetFltDarwinMBufFromSG().
@@ -58,11 +60,11 @@
  *                      thread. We submit dummy as if it was coming from this interface.
  */
-inline int VBoxNetSendDummy(ifnet_t pIfNet)
+DECLINLINE(int) VBoxNetSendDummy(ifnet_t pIfNet)
 {
-    int rc = 0;
-    size_t cbTotal = 50; /* No Ethernet header */
-    mbuf_how_t How = MBUF_WAITOK;
+    int rc = VINF_SUCCESS;
 
-    mbuf_t pPkt = NULL;
+    size_t      cbTotal = 50; /* No Ethernet header */
+    mbuf_how_t  How     = MBUF_WAITOK;
+    mbuf_t      pPkt    = NULL;
     errno_t err = mbuf_allocpacket(How, cbTotal, NULL, &pPkt);
     if (!err)
@@ -96,5 +98,5 @@
 }
 
-#endif /* IN_RING0 */
+# endif /* IN_RING0 */
 
 RT_C_DECLS_END
@@ -102,3 +104,4 @@
 #endif /* RT_OS_DARWIN */
 
-#endif /* __VBoxNetSend_h__ */
+#endif /* !___VBox_VBoxNetSend_h */
+
Index: /trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp	(revision 50378)
+++ /trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp	(revision 50379)
@@ -885,6 +885,6 @@
 
 
-/** A worker for vboxNetFltSendDummy() thread. */
-static int vboxNetFltSendDummyWorker(RTTHREAD ThreadSelf, void *pvUser)
+/** A worker thread for vboxNetFltSendDummy(). */
+static DECLCALLBACK(int) vboxNetFltSendDummyWorker(RTTHREAD hThreadSelf, void *pvUser)
 {
     Assert(pvUser);
@@ -893,13 +893,13 @@
 }
 
-/*
+
+/**
  * Prevent GUI icon freeze issue when VirtualBoxVM process terminates.
  *
- * This function is a workaround for stuck-in-dock issue. The
- * idea here is to send a dummy packet to an interface from the
- * context of a kernel thread. Therefore, an XNU's receive
- * thread (which is created as a result if we are the first who
- * is communicating with the interface) will be associated with the
- * kernel thread instead of VirtualBoxVM process.
+ * This function is a workaround for stuck-in-dock issue.  The idea here is to
+ * send a dummy packet to an interface from the context of a kernel thread.
+ * Therefore, an XNU's receive thread (which is created as a result if we are
+ * the first who is communicating with the interface) will be associated with
+ * the kernel thread instead of VirtualBoxVM process.
  *
  * @param pIfNet    Interface to be used to send data.
@@ -907,13 +907,10 @@
 static void vboxNetFltSendDummy(ifnet_t pIfNet)
 {
-    RTTHREAD dummyThread;
-    int rc;
-
-    rc = RTThreadCreate(&dummyThread, vboxNetFltSendDummyWorker, (void *)pIfNet, 0,
-        RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "DummyThread");
-
+    RTTHREAD hThread;
+    int rc = RTThreadCreate(&hThread, vboxNetFltSendDummyWorker, (void *)pIfNet, 0,
+                            RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "DummyThread");
     if (RT_SUCCESS(rc))
     {
-        RTThreadWait(dummyThread, RT_INDEFINITE_WAIT, NULL);
+        RTThreadWait(hThread, RT_INDEFINITE_WAIT, NULL);
         LogFlow(("vboxNetFltSendDummy: a dummy packet has been successfully sent in order to prevent stuck-in-dock issue\n"));
     }
@@ -921,4 +918,5 @@
         LogFlow(("vboxNetFltSendDummy: unable to send dummy packet in order to prevent stuck-in-dock issue\n"));
 }
+
 
 /**
@@ -957,5 +955,5 @@
     RTSpinlockReleaseNoInts(pThis->hSpinlock);
 
-    /* Prevent stuck-in-dock issue by associating interface receive thread with kernel thread */
+    /* Prevent stuck-in-dock issue by associating interface receive thread with kernel thread. */
     vboxNetFltSendDummy(pIfNet);
 
