Changeset 23927 in vbox
- Timestamp:
- Oct 21, 2009 9:18:34 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53734
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk
r23526 r23927 51 51 VBoxNetFlt_SOURCES.win += win/VBoxNetFltMp-win.c 52 52 endif 53 #ifdef VBOX_LOOPBACK_USEFLAGS 54 VBoxNetFlt_DEFS.win += VBOX_LOOPBACK_USEFLAGS 55 #endif 53 56 VBoxNetFlt_SOURCES = VBoxNetFlt.c 54 57 VBoxNetFlt_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c
r22441 r23927 118 118 INIT_IDC_INFO g_InitIdcInfo; 119 119 120 #ifdef VBOX_LOOPBACK_USEFLAGS 120 121 UINT g_fPacketDontLoopBack; 121 122 UINT g_fPacketIsLoopedBack; 123 #endif 122 124 123 125 #define LIST_ENTRY_2_JOB(pListEntry) \ … … 522 524 if(bSrcHost) 523 525 { 524 #ifdef DEBUG_NETFLT_LOOPBACK 525 # error "implement (see comments in the sources below this #error:)" 526 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 527 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 528 similar to that used in TrasferData handling should be used; 529 */ 530 531 // SET_PACKET_TO_INFO(pInfo, pMyPacket); 532 // /* we are not using flags here, so they are not valid here */ 533 // /* SET_FLAGS_TO_INFO(pInfo, 0); */ 534 // LogFlow(("sending packet (%p)\n", pMyPacket)); 535 // vboxNetFltWinDoSendViaInfo(&fStatus, pAdapt, pInfo); 536 // LogFlow(("done sending packet (%p), status (%d)\n", pMyPacket, fStatus)); 537 #else 526 #if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS) 527 vboxNetFltWinLbPutSendPacket(pAdapt, pMyPacket, false /* bFromIntNet */); 528 #endif 538 529 NdisSend(&fStatus, pAdapt->hBindingHandle, pMyPacket); 539 #endif540 530 541 531 if (fStatus != NDIS_STATUS_PENDING) 542 532 { 533 #if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS) 543 534 /* the status is NOT pending, complete the packet */ 544 #ifdef DEBUG_NETFLT_LOOPBACK 545 # error "implement (see comments in the sources below this #error:)" 546 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 547 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 548 similar to that used in TrasferData handling should be used; 549 */ 550 551 // vboxNetFltWinDoCompleteSendViaInfo(pAdapt, pInfo); 535 bool bTmp = vboxNetFltWinLbRemoveSendPacket(pAdapt, pMyPacket); 536 Assert(bTmp); 552 537 #endif 553 538 if(pPacket) … … 572 557 else 573 558 { 574 #ifdef DEBUG_NETFLT_LOOPBACK575 # error "implement (see comments in the sources below this #error:)"576 /* @todo FIXME no need for the PPACKET_INFO mechanism here;577 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \578 similar to that used in TrasferData handling should be used;579 */580 581 // SET_PACKET_TO_INFO(pInfo, pMyPacket);582 // /* we are not using flags here, so they are not valid here */583 // /* SET_FLAGS_TO_INFO(pInfo, 0); */584 //585 // LogFlow(("indicating receive packet (%p)\n", pMyPacket));586 // vboxNetFltWinDoIndicateReceiveViaInfo(pAdapt, pInfo);587 // /* the packet return will be processed in the vboxNetFltWinMpReturnPacket call-back unless588 // * we specify NDIS_STATUS_RESOURCES as the packet status, which we are NOT doing currently */589 // LogFlow(("done indicating receive packet (%p)\n", pMyPacket));590 #else591 559 NdisMIndicateReceivePacket(pAdapt->hMiniportHandle, &pMyPacket, 1); 592 #endif593 560 594 561 fStatus = NDIS_STATUS_PENDING; … … 1798 1765 pSendRsvd->pOriginalPkt = NULL; 1799 1766 pSendRsvd->pBufToFree = pBufToFree; 1800 1767 #ifdef VBOX_LOOPBACK_USEFLAGS 1801 1768 /* set "don't loopback" flags */ 1802 1769 NdisSetPacketFlags(pPacket, g_fPacketDontLoopBack); 1770 #else 1771 NdisSetPacketFlags(pPacket, 0); 1772 #endif 1803 1773 } 1804 1774 #ifndef VBOX_NETFLT_ONDEMAND_BIND … … 1991 1961 do 1992 1962 { 1963 #ifdef VBOX_LOOPBACK_USEFLAGS 1993 1964 ULONG MjVersion; 1994 1965 ULONG MnVersion; 1966 #endif 1995 1967 1996 1968 #ifdef VBOX_NETFLT_ONDEMAND_BIND … … 2008 1980 break; 2009 1981 } 2010 1982 #ifdef VBOX_LOOPBACK_USEFLAGS 2011 1983 PsGetVersion(&MjVersion, &MnVersion, 2012 1984 NULL, /* PULONG BuildNumber OPTIONAL */ … … 2023 1995 2024 1996 g_fPacketIsLoopedBack = NDIS_FLAGS_IS_LOOPBACK_PACKET; 1997 #endif 2025 1998 2026 1999 #ifndef VBOX_NETFLT_ONDEMAND_BIND … … 2100 2073 vboxNetFltWinCopyPacketInfoOnSend(*ppMyPacket, pPacket); 2101 2074 2102 // if(bNetFltActive) 2103 // { 2104 NdisGetPacketFlags(*ppMyPacket) |= g_fPacketDontLoopBack; 2105 // } 2075 #ifdef VBOX_LOOPBACK_USEFLAGS 2076 NdisGetPacketFlags(*ppMyPacket) |= g_fPacketDontLoopBack; 2077 #endif 2106 2078 } 2107 2079 else … … 2330 2302 2331 2303 FINI_INTERLOCKED_SINGLE_LIST(&pAdapt->TransferDataList); 2332 #endif 2333 #ifdef DEBUG_NETFLT_LOOPBACK 2334 # error "add list cleaning code here" 2335 #endif 2336 2304 # if defined(DEBUG_NETFLT_LOOPBACK) || !defined(VBOX_LOOPBACK_USEFLAGS) 2305 FINI_INTERLOCKED_SINGLE_LIST(&pAdapt->SendPacketQueue); 2306 # endif 2307 #endif 2337 2308 2338 2309 #ifndef VBOX_NETFLT_ONDEMAND_BIND … … 2458 2429 2459 2430 INIT_INTERLOCKED_SINGLE_LIST(&pAdapt->TransferDataList); 2431 2432 # if defined(DEBUG_NETFLT_LOOPBACK) || !defined(VBOX_LOOPBACK_USEFLAGS) 2433 INIT_INTERLOCKED_SINGLE_LIST(&pAdapt->SendPacketQueue); 2434 # endif 2460 2435 #endif 2461 2436 /* TODO: do we need it here ?? */ 2462 2437 pAdapt->MPState.PowerState = NdisDeviceStateD3; 2463 2438 vboxNetFltWinSetOpState(&pAdapt->MPState, kVBoxNetDevOpState_Deinitialized); 2464 2465 #ifdef DEBUG_NETFLT_LOOPBACK2466 # error "add list initialization code here"2467 #endif2468 2439 2469 2440 #ifdef VBOX_NETFLT_ONDEMAND_BIND … … 2506 2477 #define MIN(_a, _b) ((_a) < (_b) ? (_a) : (_b)) 2507 2478 2508 #ifdef DEBUG_NETFLT_PACKETS 2509 2479 #ifndef VBOXNETADP 2480 2481 #ifdef DEBUG_misha 2482 2483 RTMAC g_vboxNetFltWinVerifyMACBroadcast = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 2484 RTMAC g_vboxNetFltWinVerifyMACGuest = {0x08, 0x00, 0x27, 0x01, 0x02, 0x03}; 2485 2486 DECLHIDDEN(PRTNETETHERHDR) vboxNetFltWinGetEthHdr(PNDIS_PACKET pPacket) 2487 { 2488 UINT cBufCount1; 2489 PNDIS_BUFFER pBuffer1; 2490 UINT uTotalPacketLength1; 2491 RTNETETHERHDR* pEth; 2492 UINT cbLength1 = 0; 2493 UINT i = 0; 2494 2495 NdisQueryPacket(pPacket, NULL, &cBufCount1, &pBuffer1, &uTotalPacketLength1); 2496 2497 Assert(pBuffer1); 2498 Assert(uTotalPacketLength1 >= ETH_HEADER_SIZE); 2499 if(uTotalPacketLength1 < ETH_HEADER_SIZE) 2500 return NULL; 2501 2502 NdisQueryBufferSafe(pBuffer1, &pEth, &cbLength1, NormalPagePriority); 2503 Assert(cbLength1 >= ETH_HEADER_SIZE); 2504 if(cbLength1 < ETH_HEADER_SIZE) 2505 return NULL; 2506 2507 return pEth; 2508 } 2509 2510 DECLHIDDEN(PRTNETETHERHDR) vboxNetFltWinGetEthHdrSG(PINTNETSG pSG) 2511 { 2512 Assert(pSG->cSegsUsed); 2513 Assert(pSG->cSegsAlloc >= pSG->cSegsUsed); 2514 Assert(pSG->aSegs[0].cb >= ETH_HEADER_SIZE); 2515 2516 if(!pSG->cSegsUsed) 2517 return NULL; 2518 2519 if(pSG->aSegs[0].cb < ETH_HEADER_SIZE) 2520 return NULL; 2521 2522 return (PRTNETETHERHDR)pSG->aSegs[0].pv; 2523 } 2524 2525 DECLHIDDEN(bool) vboxNetFltWinCheckMACs(PNDIS_PACKET pPacket, PRTMAC pDst, PRTMAC pSrc) 2526 { 2527 PRTNETETHERHDR pHdr = vboxNetFltWinGetEthHdr(pPacket); 2528 Assert(pHdr); 2529 2530 if(!pHdr) 2531 return false; 2532 2533 if(pDst && memcmp(pDst, &pHdr->DstMac, sizeof(RTMAC))) 2534 return false; 2535 2536 if(pSrc && memcmp(pSrc, &pHdr->SrcMac, sizeof(RTMAC))) 2537 return false; 2538 2539 return true; 2540 } 2541 2542 DECLHIDDEN(bool) vboxNetFltWinCheckMACsSG(PINTNETSG pSG, PRTMAC pDst, PRTMAC pSrc) 2543 { 2544 PRTNETETHERHDR pHdr = vboxNetFltWinGetEthHdrSG(pSG); 2545 Assert(pHdr); 2546 2547 if(!pHdr) 2548 return false; 2549 2550 if(pDst && memcmp(pDst, &pHdr->DstMac, sizeof(RTMAC))) 2551 return false; 2552 2553 if(pSrc && memcmp(pSrc, &pHdr->SrcMac, sizeof(RTMAC))) 2554 return false; 2555 2556 return true; 2557 } 2558 #endif 2559 2560 # if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS) 2510 2561 /* 2511 2562 * answers whether the two given packets match based on the packet length and the first cbMatch bytes of the packets … … 2517 2568 PNDIS_BUFFER pBuffer1; 2518 2569 UINT uTotalPacketLength1; 2519 PVOIDpMemBuf1;2570 uint8_t* pMemBuf1; 2520 2571 UINT cbLength1 = 0; 2521 2572 … … 2523 2574 PNDIS_BUFFER pBuffer2; 2524 2575 UINT uTotalPacketLength2; 2525 PVOIDpMemBuf2;2576 uint8_t* pMemBuf2; 2526 2577 UINT cbLength2 = 0; 2527 2578 bool bMatch = true; … … 2543 2594 else 2544 2595 { 2596 UINT ucbLength2Match = 0; 2545 2597 UINT ucbMatch; 2546 2598 if(cbMatch < 0 || (UINT)cbMatch > uTotalPacketLength1) … … 2557 2609 } 2558 2610 2559 do 2560 { 2561 UINT ucbLength2Match; 2611 for(;;) 2612 { 2562 2613 if(!cbLength1) 2563 2614 { … … 2565 2616 NdisGetNextBuffer(pBuffer1, &pBuffer1); 2566 2617 } 2618 else 2619 { 2620 Assert(pMemBuf1); 2621 Assert(ucbLength2Match); 2622 pMemBuf1 += ucbLength2Match; 2623 } 2567 2624 2568 2625 if(!cbLength2) … … 2571 2628 NdisGetNextBuffer(pBuffer2, &pBuffer2); 2572 2629 } 2630 else 2631 { 2632 Assert(pMemBuf2); 2633 Assert(ucbLength2Match); 2634 pMemBuf2 += ucbLength2Match; 2635 } 2573 2636 2574 2637 ucbLength2Match = MIN(ucbMatch, cbLength1); 2575 2638 ucbLength2Match = MIN(ucbMatch, cbLength2); 2576 2639 2577 if(memcmp( pMemBuf1,pMemBuf2, ucbLength2Match))2640 if(memcmp((PVOID*)pMemBuf1, (PVOID*)pMemBuf2, ucbLength2Match)) 2578 2641 { 2579 2642 bMatch = false; 2580 2643 break; 2581 2644 } 2645 2582 2646 ucbMatch -= ucbLength2Match; 2647 if(!ucbMatch) 2648 break; 2649 2583 2650 cbLength1 -= ucbLength2Match; 2584 2651 cbLength2 -= ucbLength2Match; 2585 } while (ucbMatch);2652 } 2586 2653 } 2587 2654 … … 2606 2673 PNDIS_BUFFER pBuffer1; 2607 2674 UINT uTotalPacketLength1; 2608 PVOIDpMemBuf1;2675 uint8_t* pMemBuf1; 2609 2676 UINT cbLength1 = 0; 2610 2677 UINT uTotalPacketLength2 = pSG->cbTotal; 2611 PVOIDpMemBuf2;2678 uint8_t* pMemBuf2; 2612 2679 UINT cbLength2 = 0; 2613 2680 bool bMatch = true; … … 2628 2695 else 2629 2696 { 2697 UINT ucbLength2Match = 0; 2630 2698 UINT ucbMatch; 2699 2631 2700 if(cbMatch < 0 || (UINT)cbMatch > uTotalPacketLength1) 2632 2701 { … … 2640 2709 } 2641 2710 2642 do 2643 { 2644 UINT ucbLength2Match; 2711 for(;;) 2712 { 2645 2713 if(!cbLength1) 2646 2714 { … … 2648 2716 NdisGetNextBuffer(pBuffer1, &pBuffer1); 2649 2717 } 2718 else 2719 { 2720 Assert(pMemBuf1); 2721 Assert(ucbLength2Match); 2722 pMemBuf1 += ucbLength2Match; 2723 } 2650 2724 2651 2725 if(!cbLength2) 2652 2726 { 2653 2727 Assert(i < pSG->cSegsUsed); 2654 pMemBuf2 = pSG->aSegs[i].pv;2728 pMemBuf2 = (uint8_t*)pSG->aSegs[i].pv; 2655 2729 cbLength2 = pSG->aSegs[i].cb; 2656 2730 i++; 2657 2731 } 2732 else 2733 { 2734 Assert(pMemBuf2); 2735 Assert(ucbLength2Match); 2736 pMemBuf2 += ucbLength2Match; 2737 } 2658 2738 2659 2739 ucbLength2Match = MIN(ucbMatch, cbLength1); 2660 2740 ucbLength2Match = MIN(ucbMatch, cbLength2); 2661 2741 2662 if(memcmp( pMemBuf1,pMemBuf2, ucbLength2Match))2742 if(memcmp((PVOID*)pMemBuf1, (PVOID*)pMemBuf2, ucbLength2Match)) 2663 2743 { 2664 2744 bMatch = false; … … 2666 2746 break; 2667 2747 } 2748 2668 2749 ucbMatch -= ucbLength2Match; 2750 if(!ucbMatch) 2751 break; 2752 2669 2753 cbLength1 -= ucbLength2Match; 2670 2754 cbLength2 -= ucbLength2Match; 2671 } while (ucbMatch);2755 } 2672 2756 } 2673 2757 … … 2680 2764 } 2681 2765 2766 # if 0 2682 2767 /* 2683 2768 * answers whether the two PINTNETSGs match based on the packet length and the first cbMatch bytes of the PINTNETSG … … 2763 2848 return bMatch; 2764 2849 } 2850 # endif 2851 # endif 2765 2852 #endif 2766 2853 … … 3339 3426 { 3340 3427 NDIS_STATUS fStatus; 3341 # ifdef DEBUG_NETFLT_LOOPBACK 3342 # error "implement (see comments in the sources below this #error:)" 3343 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 3344 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 3345 similar to that used in TrasferData handling should be used; 3346 */ 3347 3348 // PPACKET_INFO pInfo = vboxNetFltWinDoSend(&fStatus, pAdapt, pPacket); 3349 # else 3428 3429 #if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS) 3430 vboxNetFltWinLbPutSendPacket(pAdapt, pPacket, true /* bFromIntNet */); 3431 #endif 3350 3432 NdisSend(&fStatus, pAdapt->hBindingHandle, pPacket); 3351 # endif3352 3433 if (fStatus != NDIS_STATUS_PENDING) 3353 3434 { 3435 #if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS) 3436 /* the status is NOT pending, complete the packet */ 3437 bool bTmp = vboxNetFltWinLbRemoveSendPacket(pAdapt, pPacket); 3438 Assert(bTmp); 3439 #endif 3354 3440 if(!NT_SUCCESS(fStatus)) 3355 3441 { … … 3357 3443 rc = VERR_GENERAL_FAILURE; 3358 3444 } 3359 # ifdef DEBUG_NETFLT_LOOPBACK 3360 # error "implement (see comments in the sources below this #error:)" 3361 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 3362 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 3363 similar to that used in TrasferData handling should be used; 3364 */ 3365 3366 // if(pInfo) 3367 // { 3368 // /* TODO: FIXME: remove this assert */ 3369 // Assert(fStatus == NDIS_STATUS_SUCCESS); 3370 // 3371 // vboxNetFltWinDoCompleteSendViaInfo(pAdapt, pInfo); 3372 // vboxNetFltWinPpFreePacketInfo(pInfo); 3373 // } 3374 // else 3375 // { 3376 // Assert(0); 3377 // } 3378 # endif 3445 3379 3446 vboxNetFltWinFreeSGNdisPacket(pPacket, true); 3380 3447 } … … 3403 3470 if (pPacket) 3404 3471 { 3405 # ifndef DEBUG_NETFLT_LOOPBACK3406 3472 NdisMIndicateReceivePacket(pAdapt->hMiniportHandle, &pPacket, 1); 3407 # else 3408 # error "implement (see comments in the sources below this #error:)" 3409 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 3410 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 3411 similar to that used in TrasferData handling should be used; 3412 */ 3413 3414 // PPACKET_INFO pInfo = vboxNetFltWinDoIndicateReceive(pAdapt, pPacket); 3415 // if(!pInfo) 3416 // { 3417 // Assert(0); 3418 // vboxNetFltWinFreeSGNdisPacket(pPacket, true); 3419 // rc = VERR_NO_MEMORY; 3420 // } 3421 // else 3422 # endif 3423 { 3424 cRefs--; 3425 } 3473 cRefs--; 3426 3474 #ifdef VBOXNETADP 3427 3475 STATISTIC_INCREASE(pAdapt->cRxSuccess); … … 3459 3507 return false; 3460 3508 3461 bPromiscuous = (pAdapt->f OurSetFilter & NDIS_PACKET_TYPE_PROMISCUOUS) == NDIS_PACKET_TYPE_PROMISCUOUS;3509 bPromiscuous = (pAdapt->fUpperProtocolSetFilter & NDIS_PACKET_TYPE_PROMISCUOUS) == NDIS_PACKET_TYPE_PROMISCUOUS; 3462 3510 /*vboxNetFltWinIsPromiscuous(pAdapt);*/ 3463 3511 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.h
r22599 r23927 34 34 extern NDIS_SPIN_LOCK g_GlobalLock; 35 35 36 #ifdef VBOX_LOOPBACK_USEFLAGS 36 37 extern UINT g_fPacketDontLoopBack; 37 38 extern UINT g_fPacketIsLoopedBack; 39 #endif 38 40 39 41 /* … … 53 55 DECLHIDDEN(NTSTATUS) vboxNetFltWinPtDispatch(IN PDEVICE_OBJECT pDeviceObject, IN PIRP pIrp); 54 56 DECLHIDDEN(VOID) vboxNetFltWinUnload(IN PDRIVER_OBJECT DriverObject); 57 58 #ifndef VBOXNETADP 59 # if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS) 60 DECLHIDDEN(bool) vboxNetFltWinMatchPackets(PNDIS_PACKET pPacket1, PNDIS_PACKET pPacket2, const INT cbMatch); 61 DECLHIDDEN(bool) vboxNetFltWinMatchPacketAndSG(PNDIS_PACKET pPacket, PINTNETSG pSG, const INT cbMatch); 62 # endif 63 #endif 55 64 56 65 /************************* … … 62 71 ( (PPACKET_INFO)((uint8_t *)(pListEntry) - RT_OFFSETOF(PACKET_INFO, ListEntry)) ) 63 72 73 #if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS) 74 75 #define VBOX_SLE_2_SEND_RSVD(_pEntry) \ 76 ( (PSEND_RSVD)((uint8_t *)(_pEntry) - RT_OFFSETOF(SEND_RSVD, ListEntry)) ) 77 78 #define VBOX_SLE_2_SENDPACKET(_pEntry) \ 79 ( (PNDIS_PACKET)((uint8_t *)(VBOX_SLE_2_SEND_RSVD(_pEntry)) - RT_OFFSETOF(NDIS_PACKET, ProtocolReserved)) ) 80 81 #endif 64 82 /** 65 83 * enqueus the packet info to the tail of the queue … … 201 219 #endif 202 220 203 221 #ifndef VBOXNETADP 204 222 /** 205 223 * searches the list entry in a single-linked list … … 228 246 } 229 247 248 #if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS) 249 250 DECLINLINE(PNDIS_PACKET) vboxNetFltWinSearchPacket(PSINGLE_LIST pList, PNDIS_PACKET pPacket2Search, int cbMatch, bool bRemove) 251 { 252 PSINGLE_LIST_ENTRY pHead = &pList->Head; 253 PSINGLE_LIST_ENTRY pCur; 254 PSINGLE_LIST_ENTRY pPrev; 255 PNDIS_PACKET pCurPacket; 256 for(pCur = pHead->Next, pPrev = pHead; pCur; pPrev = pCur, pCur = pCur->Next) 257 { 258 pCurPacket = VBOX_SLE_2_SENDPACKET(pCur); 259 if(pCurPacket == pPacket2Search || vboxNetFltWinMatchPackets(pPacket2Search, pCurPacket, cbMatch)) 260 { 261 if(bRemove) 262 { 263 pPrev->Next = pCur->Next; 264 if(pCur == pList->pTail) 265 { 266 pList->pTail = pPrev; 267 } 268 } 269 return pCurPacket; 270 } 271 } 272 return NULL; 273 } 274 275 DECLINLINE(PNDIS_PACKET) vboxNetFltWinSearchPacketBySG(PSINGLE_LIST pList, PINTNETSG pSG, int cbMatch, bool bRemove) 276 { 277 PSINGLE_LIST_ENTRY pHead = &pList->Head; 278 PSINGLE_LIST_ENTRY pCur; 279 PSINGLE_LIST_ENTRY pPrev; 280 PNDIS_PACKET pCurPacket; 281 for(pCur = pHead->Next, pPrev = pHead; pCur; pPrev = pCur, pCur = pCur->Next) 282 { 283 pCurPacket = VBOX_SLE_2_SENDPACKET(pCur); 284 if(vboxNetFltWinMatchPacketAndSG(pCurPacket, pSG, cbMatch)) 285 { 286 if(bRemove) 287 { 288 pPrev->Next = pCur->Next; 289 if(pCur == pList->pTail) 290 { 291 pList->pTail = pPrev; 292 } 293 } 294 return pCurPacket; 295 } 296 } 297 return NULL; 298 } 299 300 #endif /* #if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS) */ 301 302 DECLINLINE(bool) vboxNetFltWinSListIsEmpty(PSINGLE_LIST pList) 303 { 304 return !pList->Head.Next; 305 } 306 230 307 DECLINLINE(void) vboxNetFltWinPutTail(PSINGLE_LIST pList, PSINGLE_LIST_ENTRY pEntry) 231 308 { … … 235 312 } 236 313 314 DECLINLINE(void) vboxNetFltWinPutHead(PSINGLE_LIST pList, PSINGLE_LIST_ENTRY pEntry) 315 { 316 pEntry->Next = pList->Head.Next; 317 pList->Head.Next = pEntry; 318 if(!pEntry->Next) 319 pList->pTail = pEntry; 320 } 321 237 322 DECLINLINE(PSINGLE_LIST_ENTRY) vboxNetFltWinGetHead(PSINGLE_LIST pList) 238 323 { … … 240 325 if(pEntry && pEntry == pList->pTail) 241 326 { 327 pList->Head.Next = NULL; 242 328 pList->pTail = &pList->Head; 243 329 } … … 254 340 } 255 341 342 #if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS) 343 344 DECLINLINE(PNDIS_PACKET) vboxNetFltWinInterlockedSearchPacket(PINTERLOCKED_SINGLE_LIST pList, PNDIS_PACKET pPacket2Search, int cbMatch, bool bRemove) 345 { 346 PNDIS_PACKET pFound; 347 NdisAcquireSpinLock(&pList->Lock); 348 pFound = vboxNetFltWinSearchPacket(&pList->List, pPacket2Search, cbMatch, bRemove); 349 NdisReleaseSpinLock(&pList->Lock); 350 return pFound; 351 } 352 353 DECLINLINE(PNDIS_PACKET) vboxNetFltWinInterlockedSearchPacketBySG(PINTERLOCKED_SINGLE_LIST pList, PINTNETSG pSG, int cbMatch, bool bRemove) 354 { 355 PNDIS_PACKET pFound; 356 NdisAcquireSpinLock(&pList->Lock); 357 pFound = vboxNetFltWinSearchPacketBySG(&pList->List, pSG, cbMatch, bRemove); 358 NdisReleaseSpinLock(&pList->Lock); 359 return pFound; 360 } 361 #endif /* #if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS) */ 362 256 363 DECLINLINE(void) vboxNetFltWinInterlockedPutTail(PINTERLOCKED_SINGLE_LIST pList, PSINGLE_LIST_ENTRY pEntry) 257 364 { 258 365 NdisAcquireSpinLock(&pList->Lock); 259 366 vboxNetFltWinPutTail(&pList->List, pEntry); 367 NdisReleaseSpinLock(&pList->Lock); 368 } 369 370 DECLINLINE(void) vboxNetFltWinInterlockedPutHead(PINTERLOCKED_SINGLE_LIST pList, PSINGLE_LIST_ENTRY pEntry) 371 { 372 NdisAcquireSpinLock(&pList->Lock); 373 vboxNetFltWinPutHead(&pList->List, pEntry); 260 374 NdisReleaseSpinLock(&pList->Lock); 261 375 } … … 270 384 } 271 385 386 # if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS) 387 DECLINLINE(void) vboxNetFltWinLbPutSendPacket(PADAPT pAdapt, PNDIS_PACKET pPacket, bool bFromIntNet) 388 { 389 PSEND_RSVD pSrv = (PSEND_RSVD)pPacket->ProtocolReserved; 390 pSrv->bFromIntNet = bFromIntNet; 391 vboxNetFltWinInterlockedPutHead(&pAdapt->SendPacketQueue, &pSrv->ListEntry); 392 } 393 394 DECLINLINE(bool) vboxNetFltWinLbIsFromIntNet(PNDIS_PACKET pPacket) 395 { 396 PSEND_RSVD pSrv = (PSEND_RSVD)pPacket->ProtocolReserved; 397 return pSrv->bFromIntNet; 398 } 399 400 DECLINLINE(PNDIS_PACKET) vboxNetFltWinLbSearchLoopBack(PADAPT pAdapt, PNDIS_PACKET pPacket, bool bRemove) 401 { 402 return vboxNetFltWinInterlockedSearchPacket(&pAdapt->SendPacketQueue, pPacket, VBOXNETFLT_PACKETMATCH_LENGTH, bRemove); 403 } 404 405 DECLINLINE(PNDIS_PACKET) vboxNetFltWinLbSearchLoopBackBySG(PADAPT pAdapt, PINTNETSG pSG, bool bRemove) 406 { 407 return vboxNetFltWinInterlockedSearchPacketBySG(&pAdapt->SendPacketQueue, pSG, VBOXNETFLT_PACKETMATCH_LENGTH, bRemove); 408 } 409 410 DECLINLINE(bool) vboxNetFltWinLbRemoveSendPacket(PADAPT pAdapt, PNDIS_PACKET pPacket) 411 { 412 PSEND_RSVD pSrv = (PSEND_RSVD)pPacket->ProtocolReserved; 413 return vboxNetFltWinInterlockedSearchListEntry(&pAdapt->SendPacketQueue, &pSrv->ListEntry, true); 414 } 415 416 # endif 417 418 #endif 419 420 #ifdef DEBUG_misha 421 DECLHIDDEN(bool) vboxNetFltWinCheckMACs(PNDIS_PACKET pPacket, PRTMAC pDst, PRTMAC pSrc); 422 DECLHIDDEN(bool) vboxNetFltWinCheckMACsSG(PINTNETSG pSG, PRTMAC pDst, PRTMAC pSrc); 423 extern RTMAC g_vboxNetFltWinVerifyMACBroadcast; 424 extern RTMAC g_vboxNetFltWinVerifyMACGuest; 425 426 # define VBOXNETFLT_LBVERIFY(_pnf, _p) \ 427 do { \ 428 Assert(!vboxNetFltWinCheckMACs(_p, NULL, &g_vboxNetFltWinVerifyMACGuest)); \ 429 Assert(!vboxNetFltWinCheckMACs(_p, NULL, &(_pnf)->u.s.Mac)); \ 430 } while(0) 431 432 # define VBOXNETFLT_LBVERIFYSG(_pnf, _p) \ 433 do { \ 434 Assert(!vboxNetFltWinCheckMACsSG(_p, NULL, &g_vboxNetFltWinVerifyMACGuest)); \ 435 Assert(!vboxNetFltWinCheckMACsSG(_p, NULL, &(_pnf)->u.s.Mac)); \ 436 } while(0) 437 438 #else 439 # define VBOXNETFLT_LBVERIFY(_pnf, _p) do{}while(0) 440 # define VBOXNETFLT_LBVERIFYSG(_pnf, _p) do{}while(0) 441 #endif 442 272 443 /** initializes the list */ 273 444 #define INIT_SINGLE_LIST(_pList) \ … … 279 450 /** initializes the list */ 280 451 #define INIT_INTERLOCKED_SINGLE_LIST(_pList) \ 281 { \452 do { \ 282 453 INIT_SINGLE_LIST(&(_pList)->List); \ 283 454 NdisAllocateSpinLock(&(_pList)->Lock); \ 284 } 455 } while(0) 285 456 286 457 /** delete the packet queue */ 287 #define FINI_INTERLOCKED_SINGLE_LIST(_pList) NdisFreeSpinLock(&(_pList)->Lock) 458 #define FINI_INTERLOCKED_SINGLE_LIST(_pList) \ 459 do { \ 460 Assert(vboxNetFltWinSListIsEmpty(&(_pList)->List)); \ 461 NdisFreeSpinLock(&(_pList)->Lock) \ 462 } while(0) 463 288 464 289 465 /** obtains the PTRANSFERDATA_RSVD given a single list entry it contains */ … … 778 954 779 955 DECLHIDDEN(void) vboxNetFltWinFreeSGNdisPacket(PNDIS_PACKET pPacket, bool bFreeMem); 780 781 #ifdef DEBUG_NETFLT_PACKETS782 DECLHIDDEN(bool) vboxNetFltWinMatchPacketAndSG(PNDIS_PACKET pPacket, PINTNETSG pSG, const INT cbMatch);783 784 DECLHIDDEN(bool) vboxNetFltWinMatchPackets(PNDIS_PACKET pPacket1, PNDIS_PACKET pPacket2, const INT cbMatch);785 786 #endif787 956 788 957 #ifdef DEBUG_NETFLT_PACKETS … … 822 991 * @return true if the packet is a looped back one, false otherwise 823 992 */ 824 #ifdef DEBUG_NETFLT_LOOPBACK 825 # error "implement (see comments in the sources below this #error:)" 826 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 827 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 828 similar to that used in TrasferData handling should be used; 829 */ 830 831 //#ifdef VBOX_NETFLT_ONDEMAND_BIND 832 //DECLHIDDEN(bool) vboxNetFltWinIsLoopedBackPacket(PADAPT pAdapt, PNDIS_PACKET pPacket); 833 //#else 834 //DECLHIDDEN(bool) vboxNetFltWinIsLoopedBackPacket(PADAPT pAdapt, PNDIS_PACKET pPacket, bool bOnRecv); 835 //#endif 836 // 837 //#ifdef VBOX_NETFLT_ONDEMAND_BIND 838 //DECLHIDDEN(bool) vboxNetFltWinIsLoopedBackPacketSG(PADAPT pAdapt, PINTNETSG pSG); 839 //#else 840 //DECLHIDDEN(bool) vboxNetFltWinIsLoopedBackPacketSG(PADAPT pAdapt, PINTNETSG pSG, bool bOnRecv); 841 //#endif 842 #else 993 #ifdef VBOX_LOOPBACK_USEFLAGS 843 994 DECLINLINE(bool) vboxNetFltWinIsLoopedBackPacket(PNDIS_PACKET pPacket) 844 995 { -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltCommon-win.h
r22599 r23927 153 153 #define VBOX_NETFLT_PACKET_HEADER_MATCH_SIZE 24 154 154 155 #if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS) 156 # define VBOXNETFLT_PACKETMATCH_LENGTH (ETH_HEADER_SIZE + 2) 157 #endif 158 155 159 #ifdef VBOXNETADP 156 160 #define VBOXNETADP_HEADER_SIZE 14 … … 316 320 /** miniport device state */ 317 321 ADAPT_DEVICE MPState; 318 #ifdef DEBUG_NETFLT_LOOPBACK319 # error "implement (see comments in the sources below this #error:)"320 /* @todo FIXME no need for the PPACKET_INFO mechanism here;321 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \322 similar to that used in TrasferData handling should be used;323 */324 /** Pending receive packet queue (i.e. packets that were indicated to the upperlying protocols, but not completed yet)*/325 // INTERLOCKED_PACKET_QUEUE RecvPacketQueue;326 #endif327 322 /** ndis packet pool used for receives */ 328 323 NDIS_HANDLE hRecvPacketPoolHandle; … … 389 384 390 385 #ifndef VBOXNETADP 386 #if defined(DEBUG_NETFLT_LOOPBACK) || !defined(VBOX_LOOPBACK_USEFLAGS) 387 /** used for maintaining the pending send packets for handling packet loopback */ 388 INTERLOCKED_SINGLE_LIST SendPacketQueue; 389 #endif 391 390 /** used for serializing calls to the NdisRequest in the vboxNetFltWinSynchNdisRequest */ 392 391 RTSEMFASTMUTEX hSynchRequestMutex; 393 394 392 /** event used to synchronize with the Ndis Request completion in the vboxNetFltWinSynchNdisRequest */ 395 393 KEVENT hSynchCompletionEvent; … … 398 396 /** pointer to the Ndis Request being executed by the vboxNetFltWinSynchNdisRequest */ 399 397 PNDIS_REQUEST volatile pSynchRequest; 400 #endif401 #ifdef DEBUG_NETFLT_LOOPBACK402 # error "implement (see comments in the sources below this #error:)"403 /* @todo FIXME no need for the PPACKET_INFO mechanism here;404 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \405 similar to that used in TrasferData handling should be used;406 */407 /** Pending send packet queue (i.e. packets that were sent to the underlying miniport, but not completed yet)*/408 409 INTERLOCKED_PACKET_QUEUE SendPacketQueue;410 /** Packet info pool, i.e. the pool for the packet queue elements */411 #endif412 #ifndef VBOXNETADP413 398 /** ndis packet pool used for sends */ 414 399 NDIS_HANDLE hSendPacketPoolHandle; … … 454 439 * can be null if the packet was originated by intnet */ 455 440 PNDIS_PACKET pOriginalPkt; 456 457 441 /** pointer to the buffer to be freed on send completion 458 442 * can be null if no buffer is to be freed */ 459 443 PVOID pBufToFree; 444 #if !defined(VBOX_LOOPBACK_USEFLAGS) || defined(DEBUG_NETFLT_PACKETS) 445 SINGLE_LIST_ENTRY ListEntry; 446 /* true if the packet is from IntNet */ 447 bool bFromIntNet; 448 #endif 460 449 } SEND_RSVD, *PSEND_RSVD; 461 450 … … 500 489 C_ASSERT(sizeof(UINT) == sizeof(uint32_t)); 501 490 491 #ifdef VBOX_LOOPBACK_USEFLAGS 502 492 #define NDIS_FLAGS_SKIP_LOOPBACK_W2K 0x400 493 #endif 503 494 504 495 #include "../VBoxNetFltInternal.h" -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltMp-win.c
r22441 r23927 456 456 if (fStatus == NDIS_STATUS_SUCCESS) 457 457 { 458 #ifdef DEBUG_NETFLT_LOOPBACK 459 # error "implement (see comments in the sources below this #error:)" 460 /* @todo FIXME no need the PPACKET_INFO mechanism here; 461 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 462 similar to that used in TrasferData handling should be used; 463 */ 464 // /* need to enqueue to enable callback discarding 465 // * since we now always discard all callbacks */ 466 // PPACKET_INFO pInfo = vboxNetFltWinDoSend(&fStatus, pAdapt, pMyPacket); 467 // 468 // Assert(pInfo); 469 #else 458 #if !defined(VBOX_LOOPBACK_USEFLAGS) /* || defined(DEBUG_NETFLT_PACKETS) */ 459 /* no need for the loop enqueue & check in a passthru mode , ndis will do everything for us */ 460 #endif 470 461 NdisSend(&fStatus, 471 462 pAdapt->hBindingHandle, 472 463 pMyPacket); 473 #endif474 464 if (fStatus != NDIS_STATUS_PENDING) 475 465 { 476 #ifdef DEBUG_NETFLT_LOOPBACK477 # error "implement (see comments in the sources below this #error:)"478 /* @todo FIXME no need for the PPACKET_INFO mechanism here;479 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \480 similar to that used in TrasferData handling should be used;481 */482 483 // vboxNetFltWinDoCompleteSendViaInfo(pAdapt, pInfo);484 // vboxNetFltWinPpFreePacketInfo(pInfo);485 #endif486 487 466 #ifndef WIN9X 488 467 NdisIMCopySendCompletePerPacketInfo (pPacket, pMyPacket); … … 842 821 pPacket = pPacketArray[i]; 843 822 844 #ifdef DEBUG_NETFLT_LOOPBACK 845 # error "implement (see comments in the sources below this #error:)" 846 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 847 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 848 similar to that used in TrasferData handling should be used; 849 */ 850 851 // if(vboxNetFltWinIsLoopedBackPacket(pAdapt, pPacket, false)) 823 if(!cNetFltRefs 824 || (fStatus = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, PACKET_SRC_HOST)) != NDIS_STATUS_SUCCESS) 825 { 826 #ifndef VBOXNETADP 827 fStatus = vboxNetFltWinSendPassThru(pAdapt, pPacket); 852 828 #else 853 if(vboxNetFltWinIsLoopedBackPacket(pPacket)) 829 if(!cNetFltRefs) 830 { 831 # ifdef VBOXNETADP_REPORT_DISCONNECTED 832 fStatus = NDIS_STATUS_MEDIA_DISCONNECT; 833 STATISTIC_INCREASE(pAdapt->cTxError); 834 # else 835 fStatus = NDIS_STATUS_SUCCESS; 836 # endif 837 } 854 838 #endif 855 839 856 { 857 /* we should not have loopbacks on send */ 858 Assert(0); 859 860 NdisMSendComplete(pAdapt->hMiniportHandle, 861 pPacket, 862 NDIS_STATUS_SUCCESS); 863 } 864 else 865 { 866 if(!cNetFltRefs 867 || (fStatus = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, PACKET_SRC_HOST)) != NDIS_STATUS_SUCCESS) 840 if (fStatus != NDIS_STATUS_PENDING) 868 841 { 869 #ifndef VBOXNETADP 870 fStatus = vboxNetFltWinSendPassThru(pAdapt, pPacket); 871 #else 872 if(!cNetFltRefs) 873 { 874 # ifdef VBOXNETADP_REPORT_DISCONNECTED 875 fStatus = NDIS_STATUS_MEDIA_DISCONNECT; 876 STATISTIC_INCREASE(pAdapt->cTxError); 877 # else 878 fStatus = NDIS_STATUS_SUCCESS; 879 # endif 880 } 881 #endif 882 883 if (fStatus != NDIS_STATUS_PENDING) 884 { 885 NdisMSendComplete(pAdapt->hMiniportHandle, 842 NdisMSendComplete(pAdapt->hMiniportHandle, 886 843 pPacket, 887 844 fStatus); 888 }889 else890 {891 cAdaptRefs--;892 }893 845 } 894 846 else 895 847 { 896 848 cAdaptRefs--; 897 cNetFltRefs--;898 849 } 850 } 851 else 852 { 853 cAdaptRefs--; 854 cNetFltRefs--; 899 855 } 900 856 } … … 2460 2416 PNDIS_PACKET MyPacket; 2461 2417 PRECV_RSVD RecvRsvd; 2462 #ifdef DEBUG_NETFLT_LOOPBACK 2463 # error "implement (see comments in the sources below this #error:)" 2464 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 2465 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 2466 similar to that used in TrasferData handling should be used; 2467 */ 2468 2469 // PPACKET_INFO pInfo = vboxNetFltWinDoCompleteIndicateReceive(pAdapt, Packet); 2470 // 2471 // if(pInfo) 2472 // { 2473 // vboxNetFltWinPpFreePacketInfo(pInfo); 2474 // } 2475 #endif 2418 2476 2419 RecvRsvd = (PRECV_RSVD)(Packet->MiniportReserved); 2477 2420 MyPacket = RecvRsvd->pOriginalPkt; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltPt-win.c
r22599 r23927 552 552 /* save mac options for adaptor below us to use it with the NdisCopyLookaheadData when our ProtocolReceive is called */ 553 553 pAdapt->fMacOptions = *(PULONG)NdisRequest->DATA.QUERY_INFORMATION.InformationBuffer; 554 554 #ifndef VBOX_LOOPBACK_USEFLAGS 555 /* 556 * Remove the no-loopback bit from mac-options. In essence we are 557 * telling NDIS that we can handle loopback. We don't, but the 558 * interface below us does. If we do not do this, then loopback 559 * processing happens both below us and above us. This is wasteful 560 * at best and if Netmon is running, it will see multiple copies 561 * of loopback packets when sniffing above us. 562 * 563 * Only the lowest miniport is a stack of layered miniports should 564 * ever report this bit set to NDIS. 565 */ 566 *(PULONG)NdisRequest->DATA.QUERY_INFORMATION.InformationBuffer &= ~NDIS_MAC_OPTION_NO_LOOPBACK; 567 #else 555 568 /* we have to catch loopbacks from the underlying driver, so no duplications will occur, 556 569 * just indicate NDIS to handle loopbacks for the packets coming from the protocol */ 557 570 *(PULONG)NdisRequest->DATA.QUERY_INFORMATION.InformationBuffer |= NDIS_MAC_OPTION_NO_LOOPBACK; 571 #endif 558 572 } 559 573 if(Oid == OID_GEN_CURRENT_PACKET_FILTER && VBOXNETFLT_PROMISCUOUS_SUPPORTED(pAdapt)) … … 737 751 { 738 752 PSEND_RSVD SendRsvd; 739 #ifdef DEBUG_NETFLT_LOOPBACK 740 # error "implement (see comments in the sources below this #error:)" 741 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 742 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 743 similar to that used in TrasferData handling should be used; 744 */ 745 746 // PPACKET_INFO pInfo = vboxNetFltWinDoCompleteSend(pAdapt, Packet); 747 // 748 // if(pInfo) 749 // { 750 // vboxNetFltWinPpFreePacketInfo(pInfo); 751 // } 753 754 #if defined(DEBUG_NETFLT_PACKETS) || !defined(VBOX_LOOPBACK_USEFLAGS) 755 /* @todo: for optimization we could check only for netflt-mode packets 756 * do it for all for now */ 757 vboxNetFltWinLbRemoveSendPacket(pAdapt, Packet); 752 758 #endif 753 759 // Assert(KeGetCurrentIrql() == DISPATCH_LEVEL); … … 813 819 vboxNetFltWinInterlockedPutTail(pList, &pTDR->ListEntry); 814 820 } 815 816 #endif817 818 static bool vboxNetFltWinPtTransferDataCompleteActive(IN PADAPT pAdapt,819 IN PNDIS_PACKET pPacket,820 IN NDIS_STATUS Status)821 {822 PVBOXNETFLTINS pNetFltIf = PADAPT_2_PVBOXNETFLTINS(pAdapt);823 PNDIS_BUFFER pBuffer;824 PTRANSFERDATA_RSVD pTDR;825 826 if(!vboxNetFltWinRemovePacketFromList(&pAdapt->TransferDataList, pPacket))827 return false;828 829 pTDR = &((PPT_RSVD)pPacket->ProtocolReserved)->u.TransferDataRsvd;830 Assert(pTDR);831 Assert(pTDR->pOriginalBuffer);832 833 do834 {835 NdisUnchainBufferAtFront(pPacket, &pBuffer);836 837 Assert(pBuffer);838 839 NdisFreeBuffer(pBuffer);840 841 pBuffer = pTDR->pOriginalBuffer;842 843 NdisChainBufferAtBack(pPacket, pBuffer);844 845 /* data transfer was initiated when the netFlt was active846 * the netFlt is still retained by us847 * 1. check if loopback848 * 2. enqueue packet849 * 3. release netFlt */850 851 if(Status == NDIS_STATUS_SUCCESS)852 {853 854 #ifdef DEBUG_NETFLT_LOOPBACK855 # error "implement (see comments in the sources below this #error:)"856 /* @todo FIXME no need for the PPACKET_INFO mechanism here;857 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \858 similar to that used in TrasferData handling should be used;859 */860 861 // /* 1. if loopback then quit with NDIS_STATUS_NOT_ACCEPTED */862 //#ifdef VBOX_NETFLT_ONDEMAND_BIND863 // if(vboxNetFltWinIsLoopedBackPacket(pAdapt, pPacket))864 //#else865 // if(vboxNetFltWinIsLoopedBackPacket(pAdapt, pPacket, true))866 //#endif867 #else868 if(vboxNetFltWinIsLoopedBackPacket(pPacket))869 #endif870 {871 Assert(0);872 }873 else874 {875 PRECV_RSVD pRecvRsvd;876 /* 2. enqueue */877 /* use the same packet info to put the packet in the processing packet queue */878 #ifdef VBOX_NETFLT_ONDEMAND_BIND879 PNDIS_BUFFER pBuffer;880 PVOID pVA;881 UINT cbLength;882 uint32_t fFlags;883 884 NdisQueryPacket(pPacket, NULL, NULL, &pBuffer, NULL);885 NdisQueryBufferSafe(pBuffer, &pVA, &cbLength, NormalPagePriority);886 887 fFlags = MACS_EQUAL(((PRTNETETHERHDR)pVA)->SrcMac, pNetFltIf->u.s.Mac) ?888 PACKET_MINE | PACKET_SRC_HOST : PACKET_MINE;889 SET_FLAGS_TO_INFO(pInfo, fFlags);890 891 pRecvRsvd = (PRECV_RSVD)(pPacket->MiniportReserved);892 pRecvRsvd->pOriginalPkt = NULL;893 pRecvRsvd->pBufToFree = NULL;894 895 NdisSetPacketFlags(pPacket, 0);896 897 Status = vboxNetFltWinQuEnqueuePacket(pNetFltIf, pPacket, fFlags);898 #else899 pRecvRsvd = (PRECV_RSVD)(pPacket->MiniportReserved);900 pRecvRsvd->pOriginalPkt = NULL;901 pRecvRsvd->pBufToFree = NULL;902 903 NdisSetPacketFlags(pPacket, 0);904 905 Status = vboxNetFltWinQuEnqueuePacket(pNetFltIf, pPacket, PACKET_MINE);906 #endif907 if(Status == NDIS_STATUS_SUCCESS)908 {909 break;910 }911 Assert(0);912 }913 }914 else915 {916 Assert(0);917 }918 /* we are here because of error either in data transfer or in enqueueing the packet */919 vboxNetFltWinFreeSGNdisPacket(pPacket, true);920 vboxNetFltWinDereferenceNetFlt(pNetFltIf);921 vboxNetFltWinDereferenceAdapt(pAdapt);922 } while(0);923 924 return true;925 }926 927 /**928 * Entry point called by NDIS to indicate completion of a call by us929 * to NdisTransferData.930 *931 * See notes under SendComplete.932 */933 static VOID934 vboxNetFltWinPtTransferDataComplete(935 IN NDIS_HANDLE ProtocolBindingContext,936 IN PNDIS_PACKET pPacket,937 IN NDIS_STATUS Status,938 IN UINT BytesTransferred939 )940 {941 PADAPT pAdapt =(PADAPT)ProtocolBindingContext;942 if(!vboxNetFltWinPtTransferDataCompleteActive(pAdapt, pPacket, Status))943 {944 #ifndef VBOX_NETFLT_ONDEMAND_BIND945 if(pAdapt->hMiniportHandle)946 {947 NdisMTransferDataComplete(pAdapt->hMiniportHandle,948 pPacket,949 Status,950 BytesTransferred);951 }952 953 vboxNetFltWinDereferenceAdapt(pAdapt);954 #else955 /* we are here because we've failed to allocate packet info */956 Assert(0);957 #endif958 }959 }960 #ifndef VBOX_NETFLT_ONDEMAND_BIND961 821 962 822 /** … … 1051 911 } 1052 912 913 #endif 914 915 static bool vboxNetFltWinPtTransferDataCompleteActive(IN PADAPT pAdapt, 916 IN PNDIS_PACKET pPacket, 917 IN NDIS_STATUS Status) 918 { 919 PVBOXNETFLTINS pNetFltIf = PADAPT_2_PVBOXNETFLTINS(pAdapt); 920 PNDIS_BUFFER pBuffer; 921 PTRANSFERDATA_RSVD pTDR; 922 923 if(!vboxNetFltWinRemovePacketFromList(&pAdapt->TransferDataList, pPacket)) 924 return false; 925 926 pTDR = &((PPT_RSVD)pPacket->ProtocolReserved)->u.TransferDataRsvd; 927 Assert(pTDR); 928 Assert(pTDR->pOriginalBuffer); 929 930 do 931 { 932 NdisUnchainBufferAtFront(pPacket, &pBuffer); 933 934 Assert(pBuffer); 935 936 NdisFreeBuffer(pBuffer); 937 938 pBuffer = pTDR->pOriginalBuffer; 939 940 NdisChainBufferAtBack(pPacket, pBuffer); 941 942 /* data transfer was initiated when the netFlt was active 943 * the netFlt is still retained by us 944 * 1. check if loopback 945 * 2. enqueue packet 946 * 3. release netFlt */ 947 948 if(Status == NDIS_STATUS_SUCCESS) 949 { 950 951 #ifdef VBOX_LOOPBACK_USEFLAGS 952 if(vboxNetFltWinIsLoopedBackPacket(pPacket)) 953 { 954 /* should not be here */ 955 Assert(0); 956 } 957 #else 958 PNDIS_PACKET pLb = vboxNetFltWinLbSearchLoopBack(pAdapt, pPacket, false); 959 if(pLb) 960 { 961 /* should not be here */ 962 Assert(0); 963 if(!vboxNetFltWinLbIsFromIntNet(pLb)) 964 { 965 /* the packet is not from int net, need to pass it up to the host */ 966 vboxNetFltWinPtQueueReceivedPacket(pAdapt, pPacket, true); 967 /* dereference NetFlt, pAdapt will be dereferenced on Packet return */ 968 vboxNetFltWinDereferenceNetFlt(pNetFltIf); 969 break; 970 } 971 } 972 #endif 973 else 974 { 975 PRECV_RSVD pRecvRsvd; 976 /* 2. enqueue */ 977 /* use the same packet info to put the packet in the processing packet queue */ 978 #ifdef VBOX_NETFLT_ONDEMAND_BIND 979 PNDIS_BUFFER pBuffer; 980 PVOID pVA; 981 UINT cbLength; 982 uint32_t fFlags; 983 984 NdisQueryPacket(pPacket, NULL, NULL, &pBuffer, NULL); 985 NdisQueryBufferSafe(pBuffer, &pVA, &cbLength, NormalPagePriority); 986 987 fFlags = MACS_EQUAL(((PRTNETETHERHDR)pVA)->SrcMac, pNetFltIf->u.s.Mac) ? 988 PACKET_MINE | PACKET_SRC_HOST : PACKET_MINE; 989 SET_FLAGS_TO_INFO(pInfo, fFlags); 990 991 pRecvRsvd = (PRECV_RSVD)(pPacket->MiniportReserved); 992 pRecvRsvd->pOriginalPkt = NULL; 993 pRecvRsvd->pBufToFree = NULL; 994 995 NdisSetPacketFlags(pPacket, 0); 996 997 Status = vboxNetFltWinQuEnqueuePacket(pNetFltIf, pPacket, fFlags); 998 #else 999 VBOXNETFLT_LBVERIFY(pNetFltIf, pPacket); 1000 1001 pRecvRsvd = (PRECV_RSVD)(pPacket->MiniportReserved); 1002 pRecvRsvd->pOriginalPkt = NULL; 1003 pRecvRsvd->pBufToFree = NULL; 1004 1005 NdisSetPacketFlags(pPacket, 0); 1006 1007 Status = vboxNetFltWinQuEnqueuePacket(pNetFltIf, pPacket, PACKET_MINE); 1008 #endif 1009 if(Status == NDIS_STATUS_SUCCESS) 1010 { 1011 break; 1012 } 1013 Assert(0); 1014 } 1015 } 1016 else 1017 { 1018 Assert(0); 1019 } 1020 /* we are here because of error either in data transfer or in enqueueing the packet */ 1021 vboxNetFltWinFreeSGNdisPacket(pPacket, true); 1022 vboxNetFltWinDereferenceNetFlt(pNetFltIf); 1023 vboxNetFltWinDereferenceAdapt(pAdapt); 1024 } while(0); 1025 1026 return true; 1027 } 1028 1029 /** 1030 * Entry point called by NDIS to indicate completion of a call by us 1031 * to NdisTransferData. 1032 * 1033 * See notes under SendComplete. 1034 */ 1035 static VOID 1036 vboxNetFltWinPtTransferDataComplete( 1037 IN NDIS_HANDLE ProtocolBindingContext, 1038 IN PNDIS_PACKET pPacket, 1039 IN NDIS_STATUS Status, 1040 IN UINT BytesTransferred 1041 ) 1042 { 1043 PADAPT pAdapt =(PADAPT)ProtocolBindingContext; 1044 if(!vboxNetFltWinPtTransferDataCompleteActive(pAdapt, pPacket, Status)) 1045 { 1046 #ifndef VBOX_NETFLT_ONDEMAND_BIND 1047 if(pAdapt->hMiniportHandle) 1048 { 1049 NdisMTransferDataComplete(pAdapt->hMiniportHandle, 1050 pPacket, 1051 Status, 1052 BytesTransferred); 1053 } 1054 1055 vboxNetFltWinDereferenceAdapt(pAdapt); 1056 #else 1057 /* we are here because we've failed to allocate packet info */ 1058 Assert(0); 1059 #endif 1060 } 1061 } 1062 #ifndef VBOX_NETFLT_ONDEMAND_BIND 1053 1063 /** 1054 1064 * This routine process the queued the packet, if anything is fine, indicate the packet … … 1293 1303 1294 1304 #ifndef DEBUG_NETFLT_RECV_TRANSFERDATA 1295 /* can check for loopback? check it*/1296 1305 if (cbPacket == cbLookaheadBuffer) 1297 1306 { … … 1299 1308 PINTNETSG pSG; 1300 1309 PUCHAR pRcvData; 1301 1302 #ifdef DEBUG_NETFLT_LOOPBACK 1303 /* TODO: can we check for loopback here ? 1304 * for now just get the complete SG and then decide if it is a loopback one */ 1305 /* if loopback then quit */ 1306 #endif 1307 /* allocate SG buffer */ 1308 Status = vboxNetFltWinAllocSG(cbPacket + cbHeaderBuffer, &pSG); 1309 if(Status != NDIS_STATUS_SUCCESS) 1310 { 1311 Assert(0); 1312 break; 1313 } 1314 1315 pRcvData = (PUCHAR)pSG->aSegs[0].pv; 1316 1317 NdisMoveMappedMemory(pRcvData, pHeaderBuffer, cbHeaderBuffer); 1318 1319 NdisCopyLookaheadData(pRcvData+cbHeaderBuffer, 1310 #ifndef VBOX_LOOPBACK_USEFLAGS 1311 PNDIS_PACKET pLb; 1312 #endif 1313 1314 /* allocate SG buffer */ 1315 Status = vboxNetFltWinAllocSG(cbPacket + cbHeaderBuffer, &pSG); 1316 if(Status != NDIS_STATUS_SUCCESS) 1317 { 1318 Assert(0); 1319 break; 1320 } 1321 1322 pRcvData = (PUCHAR)pSG->aSegs[0].pv; 1323 1324 NdisMoveMappedMemory(pRcvData, pHeaderBuffer, cbHeaderBuffer); 1325 1326 NdisCopyLookaheadData(pRcvData+cbHeaderBuffer, 1320 1327 pLookaheadBuffer, 1321 1328 cbLookaheadBuffer, 1322 1329 pAdapt->fMacOptions); 1323 #ifdef DEBUG_NETFLT_LOOPBACK 1324 # error "implement (see comments in the sources below this #error:)" 1325 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 1326 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 1327 similar to that used in TrasferData handling should be used; 1328 */ 1329 1330 // /* check if it is a loopback */ 1331 //# ifdef VBOX_NETFLT_ONDEMAND_BIND 1332 // if(vboxNetFltWinIsLoopedBackPacketSG(pAdapt, pSG)) 1333 //# else 1334 // if(vboxNetFltWinIsLoopedBackPacketSG(pAdapt, pSG, true)) 1335 //# endif 1336 // { 1337 // Assert(0); 1338 // vboxNetFltWinMemFree(pSG); 1339 // Status = NDIS_STATUS_NOT_ACCEPTED; 1340 // break; 1341 // } 1342 #endif 1330 #ifndef VBOX_LOOPBACK_USEFLAGS 1331 pLb = vboxNetFltWinLbSearchLoopBackBySG(pAdapt, pSG, false); 1332 if(pLb) 1333 { 1334 /* should not be here */ 1335 Assert(0); 1336 1337 if(!vboxNetFltWinLbIsFromIntNet(pLb)) 1338 { 1339 PNDIS_PACKET pMyPacket; 1340 pMyPacket = vboxNetFltWinNdisPacketFromSG(pAdapt, /* PADAPT */ 1341 pSG, /* PINTNETSG */ 1342 pSG, /* PVOID pBufToFree */ 1343 false, /* bool bToWire */ 1344 false); /* bool bCopyMemory */ 1345 if(pMyPacket) 1346 { 1347 vboxNetFltWinPtQueueReceivedPacket(pAdapt, pMyPacket, true); 1348 /* dereference the NetFlt here & indicate SUCCESS, which would mean the caller would not do a dereference 1349 * the pAdapt dereference will be done on packet return */ 1350 vboxNetFltWinDereferenceNetFlt(pNetFlt); 1351 Status = NDIS_STATUS_SUCCESS; 1352 } 1353 else 1354 { 1355 vboxNetFltWinMemFree(pSG); 1356 Status = NDIS_STATUS_FAILURE; 1357 } 1358 } 1359 else 1360 { 1361 vboxNetFltWinMemFree(pSG); 1362 Status = NDIS_STATUS_NOT_ACCEPTED; 1363 } 1364 break; 1365 } 1366 #endif 1367 VBOXNETFLT_LBVERIFYSG(pNetFlt, pSG); 1368 1343 1369 /* enqueue SG */ 1344 1370 #ifdef VBOX_NETFLT_ONDEMAND_BIND … … 1349 1375 } 1350 1376 #else 1351 1352 #endif 1353 1354 1355 1356 1357 1358 1377 Status = vboxNetFltWinQuEnqueuePacket(pNetFlt, pSG, PACKET_SG | PACKET_MINE); 1378 #endif 1379 if(Status != NDIS_STATUS_SUCCESS) 1380 { 1381 Assert(0); 1382 vboxNetFltWinMemFree(pSG); 1383 break; 1384 } 1359 1385 } 1360 1386 else … … 1366 1392 PUCHAR pMemBuf; 1367 1393 UINT cbBuf = cbPacket + cbHeaderBuffer; 1368 // PPACKET_INFO pInfo;1369 1394 UINT BytesTransferred; 1370 /* TODO: can check for loopback here ? */ 1371 /* for now just get the complete complete packet and then decide if it is a looped back one */ 1372 /* if loopback then quit with NDIS_STATUS_NOT_ACCEPTED 1373 * { 1374 * Status = NDIS_STATUS_NOT_ACCEPTED; 1375 * break; 1376 * } 1377 * */ 1378 1379 /* allocate NDIS Packet buffer */ 1395 1396 /* allocate NDIS Packet buffer */ 1380 1397 #ifdef VBOX_NETFLT_ONDEMAND_BIND 1381 1398 /* use the Send packet pool for packet allocation */ … … 1390 1407 } 1391 1408 1409 #ifdef VBOX_LOOPBACK_USEFLAGS 1392 1410 /* set "don't loopback" flags */ 1393 1411 NdisSetPacketFlags(pPacket, g_fPacketDontLoopBack); 1412 #endif 1394 1413 1395 1414 Status = vboxNetFltWinMemAlloc(&pMemBuf, cbBuf); … … 1603 1622 do 1604 1623 { 1605 #ifdef DEBUG_NETFLT_LOOPBACK 1606 # error "implement (see comments in the sources below this #error:)" 1607 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 1608 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 1609 similar to that used in TrasferData handling should be used; 1610 */ 1611 1612 // if(vboxNetFltWinIsLoopedBackPacket(pAdapt, pPacket, true)) 1613 #else 1624 #ifdef VBOX_LOOPBACK_USEFLAGS 1614 1625 if(vboxNetFltWinIsLoopedBackPacket(pPacket)) 1615 #endif1616 1617 1626 { 1618 1627 Assert(0); … … 1623 1632 } 1624 1633 1634 VBOXNETFLT_LBVERIFY(pNetFlt, pPacket); 1635 #else 1636 PNDIS_PACKET pLb = NULL; 1637 #endif 1625 1638 if(bNetFltActive) 1626 1639 { 1627 Status = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, PACKET_COPY); 1628 if(Status == NDIS_STATUS_SUCCESS) 1640 #ifndef VBOX_LOOPBACK_USEFLAGS 1641 pLb = vboxNetFltWinLbSearchLoopBack(pAdapt, pPacket, true /* ??? no need to keep it, so remove */); 1642 if(!pLb) 1643 #endif 1629 1644 { 1645 VBOXNETFLT_LBVERIFY(pNetFlt, pPacket); 1646 1647 Status = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, PACKET_COPY); 1648 Assert(Status == NDIS_STATUS_SUCCESS); 1649 if(Status == NDIS_STATUS_SUCCESS) 1650 { 1651 //NdisReturnPackets(&pPacket, 1); 1652 fAdaptActive = false; 1653 bNetFltActive = false; 1654 break; 1655 } 1656 } 1657 #ifndef VBOX_LOOPBACK_USEFLAGS 1658 else if(vboxNetFltWinLbIsFromIntNet(pLb)) 1659 { 1660 /* nothing else to do here, just return the packet */ 1630 1661 //NdisReturnPackets(&pPacket, 1); 1631 fAdaptActive = false; 1632 bNetFltActive = false; 1662 Status = NDIS_STATUS_NOT_ACCEPTED; 1633 1663 break; 1634 1664 } 1665 /* we are here because this is a looped back packet set not from intnet 1666 * we will post it to the upper protocol */ 1667 #endif 1635 1668 } 1636 1669 1670 #ifndef VBOX_LOOPBACK_USEFLAGS 1671 Assert(pLb && !vboxNetFltWinLbIsFromIntNet(pLb)); 1672 #endif 1637 1673 Status = vboxNetFltWinRecvPassThru(pAdapt, pPacket); 1638 1674 /* we are done with packet processing, and we will … … 1642 1678 } while(FALSE); 1643 1679 1644 if(Status == NDIS_STATUS_SUCCESS || Status == NDIS_STATUS_NOT_ACCEPTED) 1680 if(Status == NDIS_STATUS_SUCCESS || Status == NDIS_STATUS_NOT_ACCEPTED 1681 #ifndef VBOX_LOOPBACK_USEFLAGS 1682 || pLb 1683 #endif 1684 ) 1645 1685 { 1646 1686 break; 1647 1687 } 1648 1688 } 1649 #endif /* todo: remove */1689 #endif 1650 1690 if(bNetFltActive) 1651 1691 { … … 1661 1701 else 1662 1702 { 1703 #ifndef VBOX_LOOPBACK_USEFLAGS 1663 1704 /* this is a loopback packet, nothing to do here */ 1705 #else 1706 Assert(0); 1707 /* should not be here */ 1708 #endif 1664 1709 } 1665 1710 break; … … 1895 1940 do 1896 1941 { 1897 #ifdef DEBUG_NETFLT_LOOPBACK 1898 # error "implement (see comments in the sources below this #error:)" 1899 /* @todo FIXME no need for the PPACKET_INFO mechanism here; 1900 instead the the NDIS_PACKET.ProtocolReserved + INTERLOCKED_SINGLE_LIST mechanism \ 1901 similar to that used in TrasferData handling should be used; 1902 */ 1903 1904 // if(vboxNetFltWinIsLoopedBackPacket(pAdapt, pPacket, true)) 1905 #else 1942 #ifdef VBOX_LOOPBACK_USEFLAGS 1906 1943 if(vboxNetFltWinIsLoopedBackPacket(pPacket)) 1907 #endif1908 1909 1944 { 1910 1945 Assert(0); … … 1917 1952 } 1918 1953 1954 VBOXNETFLT_LBVERIFY(pNetFlt, pPacket); 1955 #endif 1956 1919 1957 if(bNetFltActive) 1920 1958 { 1921 bool bResources = NDIS_GET_PACKET_STATUS(pPacket) == NDIS_STATUS_RESOURCES; 1922 NDIS_STATUS fStatus; 1923 1924 /*TODO: remove this assert. 1925 * this is a temporary assert for debugging purposes: 1926 * we're probably doing something wrong with the packets if the miniport reports NDIS_STATUS_RESOURCES */ 1927 Assert(!bResources); 1928 1929 fStatus = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, bResources ? PACKET_COPY : 0); 1930 if(fStatus == NDIS_STATUS_SUCCESS) 1959 #ifndef VBOX_LOOPBACK_USEFLAGS 1960 PNDIS_PACKET pLb = vboxNetFltWinLbSearchLoopBack(pAdapt, pPacket, true /* ??? no need to keep it, so remove */); 1961 if(!pLb) 1962 #endif 1931 1963 { 1932 bNetFltActive = false; 1933 fAdaptActive = false; 1934 if(bResources) 1964 NDIS_STATUS fStatus; 1965 bool bResources = NDIS_GET_PACKET_STATUS(pPacket) == NDIS_STATUS_RESOURCES; 1966 1967 VBOXNETFLT_LBVERIFY(pNetFlt, pPacket); 1968 1969 /*TODO: remove this assert. 1970 * this is a temporary assert for debugging purposes: 1971 * we're probably doing something wrong with the packets if the miniport reports NDIS_STATUS_RESOURCES */ 1972 Assert(!bResources); 1973 1974 fStatus = vboxNetFltWinQuEnqueuePacket(pNetFlt, pPacket, bResources ? PACKET_COPY : 0); 1975 if(fStatus == NDIS_STATUS_SUCCESS) 1935 1976 { 1936 cRefCount = 0; 1937 //NdisReturnPackets(&pPacket, 1); 1977 bNetFltActive = false; 1978 fAdaptActive = false; 1979 if(bResources) 1980 { 1981 cRefCount = 0; 1982 //NdisReturnPackets(&pPacket, 1); 1983 } 1984 else 1985 { 1986 cRefCount = 1; 1987 } 1988 break; 1938 1989 } 1939 1990 else 1940 1991 { 1941 cRefCount = 1;1992 Assert(0); 1942 1993 } 1994 } 1995 #ifndef VBOX_LOOPBACK_USEFLAGS 1996 else if(vboxNetFltWinLbIsFromIntNet(pLb)) 1997 { 1998 /* the packet is from intnet, it has already been set to the host, 1999 * no need for loopng it back to the host again */ 2000 /* nothing else to do here, just return the packet */ 2001 cRefCount = 0; 2002 //NdisReturnPackets(&pPacket, 1); 1943 2003 break; 1944 2004 } 1945 else 1946 { 1947 Assert(0); 1948 } 2005 #endif 1949 2006 } 1950 2007 -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r23641 r23927 111 111 AssertReturn(pvPageCpu, VERR_INVALID_PARAMETER); 112 112 113 #if defined(LOG_ENABLED) && !defined(DEBUG_bird) 113 #if defined(LOG_ENABLED) && !defined(DEBUG_bird) && !defined(DEBUG_misha) 114 114 SUPR0Printf("VMXR0EnableCpu cpu %d page (%x) %x\n", pCpu->idCpu, pvPageCpu, (uint32_t)pPageCpuPhys); 115 115 #endif … … 158 158 ASMSetCR4(ASMGetCR4() & ~X86_CR4_VMXE); 159 159 160 #if defined(LOG_ENABLED) && !defined(DEBUG_bird) 160 #if defined(LOG_ENABLED) && !defined(DEBUG_bird) && !defined(DEBUG_misha) 161 161 SUPR0Printf("VMXR0DisableCpu cpu %d\n", pCpu->idCpu); 162 162 #endif
Note:
See TracChangeset
for help on using the changeset viewer.