- Timestamp:
- Aug 28, 2015 10:53:56 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp
r56592 r57576 17 17 18 18 //#define VBOXNETLWF_SYNC_SEND 19 #define VBOXNETLWF_NO_BYPASS20 19 21 20 #include <VBox/version.h> … … 100 99 //FILTER_CANCEL_OID_REQUEST vboxNetLwfWinCancelOidRequest; 101 100 FILTER_STATUS vboxNetLwfWinStatus; 102 FILTER_SET_MODULE_OPTIONS vboxNetLwfWinSetModuleOptions;103 101 //FILTER_NET_PNP_EVENT vboxNetLwfWinPnPEvent; 104 102 FILTER_SEND_NET_BUFFER_LISTS vboxNetLwfWinSendNetBufferLists; … … 1427 1425 LogFlow(("==>vboxNetLwfWinSendNetBufferLists: module=%p\n", hModuleCtx)); 1428 1426 PVBOXNETLWF_MODULE pModule = (PVBOXNETLWF_MODULE)hModuleCtx; 1429 #ifdef VBOXNETLWF_NO_BYPASS 1427 1430 1428 if (!ASMAtomicReadBool(&pModule->fActive)) 1431 1429 { … … 1437 1435 return; 1438 1436 } 1439 #endif 1437 1440 1438 if (vboxNetLwfWinIsRunning(pModule)) 1441 1439 { … … 1562 1560 LogFlow(("==>vboxNetLwfWinReceiveNetBufferLists: module=%p\n", hModuleCtx)); 1563 1561 PVBOXNETLWF_MODULE pModule = (PVBOXNETLWF_MODULE)hModuleCtx; 1564 #ifdef VBOXNETLWF_NO_BYPASS 1562 1565 1563 if (!ASMAtomicReadBool(&pModule->fActive)) 1566 1564 { … … 1573 1571 return; 1574 1572 } 1575 #endif 1573 1576 1574 if (vboxNetLwfWinIsRunning(pModule)) 1577 1575 { … … 1719 1717 } 1720 1718 1721 NDIS_STATUS vboxNetLwfWinSetModuleOptions(IN NDIS_HANDLE hModuleCtx)1722 {1723 LogFlow(("==>vboxNetLwfWinSetModuleOptions: module=%p\n", hModuleCtx));1724 PVBOXNETLWF_MODULE pModuleCtx = (PVBOXNETLWF_MODULE)hModuleCtx;1725 NDIS_FILTER_PARTIAL_CHARACTERISTICS PChars;1726 1727 NdisZeroMemory(&PChars, sizeof(PChars));1728 1729 PChars.Header.Type = NDIS_OBJECT_TYPE_FILTER_PARTIAL_CHARACTERISTICS;1730 PChars.Header.Size = NDIS_SIZEOF_FILTER_PARTIAL_CHARACTERISTICS_REVISION_1;1731 PChars.Header.Revision = NDIS_FILTER_PARTIAL_CHARACTERISTICS_REVISION_1;1732 1733 #ifndef VBOXNETLWF_NO_BYPASS1734 if (ASMAtomicReadBool(&pModuleCtx->fActive))1735 #endif1736 {1737 Log(("vboxNetLwfWinSetModuleOptions: active mode\n"));1738 PChars.SendNetBufferListsHandler = vboxNetLwfWinSendNetBufferLists;1739 PChars.SendNetBufferListsCompleteHandler = vboxNetLwfWinSendNetBufferListsComplete;1740 PChars.ReceiveNetBufferListsHandler = vboxNetLwfWinReceiveNetBufferLists;1741 PChars.ReturnNetBufferListsHandler = vboxNetLwfWinReturnNetBufferLists;1742 }1743 #ifndef VBOXNETLWF_NO_BYPASS1744 else1745 {1746 Log(("vboxNetLwfWinSetModuleOptions: bypass mode\n"));1747 }1748 #endif1749 NDIS_STATUS Status = NdisSetOptionalHandlers(pModuleCtx->hFilter,1750 (PNDIS_DRIVER_OPTIONAL_HANDLERS)&PChars);1751 LogFlow(("<==vboxNetLwfWinSetModuleOptions: status=0x%x\n", Status));1752 return Status;1753 }1754 1755 1719 /** 1756 1720 * register the filter driver … … 1792 1756 FChars.StatusHandler = vboxNetLwfWinStatus; 1793 1757 //FChars.NetPnPEventHandler = vboxNetLwfWinPnPEvent; 1794 FChars.SetFilterModuleOptionsHandler = vboxNetLwfWinSetModuleOptions; 1795 1796 /* Optional functions */ 1758 1759 /* Datapath functions */ 1797 1760 FChars.SendNetBufferListsHandler = vboxNetLwfWinSendNetBufferLists; 1798 1761 FChars.SendNetBufferListsCompleteHandler = vboxNetLwfWinSendNetBufferListsComplete; … … 2163 2126 if (fOldActive != fActive) 2164 2127 { 2165 /// @todo Shouldn't we wait for traffic to cease here? Probably not.2166 /* Schedule restart to enable/disable bypass mode */2167 NdisFRestartFilter(pModuleCtx->hFilter);2168 2128 Status = vboxNetLwfWinSetPacketFilter(pModuleCtx, fActive); 2169 2129 LogFlow(("<==vboxNetFltPortOsSetActive: vboxNetLwfWinSetPacketFilter() returned 0x%x\n", Status));
Note:
See TracChangeset
for help on using the changeset viewer.