VirtualBox

Changeset 55941 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
May 19, 2015 7:33:17 PM (10 years ago)
Author:
vboxsync
Message:

Network/HostOnly: Use driver enumeration instead of registry access for trunk type detection (#7849)

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r55437 r55941  
    834834    /** @} */
    835835
     836    void i_reportDriverVersions(void);
     837
    836838    bool mSavedStateDataLoaded : 1;
    837839
     
    990992    ComPtr<IEventListener> mVmListener;
    991993
     994#ifdef RT_OS_WINDOWS
     995    /** Use NDIS6 network drivers. */
     996    bool mfNDIS6;
     997#endif /* RT_OS_WINDOWS */
     998
    992999    friend struct VMTask;
    9931000};
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r55769 r55941  
    389389    , mfUseHostClipboard(true)
    390390    , mMachineState(MachineState_PoweredOff)
     391#ifdef RT_OS_WINDOWS
     392    , mfNDIS6(true)
     393#endif /* RT_OS_WINDOWS */
     394
    391395{
    392396}
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r55674 r55941  
    749749/**
    750750 * Report versions of installed drivers to release log.
     751 *
     752 * WARNING! This method has a side effect -- it modifies mfNDIS6.
    751753 */
    752 static void reportDriverVersions(void)
     754void Console::i_reportDriverVersions()
    753755{
    754756    DWORD   err;
     
    762764    DWORD   cbVerInfo     = 0;
    763765
     766    /* Assume NDIS6 */
     767    mfNDIS6 = true;
     768
    764769    do
    765770    {
     
    816821                if (_tcsnicmp(TEXT("vbox"), szDriver, 4))
    817822                    continue;
     823                if (_tcsnicmp(TEXT("vboxnetflt"), szDriver, 10) == 0)
     824                    mfNDIS6 = false;
    818825            }
    819826            else
     
    883890}
    884891#else /* !RT_OS_WINDOWS */
    885 static void reportDriverVersions(void)
     892void Console::i_reportDriverVersions(void)
    886893{
    887894}
     
    981988    hrc = systemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);        H();
    982989
    983     reportDriverVersions();
     990    i_reportDriverVersions();
    984991    /*
    985992     * Get root node first.
     
    53225329                CoTaskMemFree(pswzBindName);
    53235330
    5324                 /* Assume we should use the old NDIS5.1 version of driver which uses TRUNKTYPE_NETADP */
    5325                 trunkType = TRUNKTYPE_NETADP;
    5326 
    5327                 HKEY hkParams;
    5328                 hrc = pAdaptorComponent->OpenParamKey(&hkParams);
    5329                 Assert(hrc == S_OK);
    5330                 if (hrc == S_OK)
    5331                 {
    5332                     WCHAR swzInfSection[16];
    5333                     DWORD dwSize = sizeof(swzInfSection);
    5334                     hrc = RegQueryValueExW(hkParams, L"InfSection", NULL, NULL, (LPBYTE)swzInfSection, &dwSize);
    5335                     if (hrc == S_OK)
    5336                     {
    5337                         if (!_wcsnicmp(swzInfSection, L"VBoxNetAdp6.ndi", sizeof(L"VBoxNetAdp6.ndi")/2))
    5338                         {
    5339                             /*
    5340                              * This is NDIS 6.x miniport, it relies on NetLwf filter to
    5341                              * run actual traffic. We use netflt attachment instead of
    5342                              * netadp, which is used in case of NDIS 5.x.
    5343                              */
    5344                             trunkType = TRUNKTYPE_NETFLT;
    5345                         }
    5346                     }
    5347                     RegCloseKey(hkParams);
    5348                 }
    5349                 else
    5350                 {
    5351                     LogRel(("Console::i_configNetwork: INetCfgComponent::GetId(%s) failed, err (0x%x), "
    5352                             "falling back to NDIS5 attachment\n", pszTrunkName, hrc));
    5353                     /* Nothing to do here as the trunk type defaults to NETADP */
    5354                 }
     5331                /* The old NDIS5.1 version of driver uses TRUNKTYPE_NETADP */
     5332                trunkType = mfNDIS6 ? TRUNKTYPE_NETFLT : TRUNKTYPE_NETADP;
    53555333                InsertConfigInteger(pCfg, "TrunkType", trunkType == TRUNKTYPE_NETFLT ? kIntNetTrunkType_NetFlt : kIntNetTrunkType_NetAdp);
    53565334
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