VirtualBox

Changeset 53082 in vbox


Ignore:
Timestamp:
Oct 17, 2014 6:49:23 AM (10 years ago)
Author:
vboxsync
Message:

NetFlt/win: NDIS6: no halt on host suspend, hardware id changed to match the old NDIS5 id

Location:
trunk/src/VBox
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp

    r53038 r53082  
    24122412
    24132413#define DRIVERHWID _T("sun_VBoxNetAdp")
    2414 #define DRIVERHWID_NDIS6 _T("sun_VBoxNetAdp6")
    24152414
    24162415#define SetErrBreak(strAndArgs) \
     
    25692568                     t += _tcslen (t) + 1)
    25702569                {
    2571                     if (!_tcsicmp (DRIVERHWID, t) || !_tcsicmp (DRIVERHWID_NDIS6, t))
     2570                    if (!_tcsicmp (DRIVERHWID, t))
    25722571                    {
    25732572                          /* get the device instance ID */
     
    27892788                while (t && *t && t < (TCHAR *) &detailBuf [RT_ELEMENTS(detailBuf)])
    27902789                {
    2791                     if (!_tcsicmp(t, DRIVERHWID) || !_tcsicmp(t, DRIVERHWID_NDIS6))
     2790                    if (!_tcsicmp(t, DRIVERHWID))
    27922791                        break;
    27932792
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/ndis6/VBoxNetAdp-win.h

    r52630 r53082  
    3535#define VBOXNETADPWIN_TAG                    'ANBV'
    3636
    37 #define VBOXNETADPWIN_ATTR_FLAGS             NDIS_MINIPORT_ATTRIBUTES_NDIS_WDM
     37#define VBOXNETADPWIN_ATTR_FLAGS             NDIS_MINIPORT_ATTRIBUTES_NDIS_WDM | NDIS_MINIPORT_ATTRIBUTES_NO_HALT_ON_SUSPEND
    3838#define VBOXNETADP_MAC_OPTIONS               NDIS_MAC_OPTION_NO_LOOPBACK
    3939#define VBOXNETADP_SUPPORTED_FILTERS         (NDIS_PACKET_TYPE_DIRECTED | \
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/ndis6/VBoxNetAdp6.inf

    r52630 r53082  
    3232
    3333[VBox]
    34 %VBoxNetAdp6_Desc% = VBoxNetAdp6.ndi, sun_VBoxNetAdp6
     34%VBoxNetAdp6_Desc% = VBoxNetAdp6.ndi, sun_VBoxNetAdp
    3535
    3636[VBox.NTx86]
    37 %VBoxNetAdp6_Desc% = VBoxNetAdp6.ndi, sun_VBoxNetAdp6
     37%VBoxNetAdp6_Desc% = VBoxNetAdp6.ndi, sun_VBoxNetAdp
    3838
    3939[VBox.NTamd64]
    40 %VBoxNetAdp6_Desc% = VBoxNetAdp6.ndi, sun_VBoxNetAdp6
     40%VBoxNetAdp6_Desc% = VBoxNetAdp6.ndi, sun_VBoxNetAdp
    4141
    4242[VBoxNetAdp6.ndi]
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/nobj/VBoxNetFltNobj.cpp

    r52592 r53082  
    201201    if (hr == S_OK)
    202202    {
    203         if (!_wcsnicmp(pDevId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp")/2) ||
    204             !_wcsnicmp(pDevId, L"sun_VBoxNetAdp6", sizeof(L"sun_VBoxNetAdp6")/2))
     203        if (!_wcsnicmp(pDevId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp")/2))
    205204        {
    206205            *pbShouldBind = false;
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/tools/VBoxNetAdpInstall.cpp

    r52592 r53082  
    2222#include <devguid.h>
    2323
     24#define VBOX_NETADP_HWID L"sun_VBoxNetAdp"
    2425#ifdef NDIS60
    2526#define VBOX_NETADP_INF L"VBoxNetAdp6.inf"
    26 #define VBOX_NETADP_HWID L"sun_VBoxNetAdp6"
    2727#else /* !NDIS60 */
    2828#define VBOX_NETADP_INF L"VBoxNetAdp.inf"
    29 #define VBOX_NETADP_HWID L"sun_VBoxNetAdp"
    3029#endif /* !NDIS60 */
    3130
     
    141140    {
    142141        BOOL fRebootRequired = FALSE;
     142        /*
     143         * Before we can update the driver for existing adapters we need to remove
     144         * all old driver packages from the driver cache. Otherwise we may end up
     145         * with both NDIS5 and NDIS6 versions of VBoxNetAdp in the cache which
     146         * will cause all sorts of trouble.
     147         */
     148        VBoxDrvCfgInfUninstallAllF(L"Net", VBOX_NETADP_HWID, SUOI_FORCEDELETE);
    143149        hr = VBoxNetCfgWinUpdateHostOnlyNetworkInterface(VBOX_NETADP_INF, &fRebootRequired, VBOX_NETADP_HWID);
    144150        if (SUCCEEDED(hr))
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r53080 r53082  
    51785178                CoTaskMemFree(pswzBindName);
    51795179
    5180                 wchar_t * pswzHwId;
    5181                 hrc = pAdaptorComponent->GetId(&pswzHwId);
     5180                /* Assume we should use the old NDIS5.1 version of driver which uses TRUNKTYPE_NETADP */
     5181                trunkType = TRUNKTYPE_NETADP;
     5182
     5183                HKEY hkParams;
     5184                hrc = pAdaptorComponent->OpenParamKey(&hkParams);
    51825185                Assert(hrc == S_OK);
    51835186                if (hrc == S_OK)
    51845187                {
    5185                     if (!_wcsnicmp(pswzHwId, L"sun_VBoxNetAdp6", sizeof(L"sun_VBoxNetAdp6")/2))
     5188                    WCHAR swzInfSection[16];
     5189                    DWORD dwSize = sizeof(swzInfSection);
     5190                    hrc = RegQueryValueExW(hkParams, L"InfSection", NULL, NULL, (LPBYTE)swzInfSection, &dwSize);
     5191                    if (hrc == S_OK)
    51865192                    {
    5187                         /*
    5188                          * This is NDIS 6.x miniport, it relies on NetLwf filter to
    5189                          * run actual traffic. We use netflt attachment instead of
    5190                          * netadp, which is used in case of NDIS 5.x.
    5191                          */
    5192                         InsertConfigInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt);
    5193                         trunkType = TRUNKTYPE_NETFLT;
     5193                        if (!_wcsnicmp(swzInfSection, L"VBoxNetAdp6.ndi", sizeof(L"VBoxNetAdp6.ndi")/2))
     5194                        {
     5195                            /*
     5196                             * This is NDIS 6.x miniport, it relies on NetLwf filter to
     5197                             * run actual traffic. We use netflt attachment instead of
     5198                             * netadp, which is used in case of NDIS 5.x.
     5199                             */
     5200                            trunkType = TRUNKTYPE_NETFLT;
     5201                        }
    51945202                    }
    5195                     else
    5196                     {
    5197                         InsertConfigInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp);
    5198                         trunkType = TRUNKTYPE_NETADP;
    5199                     }
     5203                    RegCloseKey(hkParams);
    52005204                }
    52015205                else
     
    52035207                    LogRel(("Console::i_configNetwork: INetCfgComponent::GetId(%s) failed, err (0x%x), "
    52045208                            "falling back to NDIS5 attachment\n", pszTrunkName, hrc));
    5205                     InsertConfigInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp);
    5206                     trunkType = TRUNKTYPE_NETADP;
    5207                 }
    5208                 CoTaskMemFree(pswzHwId);
     5209                    /* Nothing to do here as the trunk type defaults to NETADP */
     5210                }
     5211                InsertConfigInteger(pCfg, "TrunkType", trunkType == TRUNKTYPE_NETFLT ? kIntNetTrunkType_NetFlt : kIntNetTrunkType_NetAdp);
    52095212
    52105213                pAdaptorComponent.setNull();
  • trunk/src/VBox/Main/src-server/win/NetIf-win.cpp

    r52592 r53082  
    15371537                                                        if (hr == S_OK)
    15381538                                                        {
    1539                                                             if (!_wcsnicmp(pId, L"sun_VBoxNetAdp6", sizeof(L"sun_VBoxNetAdp6")/2))
    1540                                                             {
    1541                                                                 vboxNetWinAddComponent(&list, pMpNcc, HostNetworkInterfaceType_HostOnly, -1);
    1542                                                             }
    1543                                                             else
     1539                                                            /*
     1540                                                             * Host-only interfaces are ignored here and included into the list
     1541                                                             * later in netIfListHostAdapters()
     1542                                                             */
     1543                                                            if (_wcsnicmp(pId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp")/2))
    15441544                                                            {
    15451545                                                                vboxNetWinAddComponent(&list, pMpNcc, HostNetworkInterfaceType_Bridged,
     
    15771577    }
    15781578
    1579     /*
    1580      * There are two places where host-only adapters get added to the list.
    1581      * The following call adds NDIS5 miniports while NDIS6 miniports are
    1582      * added in the loop above. This is because NDIS6 miniports are in fact
    1583      * used as bridged adapters, they have netlwf filter installed in their
    1584      * stack and as a result they show up during bridged adapter enumeration.
    1585      */
     1579    /* Add host-only adapters to the list */
    15861580    netIfListHostAdapters(list);
    15871581
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette