Index: /trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk	(revision 23926)
+++ /trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk	(revision 23927)
@@ -51,4 +51,7 @@
  VBoxNetFlt_SOURCES.win += win/VBoxNetFltMp-win.c
 endif
+#ifdef VBOX_LOOPBACK_USEFLAGS
+ VBoxNetFlt_DEFS.win += VBOX_LOOPBACK_USEFLAGS
+#endif
 VBoxNetFlt_SOURCES = VBoxNetFlt.c
 VBoxNetFlt_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
Index: /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c	(revision 23926)
+++ /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c	(revision 23927)
@@ -118,6 +118,8 @@
 INIT_IDC_INFO g_InitIdcInfo;
 
+#ifdef VBOX_LOOPBACK_USEFLAGS
 UINT g_fPacketDontLoopBack;
 UINT g_fPacketIsLoopedBack;
+#endif
 
 #define LIST_ENTRY_2_JOB(pListEntry) \
@@ -522,32 +524,15 @@
         if(bSrcHost)
         {
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//            SET_PACKET_TO_INFO(pInfo, pMyPacket);
-//            /* we are not using flags here, so they are not valid here */
-//            /* SET_FLAGS_TO_INFO(pInfo, 0); */
-//            LogFlow(("sending packet (%p)\n", pMyPacket));
-//            vboxNetFltWinDoSendViaInfo(&fStatus, pAdapt, pInfo);
-//            LogFlow(("done sending packet (%p), status (%d)\n", pMyPacket, fStatus));
-#else
+#if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS)
+            vboxNetFltWinLbPutSendPacket(pAdapt, pMyPacket, false /* bFromIntNet */);
+#endif
             NdisSend(&fStatus, pAdapt->hBindingHandle, pMyPacket);
-#endif
 
             if (fStatus != NDIS_STATUS_PENDING)
             {
+#if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS)
                 /* the status is NOT pending, complete the packet */
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//                vboxNetFltWinDoCompleteSendViaInfo(pAdapt, pInfo);
+                bool bTmp = vboxNetFltWinLbRemoveSendPacket(pAdapt, pMyPacket);
+                Assert(bTmp);
 #endif
                 if(pPacket)
@@ -572,23 +557,5 @@
         else
         {
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//            SET_PACKET_TO_INFO(pInfo, pMyPacket);
-//            /* we are not using flags here, so they are not valid here */
-//            /* SET_FLAGS_TO_INFO(pInfo, 0); */
-//
-//            LogFlow(("indicating receive packet (%p)\n", pMyPacket));
-//            vboxNetFltWinDoIndicateReceiveViaInfo(pAdapt, pInfo);
-//            /* the packet return will be processed in the vboxNetFltWinMpReturnPacket call-back unless
-//             * we specify NDIS_STATUS_RESOURCES as the packet status, which we are NOT doing currently */
-//            LogFlow(("done indicating receive packet (%p)\n", pMyPacket));
-#else
             NdisMIndicateReceivePacket(pAdapt->hMiniportHandle, &pMyPacket, 1);
-#endif
 
             fStatus = NDIS_STATUS_PENDING;
@@ -1798,7 +1765,10 @@
                     pSendRsvd->pOriginalPkt = NULL;
                     pSendRsvd->pBufToFree = pBufToFree;
-
+#ifdef VBOX_LOOPBACK_USEFLAGS
                     /* set "don't loopback" flags */
                     NdisSetPacketFlags(pPacket, g_fPacketDontLoopBack);
+#else
+                    NdisSetPacketFlags(pPacket, 0);
+#endif
                 }
 #ifndef VBOX_NETFLT_ONDEMAND_BIND
@@ -1991,6 +1961,8 @@
     do
     {
+#ifdef VBOX_LOOPBACK_USEFLAGS
         ULONG MjVersion;
         ULONG MnVersion;
+#endif
 
 #ifdef VBOX_NETFLT_ONDEMAND_BIND
@@ -2008,5 +1980,5 @@
             break;
         }
-
+#ifdef VBOX_LOOPBACK_USEFLAGS
         PsGetVersion(&MjVersion, &MnVersion,
           NULL, /* PULONG  BuildNumber  OPTIONAL */
@@ -2023,4 +1995,5 @@
 
         g_fPacketIsLoopedBack = NDIS_FLAGS_IS_LOOPBACK_PACKET;
+#endif
 
 #ifndef VBOX_NETFLT_ONDEMAND_BIND
@@ -2100,8 +2073,7 @@
         vboxNetFltWinCopyPacketInfoOnSend(*ppMyPacket, pPacket);
 
-//        if(bNetFltActive)
-//        {
-            NdisGetPacketFlags(*ppMyPacket) |= g_fPacketDontLoopBack;
-//        }
+#ifdef VBOX_LOOPBACK_USEFLAGS
+        NdisGetPacketFlags(*ppMyPacket) |= g_fPacketDontLoopBack;
+#endif
     }
     else
@@ -2330,9 +2302,8 @@
 
     FINI_INTERLOCKED_SINGLE_LIST(&pAdapt->TransferDataList);
-#endif
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "add list cleaning code here"
-#endif
-
+# if defined(DEBUG_NETFLT_LOOPBACK) || !defined(VBOX_LOOPBACK_USEFLAGS)
+    FINI_INTERLOCKED_SINGLE_LIST(&pAdapt->SendPacketQueue);
+# endif
+#endif
 
 #ifndef VBOX_NETFLT_ONDEMAND_BIND
@@ -2458,12 +2429,12 @@
 
         INIT_INTERLOCKED_SINGLE_LIST(&pAdapt->TransferDataList);
+
+# if defined(DEBUG_NETFLT_LOOPBACK) || !defined(VBOX_LOOPBACK_USEFLAGS)
+        INIT_INTERLOCKED_SINGLE_LIST(&pAdapt->SendPacketQueue);
+# endif
 #endif
         /* TODO: do we need it here ?? */
         pAdapt->MPState.PowerState = NdisDeviceStateD3;
         vboxNetFltWinSetOpState(&pAdapt->MPState, kVBoxNetDevOpState_Deinitialized);
-
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "add list initialization code here"
-#endif
 
 #ifdef VBOX_NETFLT_ONDEMAND_BIND
@@ -2506,6 +2477,86 @@
 #define MIN(_a, _b) ((_a) < (_b) ? (_a) : (_b))
 
-#ifdef DEBUG_NETFLT_PACKETS
-
+#ifndef VBOXNETADP
+
+#ifdef DEBUG_misha
+
+RTMAC g_vboxNetFltWinVerifyMACBroadcast = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+RTMAC g_vboxNetFltWinVerifyMACGuest = {0x08, 0x00, 0x27, 0x01, 0x02, 0x03};
+
+DECLHIDDEN(PRTNETETHERHDR) vboxNetFltWinGetEthHdr(PNDIS_PACKET pPacket)
+{
+    UINT cBufCount1;
+    PNDIS_BUFFER pBuffer1;
+    UINT uTotalPacketLength1;
+    RTNETETHERHDR* pEth;
+    UINT cbLength1 = 0;
+    UINT i = 0;
+
+    NdisQueryPacket(pPacket, NULL, &cBufCount1, &pBuffer1, &uTotalPacketLength1);
+
+    Assert(pBuffer1);
+    Assert(uTotalPacketLength1 >= ETH_HEADER_SIZE);
+    if(uTotalPacketLength1 < ETH_HEADER_SIZE)
+        return NULL;
+
+    NdisQueryBufferSafe(pBuffer1, &pEth, &cbLength1, NormalPagePriority);
+    Assert(cbLength1 >= ETH_HEADER_SIZE);
+    if(cbLength1 < ETH_HEADER_SIZE)
+        return NULL;
+
+    return pEth;
+}
+
+DECLHIDDEN(PRTNETETHERHDR) vboxNetFltWinGetEthHdrSG(PINTNETSG pSG)
+{
+    Assert(pSG->cSegsUsed);
+    Assert(pSG->cSegsAlloc >= pSG->cSegsUsed);
+    Assert(pSG->aSegs[0].cb >= ETH_HEADER_SIZE);
+
+    if(!pSG->cSegsUsed)
+        return NULL;
+
+    if(pSG->aSegs[0].cb < ETH_HEADER_SIZE)
+        return NULL;
+
+    return (PRTNETETHERHDR)pSG->aSegs[0].pv;
+}
+
+DECLHIDDEN(bool) vboxNetFltWinCheckMACs(PNDIS_PACKET pPacket, PRTMAC pDst, PRTMAC pSrc)
+{
+    PRTNETETHERHDR pHdr = vboxNetFltWinGetEthHdr(pPacket);
+    Assert(pHdr);
+
+    if(!pHdr)
+        return false;
+
+    if(pDst && memcmp(pDst, &pHdr->DstMac, sizeof(RTMAC)))
+        return false;
+
+    if(pSrc && memcmp(pSrc, &pHdr->SrcMac, sizeof(RTMAC)))
+        return false;
+
+    return true;
+}
+
+DECLHIDDEN(bool) vboxNetFltWinCheckMACsSG(PINTNETSG pSG, PRTMAC pDst, PRTMAC pSrc)
+{
+    PRTNETETHERHDR pHdr = vboxNetFltWinGetEthHdrSG(pSG);
+    Assert(pHdr);
+
+    if(!pHdr)
+        return false;
+
+    if(pDst && memcmp(pDst, &pHdr->DstMac, sizeof(RTMAC)))
+        return false;
+
+    if(pSrc && memcmp(pSrc, &pHdr->SrcMac, sizeof(RTMAC)))
+        return false;
+
+    return true;
+}
+#endif
+
+# if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS)
 /*
  * answers whether the two given packets match based on the packet length and the first cbMatch bytes of the packets
@@ -2517,5 +2568,5 @@
     PNDIS_BUFFER pBuffer1;
     UINT uTotalPacketLength1;
-    PVOID pMemBuf1;
+    uint8_t* pMemBuf1;
     UINT cbLength1 = 0;
 
@@ -2523,5 +2574,5 @@
     PNDIS_BUFFER pBuffer2;
     UINT uTotalPacketLength2;
-    PVOID pMemBuf2;
+    uint8_t* pMemBuf2;
     UINT cbLength2 = 0;
     bool bMatch = true;
@@ -2543,4 +2594,5 @@
     else
     {
+        UINT ucbLength2Match = 0;
         UINT ucbMatch;
         if(cbMatch < 0 || (UINT)cbMatch > uTotalPacketLength1)
@@ -2557,7 +2609,6 @@
         }
 
-        do
-        {
-            UINT ucbLength2Match;
+        for(;;)
+        {
             if(!cbLength1)
             {
@@ -2565,4 +2616,10 @@
                 NdisGetNextBuffer(pBuffer1, &pBuffer1);
             }
+            else
+            {
+                Assert(pMemBuf1);
+                Assert(ucbLength2Match);
+                pMemBuf1 += ucbLength2Match;
+            }
 
             if(!cbLength2)
@@ -2571,17 +2628,27 @@
                 NdisGetNextBuffer(pBuffer2, &pBuffer2);
             }
+            else
+            {
+                Assert(pMemBuf2);
+                Assert(ucbLength2Match);
+                pMemBuf2 += ucbLength2Match;
+            }
 
             ucbLength2Match = MIN(ucbMatch, cbLength1);
             ucbLength2Match = MIN(ucbMatch, cbLength2);
 
-            if(memcmp(pMemBuf1, pMemBuf2, ucbLength2Match))
+            if(memcmp((PVOID*)pMemBuf1, (PVOID*)pMemBuf2, ucbLength2Match))
             {
                 bMatch = false;
                 break;
             }
+
             ucbMatch -= ucbLength2Match;
+            if(!ucbMatch)
+                break;
+
             cbLength1 -= ucbLength2Match;
             cbLength2 -= ucbLength2Match;
-        } while (ucbMatch);
+        }
     }
 
@@ -2606,8 +2673,8 @@
     PNDIS_BUFFER pBuffer1;
     UINT uTotalPacketLength1;
-    PVOID pMemBuf1;
+    uint8_t* pMemBuf1;
     UINT cbLength1 = 0;
     UINT uTotalPacketLength2 = pSG->cbTotal;
-    PVOID pMemBuf2;
+    uint8_t* pMemBuf2;
     UINT cbLength2 = 0;
     bool bMatch = true;
@@ -2628,5 +2695,7 @@
     else
     {
+        UINT ucbLength2Match = 0;
         UINT ucbMatch;
+
         if(cbMatch < 0 || (UINT)cbMatch > uTotalPacketLength1)
         {
@@ -2640,7 +2709,6 @@
         }
 
-        do
-        {
-            UINT ucbLength2Match;
+        for(;;)
+        {
             if(!cbLength1)
             {
@@ -2648,17 +2716,29 @@
                 NdisGetNextBuffer(pBuffer1, &pBuffer1);
             }
+            else
+            {
+                Assert(pMemBuf1);
+                Assert(ucbLength2Match);
+                pMemBuf1 += ucbLength2Match;
+            }
 
             if(!cbLength2)
             {
                 Assert(i < pSG->cSegsUsed);
-                pMemBuf2 = pSG->aSegs[i].pv;
+                pMemBuf2 = (uint8_t*)pSG->aSegs[i].pv;
                 cbLength2 = pSG->aSegs[i].cb;
                 i++;
             }
+            else
+            {
+                Assert(pMemBuf2);
+                Assert(ucbLength2Match);
+                pMemBuf2 += ucbLength2Match;
+            }
 
             ucbLength2Match = MIN(ucbMatch, cbLength1);
             ucbLength2Match = MIN(ucbMatch, cbLength2);
 
-            if(memcmp(pMemBuf1, pMemBuf2, ucbLength2Match))
+            if(memcmp((PVOID*)pMemBuf1, (PVOID*)pMemBuf2, ucbLength2Match))
             {
                 bMatch = false;
@@ -2666,8 +2746,12 @@
                 break;
             }
+
             ucbMatch -= ucbLength2Match;
+            if(!ucbMatch)
+                break;
+
             cbLength1 -= ucbLength2Match;
             cbLength2 -= ucbLength2Match;
-        } while (ucbMatch);
+        }
     }
 
@@ -2680,4 +2764,5 @@
 }
 
+#  if 0
 /*
  * answers whether the two PINTNETSGs match based on the packet length and the first cbMatch bytes of the PINTNETSG
@@ -2763,4 +2848,6 @@
     return bMatch;
 }
+#  endif
+# endif
 #endif
 
@@ -3339,17 +3426,16 @@
         {
             NDIS_STATUS fStatus;
-# ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//            PPACKET_INFO pInfo = vboxNetFltWinDoSend(&fStatus, pAdapt, pPacket);
-# else
+
+#if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS)
+            vboxNetFltWinLbPutSendPacket(pAdapt, pPacket, true /* bFromIntNet */);
+#endif
             NdisSend(&fStatus, pAdapt->hBindingHandle, pPacket);
-# endif
             if (fStatus != NDIS_STATUS_PENDING)
             {
+#if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS)
+                /* the status is NOT pending, complete the packet */
+                bool bTmp = vboxNetFltWinLbRemoveSendPacket(pAdapt, pPacket);
+                Assert(bTmp);
+#endif
                 if(!NT_SUCCESS(fStatus))
                 {
@@ -3357,24 +3443,5 @@
                     rc = VERR_GENERAL_FAILURE;
                 }
-# ifdef DEBUG_NETFLT_LOOPBACK
-#  error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//                if(pInfo)
-//                {
-//                    /* TODO: FIXME: remove this assert */
-//                    Assert(fStatus == NDIS_STATUS_SUCCESS);
-//
-//                    vboxNetFltWinDoCompleteSendViaInfo(pAdapt, pInfo);
-//                    vboxNetFltWinPpFreePacketInfo(pInfo);
-//                }
-//                else
-//                {
-//                    Assert(0);
-//                }
-# endif
+
                 vboxNetFltWinFreeSGNdisPacket(pPacket, true);
             }
@@ -3403,25 +3470,6 @@
         if (pPacket)
         {
-# ifndef DEBUG_NETFLT_LOOPBACK
             NdisMIndicateReceivePacket(pAdapt->hMiniportHandle, &pPacket, 1);
-# else
-#  error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//            PPACKET_INFO pInfo = vboxNetFltWinDoIndicateReceive(pAdapt, pPacket);
-//            if(!pInfo)
-//            {
-//                Assert(0);
-//                vboxNetFltWinFreeSGNdisPacket(pPacket, true);
-//                rc = VERR_NO_MEMORY;
-//            }
-//            else
-# endif
-            {
-                cRefs--;
-            }
+            cRefs--;
 #ifdef VBOXNETADP
             STATISTIC_INCREASE(pAdapt->cRxSuccess);
@@ -3459,5 +3507,5 @@
             return false;
 
-        bPromiscuous = (pAdapt->fOurSetFilter & NDIS_PACKET_TYPE_PROMISCUOUS) == NDIS_PACKET_TYPE_PROMISCUOUS;
+        bPromiscuous = (pAdapt->fUpperProtocolSetFilter & NDIS_PACKET_TYPE_PROMISCUOUS) == NDIS_PACKET_TYPE_PROMISCUOUS;
             /*vboxNetFltWinIsPromiscuous(pAdapt);*/
 
Index: /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.h
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.h	(revision 23926)
+++ /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.h	(revision 23927)
@@ -34,6 +34,8 @@
 extern NDIS_SPIN_LOCK     g_GlobalLock;
 
+#ifdef VBOX_LOOPBACK_USEFLAGS
 extern UINT g_fPacketDontLoopBack;
 extern UINT g_fPacketIsLoopedBack;
+#endif
 
 /*
@@ -53,4 +55,11 @@
 DECLHIDDEN(NTSTATUS) vboxNetFltWinPtDispatch(IN PDEVICE_OBJECT pDeviceObject, IN PIRP pIrp);
 DECLHIDDEN(VOID) vboxNetFltWinUnload(IN PDRIVER_OBJECT DriverObject);
+
+#ifndef VBOXNETADP
+# if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS)
+DECLHIDDEN(bool) vboxNetFltWinMatchPackets(PNDIS_PACKET pPacket1, PNDIS_PACKET pPacket2, const INT cbMatch);
+DECLHIDDEN(bool) vboxNetFltWinMatchPacketAndSG(PNDIS_PACKET pPacket, PINTNETSG pSG, const INT cbMatch);
+# endif
+#endif
 
 /*************************
@@ -62,4 +71,13 @@
     ( (PPACKET_INFO)((uint8_t *)(pListEntry) - RT_OFFSETOF(PACKET_INFO, ListEntry)) )
 
+#if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS)
+
+#define VBOX_SLE_2_SEND_RSVD(_pEntry) \
+    ( (PSEND_RSVD)((uint8_t *)(_pEntry) - RT_OFFSETOF(SEND_RSVD, ListEntry)) )
+
+#define VBOX_SLE_2_SENDPACKET(_pEntry) \
+    ( (PNDIS_PACKET)((uint8_t *)(VBOX_SLE_2_SEND_RSVD(_pEntry)) - RT_OFFSETOF(NDIS_PACKET, ProtocolReserved)) )
+
+#endif
 /**
  * enqueus the packet info to the tail of the queue
@@ -201,5 +219,5 @@
 #endif
 
-
+#ifndef VBOXNETADP
 /**
  * searches the list entry in a single-linked list
@@ -228,4 +246,63 @@
 }
 
+#if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS)
+
+DECLINLINE(PNDIS_PACKET) vboxNetFltWinSearchPacket(PSINGLE_LIST pList, PNDIS_PACKET pPacket2Search, int cbMatch, bool bRemove)
+{
+    PSINGLE_LIST_ENTRY pHead = &pList->Head;
+    PSINGLE_LIST_ENTRY pCur;
+    PSINGLE_LIST_ENTRY pPrev;
+    PNDIS_PACKET pCurPacket;
+    for(pCur = pHead->Next, pPrev = pHead; pCur; pPrev = pCur, pCur = pCur->Next)
+    {
+        pCurPacket = VBOX_SLE_2_SENDPACKET(pCur);
+        if(pCurPacket == pPacket2Search || vboxNetFltWinMatchPackets(pPacket2Search, pCurPacket, cbMatch))
+        {
+            if(bRemove)
+            {
+                pPrev->Next = pCur->Next;
+                if(pCur == pList->pTail)
+                {
+                    pList->pTail = pPrev;
+                }
+            }
+            return pCurPacket;
+        }
+    }
+    return NULL;
+}
+
+DECLINLINE(PNDIS_PACKET) vboxNetFltWinSearchPacketBySG(PSINGLE_LIST pList, PINTNETSG pSG, int cbMatch, bool bRemove)
+{
+    PSINGLE_LIST_ENTRY pHead = &pList->Head;
+    PSINGLE_LIST_ENTRY pCur;
+    PSINGLE_LIST_ENTRY pPrev;
+    PNDIS_PACKET pCurPacket;
+    for(pCur = pHead->Next, pPrev = pHead; pCur; pPrev = pCur, pCur = pCur->Next)
+    {
+        pCurPacket = VBOX_SLE_2_SENDPACKET(pCur);
+        if(vboxNetFltWinMatchPacketAndSG(pCurPacket, pSG, cbMatch))
+        {
+            if(bRemove)
+            {
+                pPrev->Next = pCur->Next;
+                if(pCur == pList->pTail)
+                {
+                    pList->pTail = pPrev;
+                }
+            }
+            return pCurPacket;
+        }
+    }
+    return NULL;
+}
+
+#endif /* #if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS) */
+
+DECLINLINE(bool) vboxNetFltWinSListIsEmpty(PSINGLE_LIST pList)
+{
+    return !pList->Head.Next;
+}
+
 DECLINLINE(void) vboxNetFltWinPutTail(PSINGLE_LIST pList, PSINGLE_LIST_ENTRY pEntry)
 {
@@ -235,4 +312,12 @@
 }
 
+DECLINLINE(void) vboxNetFltWinPutHead(PSINGLE_LIST pList, PSINGLE_LIST_ENTRY pEntry)
+{
+    pEntry->Next = pList->Head.Next;
+    pList->Head.Next = pEntry;
+    if(!pEntry->Next)
+        pList->pTail = pEntry;
+}
+
 DECLINLINE(PSINGLE_LIST_ENTRY) vboxNetFltWinGetHead(PSINGLE_LIST pList)
 {
@@ -240,4 +325,5 @@
     if(pEntry && pEntry == pList->pTail)
     {
+        pList->Head.Next = NULL;
         pList->pTail = &pList->Head;
     }
@@ -254,8 +340,36 @@
 }
 
+#if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS)
+
+DECLINLINE(PNDIS_PACKET) vboxNetFltWinInterlockedSearchPacket(PINTERLOCKED_SINGLE_LIST pList, PNDIS_PACKET pPacket2Search, int cbMatch, bool bRemove)
+{
+    PNDIS_PACKET pFound;
+    NdisAcquireSpinLock(&pList->Lock);
+    pFound = vboxNetFltWinSearchPacket(&pList->List, pPacket2Search, cbMatch, bRemove);
+    NdisReleaseSpinLock(&pList->Lock);
+    return pFound;
+}
+
+DECLINLINE(PNDIS_PACKET) vboxNetFltWinInterlockedSearchPacketBySG(PINTERLOCKED_SINGLE_LIST pList, PINTNETSG pSG, int cbMatch, bool bRemove)
+{
+    PNDIS_PACKET pFound;
+    NdisAcquireSpinLock(&pList->Lock);
+    pFound = vboxNetFltWinSearchPacketBySG(&pList->List, pSG, cbMatch, bRemove);
+    NdisReleaseSpinLock(&pList->Lock);
+    return pFound;
+}
+#endif /* #if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS) */
+
 DECLINLINE(void) vboxNetFltWinInterlockedPutTail(PINTERLOCKED_SINGLE_LIST pList, PSINGLE_LIST_ENTRY pEntry)
 {
     NdisAcquireSpinLock(&pList->Lock);
     vboxNetFltWinPutTail(&pList->List, pEntry);
+    NdisReleaseSpinLock(&pList->Lock);
+}
+
+DECLINLINE(void) vboxNetFltWinInterlockedPutHead(PINTERLOCKED_SINGLE_LIST pList, PSINGLE_LIST_ENTRY pEntry)
+{
+    NdisAcquireSpinLock(&pList->Lock);
+    vboxNetFltWinPutHead(&pList->List, pEntry);
     NdisReleaseSpinLock(&pList->Lock);
 }
@@ -270,4 +384,61 @@
 }
 
+# if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS)
+DECLINLINE(void) vboxNetFltWinLbPutSendPacket(PADAPT pAdapt, PNDIS_PACKET pPacket, bool bFromIntNet)
+{
+    PSEND_RSVD pSrv = (PSEND_RSVD)pPacket->ProtocolReserved;
+    pSrv->bFromIntNet = bFromIntNet;
+    vboxNetFltWinInterlockedPutHead(&pAdapt->SendPacketQueue, &pSrv->ListEntry);
+}
+
+DECLINLINE(bool) vboxNetFltWinLbIsFromIntNet(PNDIS_PACKET pPacket)
+{
+    PSEND_RSVD pSrv = (PSEND_RSVD)pPacket->ProtocolReserved;
+    return pSrv->bFromIntNet;
+}
+
+DECLINLINE(PNDIS_PACKET) vboxNetFltWinLbSearchLoopBack(PADAPT pAdapt, PNDIS_PACKET pPacket, bool bRemove)
+{
+    return vboxNetFltWinInterlockedSearchPacket(&pAdapt->SendPacketQueue, pPacket, VBOXNETFLT_PACKETMATCH_LENGTH, bRemove);
+}
+
+DECLINLINE(PNDIS_PACKET) vboxNetFltWinLbSearchLoopBackBySG(PADAPT pAdapt, PINTNETSG pSG, bool bRemove)
+{
+    return vboxNetFltWinInterlockedSearchPacketBySG(&pAdapt->SendPacketQueue, pSG, VBOXNETFLT_PACKETMATCH_LENGTH, bRemove);
+}
+
+DECLINLINE(bool) vboxNetFltWinLbRemoveSendPacket(PADAPT pAdapt, PNDIS_PACKET pPacket)
+{
+    PSEND_RSVD pSrv = (PSEND_RSVD)pPacket->ProtocolReserved;
+    return vboxNetFltWinInterlockedSearchListEntry(&pAdapt->SendPacketQueue, &pSrv->ListEntry, true);
+}
+
+# endif
+
+#endif
+
+#ifdef DEBUG_misha
+DECLHIDDEN(bool) vboxNetFltWinCheckMACs(PNDIS_PACKET pPacket, PRTMAC pDst, PRTMAC pSrc);
+DECLHIDDEN(bool) vboxNetFltWinCheckMACsSG(PINTNETSG pSG, PRTMAC pDst, PRTMAC pSrc);
+extern RTMAC g_vboxNetFltWinVerifyMACBroadcast;
+extern RTMAC g_vboxNetFltWinVerifyMACGuest;
+
+# define VBOXNETFLT_LBVERIFY(_pnf, _p) \
+    do { \
+        Assert(!vboxNetFltWinCheckMACs(_p, NULL, &g_vboxNetFltWinVerifyMACGuest)); \
+        Assert(!vboxNetFltWinCheckMACs(_p, NULL, &(_pnf)->u.s.Mac)); \
+    } while(0)
+
+# define VBOXNETFLT_LBVERIFYSG(_pnf, _p) \
+    do { \
+        Assert(!vboxNetFltWinCheckMACsSG(_p, NULL, &g_vboxNetFltWinVerifyMACGuest)); \
+        Assert(!vboxNetFltWinCheckMACsSG(_p, NULL, &(_pnf)->u.s.Mac)); \
+    } while(0)
+
+#else
+# define VBOXNETFLT_LBVERIFY(_pnf, _p) do{}while(0)
+# define VBOXNETFLT_LBVERIFYSG(_pnf, _p) do{}while(0)
+#endif
+
 /** initializes the list */
 #define INIT_SINGLE_LIST(_pList) \
@@ -279,11 +450,16 @@
 /** initializes the list */
 #define INIT_INTERLOCKED_SINGLE_LIST(_pList) \
-    { \
+    do { \
         INIT_SINGLE_LIST(&(_pList)->List); \
         NdisAllocateSpinLock(&(_pList)->Lock); \
-    }
+    } while(0)
 
 /** delete the packet queue */
-#define FINI_INTERLOCKED_SINGLE_LIST(_pList) NdisFreeSpinLock(&(_pList)->Lock)
+#define FINI_INTERLOCKED_SINGLE_LIST(_pList) \
+    do { \
+        Assert(vboxNetFltWinSListIsEmpty(&(_pList)->List)); \
+        NdisFreeSpinLock(&(_pList)->Lock) \
+    } while(0)
+
 
 /** obtains the PTRANSFERDATA_RSVD given a single list entry it contains */
@@ -778,11 +954,4 @@
 
 DECLHIDDEN(void) vboxNetFltWinFreeSGNdisPacket(PNDIS_PACKET pPacket, bool bFreeMem);
-
-#ifdef DEBUG_NETFLT_PACKETS
-DECLHIDDEN(bool) vboxNetFltWinMatchPacketAndSG(PNDIS_PACKET pPacket, PINTNETSG pSG, const INT cbMatch);
-
-DECLHIDDEN(bool) vboxNetFltWinMatchPackets(PNDIS_PACKET pPacket1, PNDIS_PACKET pPacket2, const INT cbMatch);
-
-#endif
 
 #ifdef DEBUG_NETFLT_PACKETS
@@ -822,23 +991,5 @@
  * @return true if the packet is a looped back one, false otherwise
  */
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//#ifdef VBOX_NETFLT_ONDEMAND_BIND
-//DECLHIDDEN(bool) vboxNetFltWinIsLoopedBackPacket(PADAPT pAdapt, PNDIS_PACKET pPacket);
-//#else
-//DECLHIDDEN(bool) vboxNetFltWinIsLoopedBackPacket(PADAPT pAdapt, PNDIS_PACKET pPacket, bool bOnRecv);
-//#endif
-//
-//#ifdef VBOX_NETFLT_ONDEMAND_BIND
-//DECLHIDDEN(bool) vboxNetFltWinIsLoopedBackPacketSG(PADAPT pAdapt, PINTNETSG pSG);
-//#else
-//DECLHIDDEN(bool) vboxNetFltWinIsLoopedBackPacketSG(PADAPT pAdapt, PINTNETSG pSG, bool bOnRecv);
-//#endif
-#else
+#ifdef VBOX_LOOPBACK_USEFLAGS
 DECLINLINE(bool) vboxNetFltWinIsLoopedBackPacket(PNDIS_PACKET pPacket)
 {
Index: /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltCommon-win.h
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltCommon-win.h	(revision 23926)
+++ /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltCommon-win.h	(revision 23927)
@@ -153,4 +153,8 @@
 #define VBOX_NETFLT_PACKET_HEADER_MATCH_SIZE 24
 
+#if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS)
+# define VBOXNETFLT_PACKETMATCH_LENGTH (ETH_HEADER_SIZE + 2)
+#endif
+
 #ifdef VBOXNETADP
 #define     VBOXNETADP_HEADER_SIZE             14
@@ -316,13 +320,4 @@
     /** miniport device state */
     ADAPT_DEVICE             MPState;
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-    /** Pending receive packet queue (i.e. packets that were indicated to the upperlying protocols, but not completed yet)*/
-//    INTERLOCKED_PACKET_QUEUE                   RecvPacketQueue;
-#endif
     /** ndis packet pool used for receives */
     NDIS_HANDLE                    hRecvPacketPoolHandle;
@@ -389,7 +384,10 @@
 
 #ifndef VBOXNETADP
+#if defined(DEBUG_NETFLT_LOOPBACK) || !defined(VBOX_LOOPBACK_USEFLAGS)
+    /** used for maintaining the pending send packets for handling packet loopback */
+    INTERLOCKED_SINGLE_LIST SendPacketQueue;
+#endif
     /** used for serializing calls to the NdisRequest in the vboxNetFltWinSynchNdisRequest */
     RTSEMFASTMUTEX                 hSynchRequestMutex;
-
     /** event used to synchronize with the Ndis Request completion in the vboxNetFltWinSynchNdisRequest */
     KEVENT                         hSynchCompletionEvent;
@@ -398,17 +396,4 @@
     /** pointer to the Ndis Request being executed by the vboxNetFltWinSynchNdisRequest */
     PNDIS_REQUEST volatile         pSynchRequest;
-#endif
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-    /** Pending send packet queue (i.e. packets that were sent to the underlying miniport, but not completed yet)*/
-
-    INTERLOCKED_PACKET_QUEUE                   SendPacketQueue;
-    /** Packet info pool, i.e. the pool for the packet queue elements */
-#endif
-#ifndef VBOXNETADP
     /** ndis packet pool used for sends */
     NDIS_HANDLE                    hSendPacketPoolHandle;
@@ -454,8 +439,12 @@
      * can be null if the packet was originated by intnet */
     PNDIS_PACKET    pOriginalPkt;
-
     /** pointer to the buffer to be freed on send completion
      * can be null if no buffer is to be freed */
     PVOID           pBufToFree;
+#if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS)
+    SINGLE_LIST_ENTRY ListEntry;
+    /* true if the packet is from IntNet */
+    bool bFromIntNet;
+#endif
 } SEND_RSVD, *PSEND_RSVD;
 
@@ -500,5 +489,7 @@
 C_ASSERT(sizeof(UINT) == sizeof(uint32_t));
 
+#ifdef VBOX_LOOPBACK_USEFLAGS
 #define NDIS_FLAGS_SKIP_LOOPBACK_W2K    0x400
+#endif
 
 #include "../VBoxNetFltInternal.h"
Index: /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltMp-win.c
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltMp-win.c	(revision 23926)
+++ /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltMp-win.c	(revision 23927)
@@ -456,33 +456,12 @@
     if (fStatus == NDIS_STATUS_SUCCESS)
     {
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-//        /* need to enqueue to enable callback discarding
-//         * since we now always discard all callbacks */
-//        PPACKET_INFO pInfo = vboxNetFltWinDoSend(&fStatus, pAdapt, pMyPacket);
-//
-//        Assert(pInfo);
-#else
+#if !defined(VBOX_LOOPBACK_USEFLAGS) /* || defined(DEBUG_NETFLT_PACKETS) */
+        /* no need for the loop enqueue & check in a passthru mode , ndis will do everything for us */
+#endif
         NdisSend(&fStatus,
                  pAdapt->hBindingHandle,
                  pMyPacket);
-#endif
         if (fStatus != NDIS_STATUS_PENDING)
         {
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//            vboxNetFltWinDoCompleteSendViaInfo(pAdapt, pInfo);
-//            vboxNetFltWinPpFreePacketInfo(pInfo);
-#endif
-
 #ifndef WIN9X
             NdisIMCopySendCompletePerPacketInfo (pPacket, pMyPacket);
@@ -842,59 +821,36 @@
             pPacket = pPacketArray[i];
 
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//            if(vboxNetFltWinIsLoopedBackPacket(pAdapt, pPacket, false))
+            if(!cNetFltRefs
+                    || (fStatus = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, PACKET_SRC_HOST)) != NDIS_STATUS_SUCCESS)
+            {
+#ifndef VBOXNETADP
+                fStatus = vboxNetFltWinSendPassThru(pAdapt, pPacket);
 #else
-            if(vboxNetFltWinIsLoopedBackPacket(pPacket))
+                if(!cNetFltRefs)
+                {
+# ifdef VBOXNETADP_REPORT_DISCONNECTED
+                    fStatus = NDIS_STATUS_MEDIA_DISCONNECT;
+                    STATISTIC_INCREASE(pAdapt->cTxError);
+# else
+                    fStatus = NDIS_STATUS_SUCCESS;
+# endif
+                }
 #endif
 
-            {
-                /* we should not have loopbacks on send */
-                Assert(0);
-
-                NdisMSendComplete(pAdapt->hMiniportHandle,
-                                  pPacket,
-                                  NDIS_STATUS_SUCCESS);
-            }
-            else
-            {
-                if(!cNetFltRefs
-                    || (fStatus = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, PACKET_SRC_HOST)) != NDIS_STATUS_SUCCESS)
+                if (fStatus != NDIS_STATUS_PENDING)
                 {
-#ifndef VBOXNETADP
-                    fStatus = vboxNetFltWinSendPassThru(pAdapt, pPacket);
-#else
-                    if(!cNetFltRefs)
-                    {
-# ifdef VBOXNETADP_REPORT_DISCONNECTED
-                        fStatus = NDIS_STATUS_MEDIA_DISCONNECT;
-                        STATISTIC_INCREASE(pAdapt->cTxError);
-# else
-                        fStatus = NDIS_STATUS_SUCCESS;
-# endif
-                    }
-#endif
-
-                    if (fStatus != NDIS_STATUS_PENDING)
-                    {
-                        NdisMSendComplete(pAdapt->hMiniportHandle,
+                    NdisMSendComplete(pAdapt->hMiniportHandle,
                                       pPacket,
                                       fStatus);
-                    }
-                    else
-                    {
-                        cAdaptRefs--;
-                    }
                 }
                 else
                 {
                     cAdaptRefs--;
-                    cNetFltRefs--;
                 }
+            }
+            else
+            {
+                cAdaptRefs--;
+                cNetFltRefs--;
             }
         }
@@ -2460,18 +2416,5 @@
         PNDIS_PACKET    MyPacket;
         PRECV_RSVD      RecvRsvd;
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//        PPACKET_INFO pInfo = vboxNetFltWinDoCompleteIndicateReceive(pAdapt, Packet);
-//
-//        if(pInfo)
-//        {
-//            vboxNetFltWinPpFreePacketInfo(pInfo);
-//        }
-#endif
+
         RecvRsvd = (PRECV_RSVD)(Packet->MiniportReserved);
         MyPacket = RecvRsvd->pOriginalPkt;
Index: /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltPt-win.c
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltPt-win.c	(revision 23926)
+++ /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltPt-win.c	(revision 23927)
@@ -552,8 +552,22 @@
             /* save mac options for adaptor below us to use it with the NdisCopyLookaheadData when our ProtocolReceive is called */
             pAdapt->fMacOptions = *(PULONG)NdisRequest->DATA.QUERY_INFORMATION.InformationBuffer;
-
+#ifndef VBOX_LOOPBACK_USEFLAGS
+            /*
+             * Remove the no-loopback bit from mac-options. In essence we are
+             * telling NDIS that we can handle loopback. We don't, but the
+             * interface below us does. If we do not do this, then loopback
+             * processing happens both below us and above us. This is wasteful
+             * at best and if Netmon is running, it will see multiple copies
+             * of loopback packets when sniffing above us.
+             *
+             * Only the lowest miniport is a stack of layered miniports should
+             * ever report this bit set to NDIS.
+             */
+            *(PULONG)NdisRequest->DATA.QUERY_INFORMATION.InformationBuffer &= ~NDIS_MAC_OPTION_NO_LOOPBACK;
+#else
             /* we have to catch loopbacks from the underlying driver, so no duplications will occur,
              * just indicate NDIS to handle loopbacks for the packets coming from the protocol */
             *(PULONG)NdisRequest->DATA.QUERY_INFORMATION.InformationBuffer |= NDIS_MAC_OPTION_NO_LOOPBACK;
+#endif
         }
         if(Oid == OID_GEN_CURRENT_PACKET_FILTER && VBOXNETFLT_PROMISCUOUS_SUPPORTED(pAdapt))
@@ -737,17 +751,9 @@
     {
         PSEND_RSVD        SendRsvd;
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//        PPACKET_INFO pInfo = vboxNetFltWinDoCompleteSend(pAdapt, Packet);
-//
-//        if(pInfo)
-//        {
-//            vboxNetFltWinPpFreePacketInfo(pInfo);
-//        }
+
+#if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS)
+        /* @todo: for optimization we could check only for netflt-mode packets
+         * do it for all for now */
+        vboxNetFltWinLbRemoveSendPacket(pAdapt, Packet);
 #endif
 //        Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
@@ -813,150 +819,4 @@
     vboxNetFltWinInterlockedPutTail(pList, &pTDR->ListEntry);
 }
-
-#endif
-
-static bool vboxNetFltWinPtTransferDataCompleteActive(IN PADAPT pAdapt,
-        IN PNDIS_PACKET pPacket,
-        IN NDIS_STATUS Status)
-{
-    PVBOXNETFLTINS pNetFltIf = PADAPT_2_PVBOXNETFLTINS(pAdapt);
-    PNDIS_BUFFER pBuffer;
-    PTRANSFERDATA_RSVD pTDR;
-
-    if(!vboxNetFltWinRemovePacketFromList(&pAdapt->TransferDataList, pPacket))
-        return false;
-
-    pTDR = &((PPT_RSVD)pPacket->ProtocolReserved)->u.TransferDataRsvd;
-    Assert(pTDR);
-    Assert(pTDR->pOriginalBuffer);
-
-    do
-    {
-        NdisUnchainBufferAtFront(pPacket, &pBuffer);
-
-        Assert(pBuffer);
-
-        NdisFreeBuffer(pBuffer);
-
-        pBuffer = pTDR->pOriginalBuffer;
-
-        NdisChainBufferAtBack(pPacket, pBuffer);
-
-        /* data transfer was initiated when the netFlt was active
-         * the netFlt is still retained by us
-         * 1. check if loopback
-         * 2. enqueue packet
-         * 3. release netFlt */
-
-        if(Status == NDIS_STATUS_SUCCESS)
-        {
-
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-    /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-    instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-    similar to that used in TrasferData handling should be used;
-    */
-
-//                /* 1. if loopback then quit with  NDIS_STATUS_NOT_ACCEPTED */
-//#ifdef VBOX_NETFLT_ONDEMAND_BIND
-//                if(vboxNetFltWinIsLoopedBackPacket(pAdapt, pPacket))
-//#else
-//                if(vboxNetFltWinIsLoopedBackPacket(pAdapt, pPacket, true))
-//#endif
-#else
-            if(vboxNetFltWinIsLoopedBackPacket(pPacket))
-#endif
-            {
-                Assert(0);
-            }
-            else
-            {
-                PRECV_RSVD            pRecvRsvd;
-                /* 2. enqueue */
-                /* use the same packet info to put the packet in the processing packet queue */
-#ifdef VBOX_NETFLT_ONDEMAND_BIND
-                PNDIS_BUFFER pBuffer;
-                PVOID pVA;
-                UINT cbLength;
-                uint32_t fFlags;
-
-                NdisQueryPacket(pPacket, NULL, NULL, &pBuffer, NULL);
-                NdisQueryBufferSafe(pBuffer, &pVA, &cbLength, NormalPagePriority);
-
-                fFlags = MACS_EQUAL(((PRTNETETHERHDR)pVA)->SrcMac, pNetFltIf->u.s.Mac) ?
-                                                PACKET_MINE | PACKET_SRC_HOST : PACKET_MINE;
-                SET_FLAGS_TO_INFO(pInfo, fFlags);
-
-                pRecvRsvd = (PRECV_RSVD)(pPacket->MiniportReserved);
-                pRecvRsvd->pOriginalPkt = NULL;
-                pRecvRsvd->pBufToFree = NULL;
-
-                NdisSetPacketFlags(pPacket, 0);
-
-                Status = vboxNetFltWinQuEnqueuePacket(pNetFltIf, pPacket, fFlags);
-#else
-                pRecvRsvd = (PRECV_RSVD)(pPacket->MiniportReserved);
-                pRecvRsvd->pOriginalPkt = NULL;
-                pRecvRsvd->pBufToFree = NULL;
-
-                NdisSetPacketFlags(pPacket, 0);
-
-                Status = vboxNetFltWinQuEnqueuePacket(pNetFltIf, pPacket, PACKET_MINE);
-#endif
-                if(Status == NDIS_STATUS_SUCCESS)
-                {
-                    break;
-                }
-                Assert(0);
-            }
-        }
-        else
-        {
-            Assert(0);
-        }
-        /* we are here because of error either in data transfer or in enqueueing the packet */
-        vboxNetFltWinFreeSGNdisPacket(pPacket, true);
-        vboxNetFltWinDereferenceNetFlt(pNetFltIf);
-        vboxNetFltWinDereferenceAdapt(pAdapt);
-    } while(0);
-
-    return true;
-}
-
-/**
- * Entry point called by NDIS to indicate completion of a call by us
- * to NdisTransferData.
- *
- * See notes under SendComplete.
- */
-static VOID
-vboxNetFltWinPtTransferDataComplete(
-    IN  NDIS_HANDLE         ProtocolBindingContext,
-    IN  PNDIS_PACKET        pPacket,
-    IN  NDIS_STATUS         Status,
-    IN  UINT                BytesTransferred
-    )
-{
-    PADAPT      pAdapt =(PADAPT)ProtocolBindingContext;
-    if(!vboxNetFltWinPtTransferDataCompleteActive(pAdapt, pPacket, Status))
-    {
-#ifndef VBOX_NETFLT_ONDEMAND_BIND
-        if(pAdapt->hMiniportHandle)
-        {
-            NdisMTransferDataComplete(pAdapt->hMiniportHandle,
-                                      pPacket,
-                                      Status,
-                                      BytesTransferred);
-        }
-
-        vboxNetFltWinDereferenceAdapt(pAdapt);
-#else
-        /* we are here because we've failed to allocate packet info */
-        Assert(0);
-#endif
-    }
-}
-#ifndef VBOX_NETFLT_ONDEMAND_BIND
 
 /**
@@ -1051,4 +911,154 @@
 }
 
+#endif
+
+static bool vboxNetFltWinPtTransferDataCompleteActive(IN PADAPT pAdapt,
+        IN PNDIS_PACKET pPacket,
+        IN NDIS_STATUS Status)
+{
+    PVBOXNETFLTINS pNetFltIf = PADAPT_2_PVBOXNETFLTINS(pAdapt);
+    PNDIS_BUFFER pBuffer;
+    PTRANSFERDATA_RSVD pTDR;
+
+    if(!vboxNetFltWinRemovePacketFromList(&pAdapt->TransferDataList, pPacket))
+        return false;
+
+    pTDR = &((PPT_RSVD)pPacket->ProtocolReserved)->u.TransferDataRsvd;
+    Assert(pTDR);
+    Assert(pTDR->pOriginalBuffer);
+
+    do
+    {
+        NdisUnchainBufferAtFront(pPacket, &pBuffer);
+
+        Assert(pBuffer);
+
+        NdisFreeBuffer(pBuffer);
+
+        pBuffer = pTDR->pOriginalBuffer;
+
+        NdisChainBufferAtBack(pPacket, pBuffer);
+
+        /* data transfer was initiated when the netFlt was active
+         * the netFlt is still retained by us
+         * 1. check if loopback
+         * 2. enqueue packet
+         * 3. release netFlt */
+
+        if(Status == NDIS_STATUS_SUCCESS)
+        {
+
+#ifdef VBOX_LOOPBACK_USEFLAGS
+            if(vboxNetFltWinIsLoopedBackPacket(pPacket))
+            {
+                /* should not be here */
+                Assert(0);
+            }
+#else
+            PNDIS_PACKET pLb = vboxNetFltWinLbSearchLoopBack(pAdapt, pPacket, false);
+            if(pLb)
+            {
+                /* should not be here */
+                Assert(0);
+                if(!vboxNetFltWinLbIsFromIntNet(pLb))
+                {
+                    /* the packet is not from int net, need to pass it up to the host */
+                    vboxNetFltWinPtQueueReceivedPacket(pAdapt, pPacket, true);
+                    /* dereference NetFlt, pAdapt will be dereferenced on Packet return */
+                    vboxNetFltWinDereferenceNetFlt(pNetFltIf);
+                    break;
+                }
+            }
+#endif
+            else
+            {
+                PRECV_RSVD            pRecvRsvd;
+                /* 2. enqueue */
+                /* use the same packet info to put the packet in the processing packet queue */
+#ifdef VBOX_NETFLT_ONDEMAND_BIND
+                PNDIS_BUFFER pBuffer;
+                PVOID pVA;
+                UINT cbLength;
+                uint32_t fFlags;
+
+                NdisQueryPacket(pPacket, NULL, NULL, &pBuffer, NULL);
+                NdisQueryBufferSafe(pBuffer, &pVA, &cbLength, NormalPagePriority);
+
+                fFlags = MACS_EQUAL(((PRTNETETHERHDR)pVA)->SrcMac, pNetFltIf->u.s.Mac) ?
+                                                PACKET_MINE | PACKET_SRC_HOST : PACKET_MINE;
+                SET_FLAGS_TO_INFO(pInfo, fFlags);
+
+                pRecvRsvd = (PRECV_RSVD)(pPacket->MiniportReserved);
+                pRecvRsvd->pOriginalPkt = NULL;
+                pRecvRsvd->pBufToFree = NULL;
+
+                NdisSetPacketFlags(pPacket, 0);
+
+                Status = vboxNetFltWinQuEnqueuePacket(pNetFltIf, pPacket, fFlags);
+#else
+                VBOXNETFLT_LBVERIFY(pNetFltIf, pPacket);
+
+                pRecvRsvd = (PRECV_RSVD)(pPacket->MiniportReserved);
+                pRecvRsvd->pOriginalPkt = NULL;
+                pRecvRsvd->pBufToFree = NULL;
+
+                NdisSetPacketFlags(pPacket, 0);
+
+                Status = vboxNetFltWinQuEnqueuePacket(pNetFltIf, pPacket, PACKET_MINE);
+#endif
+                if(Status == NDIS_STATUS_SUCCESS)
+                {
+                    break;
+                }
+                Assert(0);
+            }
+        }
+        else
+        {
+            Assert(0);
+        }
+        /* we are here because of error either in data transfer or in enqueueing the packet */
+        vboxNetFltWinFreeSGNdisPacket(pPacket, true);
+        vboxNetFltWinDereferenceNetFlt(pNetFltIf);
+        vboxNetFltWinDereferenceAdapt(pAdapt);
+    } while(0);
+
+    return true;
+}
+
+/**
+ * Entry point called by NDIS to indicate completion of a call by us
+ * to NdisTransferData.
+ *
+ * See notes under SendComplete.
+ */
+static VOID
+vboxNetFltWinPtTransferDataComplete(
+    IN  NDIS_HANDLE         ProtocolBindingContext,
+    IN  PNDIS_PACKET        pPacket,
+    IN  NDIS_STATUS         Status,
+    IN  UINT                BytesTransferred
+    )
+{
+    PADAPT      pAdapt =(PADAPT)ProtocolBindingContext;
+    if(!vboxNetFltWinPtTransferDataCompleteActive(pAdapt, pPacket, Status))
+    {
+#ifndef VBOX_NETFLT_ONDEMAND_BIND
+        if(pAdapt->hMiniportHandle)
+        {
+            NdisMTransferDataComplete(pAdapt->hMiniportHandle,
+                                      pPacket,
+                                      Status,
+                                      BytesTransferred);
+        }
+
+        vboxNetFltWinDereferenceAdapt(pAdapt);
+#else
+        /* we are here because we've failed to allocate packet info */
+        Assert(0);
+#endif
+    }
+}
+#ifndef VBOX_NETFLT_ONDEMAND_BIND
 /**
  * This routine process the queued the packet, if anything is fine, indicate the packet
@@ -1293,5 +1303,4 @@
 
 #ifndef DEBUG_NETFLT_RECV_TRANSFERDATA
-        /* can check for loopback? check it*/
         if (cbPacket == cbLookaheadBuffer)
         {
@@ -1299,46 +1308,63 @@
             PINTNETSG pSG;
             PUCHAR pRcvData;
-
-#ifdef DEBUG_NETFLT_LOOPBACK
-                /* TODO: can we check for loopback here ?
-                 * for now just get the complete SG and then decide if it is a loopback one */
-                /* if loopback then quit */
-#endif
-                /* allocate SG buffer */
-                Status = vboxNetFltWinAllocSG(cbPacket + cbHeaderBuffer, &pSG);
-                if(Status != NDIS_STATUS_SUCCESS)
-                {
-                    Assert(0);
-                    break;
-                }
-
-                pRcvData = (PUCHAR)pSG->aSegs[0].pv;
-
-                NdisMoveMappedMemory(pRcvData, pHeaderBuffer, cbHeaderBuffer);
-
-                NdisCopyLookaheadData(pRcvData+cbHeaderBuffer,
+#ifndef VBOX_LOOPBACK_USEFLAGS
+            PNDIS_PACKET pLb;
+#endif
+
+            /* allocate SG buffer */
+            Status = vboxNetFltWinAllocSG(cbPacket + cbHeaderBuffer, &pSG);
+            if(Status != NDIS_STATUS_SUCCESS)
+            {
+                Assert(0);
+                break;
+            }
+
+            pRcvData = (PUCHAR)pSG->aSegs[0].pv;
+
+            NdisMoveMappedMemory(pRcvData, pHeaderBuffer, cbHeaderBuffer);
+
+            NdisCopyLookaheadData(pRcvData+cbHeaderBuffer,
                                                   pLookaheadBuffer,
                                                   cbLookaheadBuffer,
                                                   pAdapt->fMacOptions);
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//                /* check if it is a loopback */
-//# ifdef VBOX_NETFLT_ONDEMAND_BIND
-//                if(vboxNetFltWinIsLoopedBackPacketSG(pAdapt, pSG))
-//# else
-//                if(vboxNetFltWinIsLoopedBackPacketSG(pAdapt, pSG, true))
-//# endif
-//                {
-//                    Assert(0);
-//                    vboxNetFltWinMemFree(pSG);
-//                    Status = NDIS_STATUS_NOT_ACCEPTED;
-//                    break;
-//                }
-#endif
+#ifndef VBOX_LOOPBACK_USEFLAGS
+            pLb = vboxNetFltWinLbSearchLoopBackBySG(pAdapt, pSG, false);
+            if(pLb)
+            {
+                /* should not be here */
+                Assert(0);
+
+                if(!vboxNetFltWinLbIsFromIntNet(pLb))
+                {
+                    PNDIS_PACKET pMyPacket;
+                    pMyPacket = vboxNetFltWinNdisPacketFromSG(pAdapt, /* PADAPT */
+                        pSG, /* PINTNETSG */
+                        pSG, /* PVOID pBufToFree */
+                        false, /* bool bToWire */
+                        false); /* bool bCopyMemory */
+                    if(pMyPacket)
+                    {
+                        vboxNetFltWinPtQueueReceivedPacket(pAdapt, pMyPacket, true);
+                        /* dereference the NetFlt here & indicate SUCCESS, which would mean the caller would not do a dereference
+                         * the pAdapt dereference will be done on packet return */
+                        vboxNetFltWinDereferenceNetFlt(pNetFlt);
+                        Status = NDIS_STATUS_SUCCESS;
+                    }
+                    else
+                    {
+                        vboxNetFltWinMemFree(pSG);
+                        Status = NDIS_STATUS_FAILURE;
+                    }
+                }
+                else
+                {
+                    vboxNetFltWinMemFree(pSG);
+                    Status = NDIS_STATUS_NOT_ACCEPTED;
+                }
+                break;
+            }
+#endif
+            VBOXNETFLT_LBVERIFYSG(pNetFlt, pSG);
+
                 /* enqueue SG */
 #ifdef VBOX_NETFLT_ONDEMAND_BIND
@@ -1349,12 +1375,12 @@
                 }
 #else
-                Status = vboxNetFltWinQuEnqueuePacket(pNetFlt, pSG, PACKET_SG | PACKET_MINE);
-#endif
-                if(Status != NDIS_STATUS_SUCCESS)
-                {
-                    Assert(0);
-                    vboxNetFltWinMemFree(pSG);
-                    break;
-                }
+            Status = vboxNetFltWinQuEnqueuePacket(pNetFlt, pSG, PACKET_SG | PACKET_MINE);
+#endif
+            if(Status != NDIS_STATUS_SUCCESS)
+            {
+                Assert(0);
+                vboxNetFltWinMemFree(pSG);
+                break;
+            }
         }
         else
@@ -1366,16 +1392,7 @@
             PUCHAR pMemBuf;
             UINT cbBuf = cbPacket + cbHeaderBuffer;
-//            PPACKET_INFO pInfo;
             UINT                    BytesTransferred;
-                /* TODO: can check for loopback here ? */
-                /* for now just get the complete complete packet and then decide if it is a looped back one */
-                /* if loopback then quit with  NDIS_STATUS_NOT_ACCEPTED
-                 * {
-                 *     Status = NDIS_STATUS_NOT_ACCEPTED;
-                 *     break;
-                 * }
-                 * */
-
-                /* allocate NDIS Packet buffer */
+
+            /* allocate NDIS Packet buffer */
 #ifdef VBOX_NETFLT_ONDEMAND_BIND
             /* use the Send packet pool for packet allocation */
@@ -1390,6 +1407,8 @@
             }
 
+#ifdef VBOX_LOOPBACK_USEFLAGS
             /* set "don't loopback" flags */
             NdisSetPacketFlags(pPacket, g_fPacketDontLoopBack);
+#endif
 
             Status = vboxNetFltWinMemAlloc(&pMemBuf, cbBuf);
@@ -1603,16 +1622,6 @@
                 do
                 {
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//                    if(vboxNetFltWinIsLoopedBackPacket(pAdapt, pPacket, true))
-#else
+#ifdef VBOX_LOOPBACK_USEFLAGS
                     if(vboxNetFltWinIsLoopedBackPacket(pPacket))
-#endif
-
                     {
                         Assert(0);
@@ -1623,16 +1632,43 @@
                     }
 
+                    VBOXNETFLT_LBVERIFY(pNetFlt, pPacket);
+#else
+                    PNDIS_PACKET pLb = NULL;
+#endif
                     if(bNetFltActive)
                     {
-                        Status = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, PACKET_COPY);
-                        if(Status == NDIS_STATUS_SUCCESS)
+#ifndef VBOX_LOOPBACK_USEFLAGS
+                        pLb = vboxNetFltWinLbSearchLoopBack(pAdapt, pPacket, true /* ??? no need to keep it, so remove */);
+                        if(!pLb)
+#endif
                         {
+                            VBOXNETFLT_LBVERIFY(pNetFlt, pPacket);
+
+                            Status = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, PACKET_COPY);
+                            Assert(Status == NDIS_STATUS_SUCCESS);
+                            if(Status == NDIS_STATUS_SUCCESS)
+                            {
+                                //NdisReturnPackets(&pPacket, 1);
+                                fAdaptActive = false;
+                                bNetFltActive = false;
+                                break;
+                            }
+                        }
+#ifndef VBOX_LOOPBACK_USEFLAGS
+                        else if(vboxNetFltWinLbIsFromIntNet(pLb))
+                        {
+                            /* nothing else to do here, just return the packet */
                             //NdisReturnPackets(&pPacket, 1);
-                            fAdaptActive = false;
-                            bNetFltActive = false;
+                            Status = NDIS_STATUS_NOT_ACCEPTED;
                             break;
                         }
+                        /* we are here because this is a looped back packet set not from intnet
+                         * we will post it to the upper protocol */
+#endif
                     }
 
+#ifndef VBOX_LOOPBACK_USEFLAGS
+                    Assert(pLb && !vboxNetFltWinLbIsFromIntNet(pLb));
+#endif
                     Status = vboxNetFltWinRecvPassThru(pAdapt, pPacket);
                     /* we are done with packet processing, and we will
@@ -1642,10 +1678,14 @@
                 } while(FALSE);
 
-                if(Status == NDIS_STATUS_SUCCESS || Status == NDIS_STATUS_NOT_ACCEPTED)
+                if(Status == NDIS_STATUS_SUCCESS || Status == NDIS_STATUS_NOT_ACCEPTED
+#ifndef VBOX_LOOPBACK_USEFLAGS
+                        || pLb
+#endif
+                        )
                 {
                     break;
                 }
             }
-#endif /* todo: remove */
+#endif
             if(bNetFltActive)
             {
@@ -1661,5 +1701,10 @@
                     else
                     {
+#ifndef VBOX_LOOPBACK_USEFLAGS
                         /* this is a loopback packet, nothing to do here */
+#else
+                        Assert(0);
+                        /* should not be here */
+#endif
                     }
                     break;
@@ -1895,16 +1940,6 @@
         do
         {
-#ifdef DEBUG_NETFLT_LOOPBACK
-# error "implement (see comments in the sources below this #error:)"
-        /* @todo FIXME no need for the PPACKET_INFO mechanism here;
-        instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \
-        similar to that used in TrasferData handling should be used;
-        */
-
-//            if(vboxNetFltWinIsLoopedBackPacket(pAdapt, pPacket, true))
-#else
+#ifdef VBOX_LOOPBACK_USEFLAGS
             if(vboxNetFltWinIsLoopedBackPacket(pPacket))
-#endif
-
             {
                 Assert(0);
@@ -1917,34 +1952,56 @@
             }
 
+            VBOXNETFLT_LBVERIFY(pNetFlt, pPacket);
+#endif
+
             if(bNetFltActive)
             {
-                bool bResources = NDIS_GET_PACKET_STATUS(pPacket) == NDIS_STATUS_RESOURCES;
-                NDIS_STATUS fStatus;
-
-                /*TODO: remove this assert.
-                 * this is a temporary assert for debugging purposes:
-                 * we're probably doing something wrong with the packets if the miniport reports NDIS_STATUS_RESOURCES */
-                Assert(!bResources);
-
-                fStatus = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, bResources ? PACKET_COPY : 0);
-                if(fStatus == NDIS_STATUS_SUCCESS)
+#ifndef VBOX_LOOPBACK_USEFLAGS
+                PNDIS_PACKET pLb = vboxNetFltWinLbSearchLoopBack(pAdapt, pPacket, true /* ??? no need to keep it, so remove */);
+                if(!pLb)
+#endif
                 {
-                    bNetFltActive = false;
-                    fAdaptActive = false;
-                    if(bResources)
+                    NDIS_STATUS fStatus;
+                    bool bResources = NDIS_GET_PACKET_STATUS(pPacket) == NDIS_STATUS_RESOURCES;
+
+                    VBOXNETFLT_LBVERIFY(pNetFlt, pPacket);
+
+                    /*TODO: remove this assert.
+                     * this is a temporary assert for debugging purposes:
+                     * we're probably doing something wrong with the packets if the miniport reports NDIS_STATUS_RESOURCES */
+                    Assert(!bResources);
+
+                    fStatus = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, bResources ? PACKET_COPY : 0);
+                    if(fStatus == NDIS_STATUS_SUCCESS)
                     {
-                        cRefCount = 0;
-                        //NdisReturnPackets(&pPacket, 1);
+                        bNetFltActive = false;
+                        fAdaptActive = false;
+                        if(bResources)
+                        {
+                            cRefCount = 0;
+                            //NdisReturnPackets(&pPacket, 1);
+                        }
+                        else
+                        {
+                            cRefCount = 1;
+                        }
+                        break;
                     }
                     else
                     {
-                        cRefCount = 1;
+                        Assert(0);
                     }
+                }
+#ifndef VBOX_LOOPBACK_USEFLAGS
+                else if(vboxNetFltWinLbIsFromIntNet(pLb))
+                {
+                    /* the packet is from intnet, it has already been set to the host,
+                     * no need for loopng it back to the host again */
+                    /* nothing else to do here, just return the packet */
+                    cRefCount = 0;
+                    //NdisReturnPackets(&pPacket, 1);
                     break;
                 }
-                else
-                {
-                    Assert(0);
-                }
+#endif
             }
 
Index: /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 23926)
+++ /trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp	(revision 23927)
@@ -111,5 +111,5 @@
     AssertReturn(pvPageCpu, VERR_INVALID_PARAMETER);
 
-#if defined(LOG_ENABLED) && !defined(DEBUG_bird)
+#if defined(LOG_ENABLED) && !defined(DEBUG_bird) && !defined(DEBUG_misha)
     SUPR0Printf("VMXR0EnableCpu cpu %d page (%x) %x\n", pCpu->idCpu, pvPageCpu, (uint32_t)pPageCpuPhys);
 #endif
@@ -158,5 +158,5 @@
     ASMSetCR4(ASMGetCR4() & ~X86_CR4_VMXE);
 
-#if defined(LOG_ENABLED) && !defined(DEBUG_bird)
+#if defined(LOG_ENABLED) && !defined(DEBUG_bird) && !defined(DEBUG_misha)
     SUPR0Printf("VMXR0DisableCpu cpu %d\n", pCpu->idCpu);
 #endif
