VirtualBox

Changeset 53038 in vbox for trunk


Ignore:
Timestamp:
Oct 13, 2014 10:42:54 AM (10 years ago)
Author:
vboxsync
Message:

pr7489. Fixed RemoveHostOnlyInterfaces(). Function RemoveHostOnlyInterfaces() resumes deleting driver packages and inf files (not only devices) related to Host-only adapters again. UninstallNetAdp deletes Host-only driver packages(not devices) only. RemoveHostOnlyInterfaces is used during uninstallation, UninstallNetAdp is used during upgrade.

Location:
trunk/src/VBox
Files:
4 edited

Legend:

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

    r52824 r53038  
    548548        case VBOXNECTFGWINPROPCHANGE_TYPE_DISABLE:
    549549            PcParams.StateChange = DICS_DISABLE;
     550            NonStandardLogFlow(("vboxNetCfgWinPropChangeAllNetDevicesOfIdCallback: Change type (DICS_DISABLE): %d\n", pPc->enmPcType));
    550551            break;
    551552        case VBOXNECTFGWINPROPCHANGE_TYPE_ENABLE:
    552553            PcParams.StateChange = DICS_ENABLE;
     554            NonStandardLogFlow(("vboxNetCfgWinPropChangeAllNetDevicesOfIdCallback: Change type (DICS_ENABLE): %d\n", pPc->enmPcType));
    553555            break;
    554556        default:
     
    684686            if (cCurId >= cPnPId)
    685687            {
     688                NonStandardLogFlow(("!wcsnicmp(pCurId = (%S), pwszPnPId = (%S), cPnPId = (%d))", pCurId, pwszPnPId, cPnPId));
     689
    686690                pCurId += cCurId - cPnPId;
    687691                if (!wcsnicmp(pCurId, pwszPnPId, cPnPId))
     
    723727    Pc.enmPcType = enmPcType;
    724728    Pc.hr = S_OK;
     729    NonStandardLogFlow(("Calling VBoxNetCfgWinEnumNetDevices with lpszPnPId =(%S) and vboxNetCfgWinPropChangeAllNetDevicesOfIdCallback", lpszPnPId));
     730
    725731    HRESULT hr = VBoxNetCfgWinEnumNetDevices(lpszPnPId, vboxNetCfgWinPropChangeAllNetDevicesOfIdCallback, &Pc);
    726732    if (!SUCCEEDED(hr))
     
    20692075static HRESULT vboxNetCfgWinNetAdpUninstall(IN INetCfg *pNc, DWORD InfRmFlags)
    20702076{
    2071     INetCfgComponent *pNcc = NULL;
    2072     HRESULT hr = pNc->FindComponent(VBOXNETCFGWIN_NETADP_ID, &pNcc);
    2073     if (hr == S_OK)
    2074     {
    2075         NonStandardLog("NetAdp is installed currently, uninstalling ...\n");
    2076 
    2077         hr = VBoxNetCfgWinUninstallComponent(pNc, pNcc);
    2078         NonStandardLogFlow(("NetAdp component uninstallation ended with hr (0x%x)\n", hr));
    2079 
    2080         pNcc->Release();
    2081     }
    2082     else if (hr == S_FALSE)
    2083     {
    2084         NonStandardLog("NetAdp is not installed currently\n");
    2085     }
    2086     else
    2087     {
    2088         NonStandardLogFlow(("FindComponent failed, hr (0x%x)\n", hr));
    2089     }
     2077    HRESULT hr = S_OK;
     2078    NonStandardLog("Finding NetAdp driver package and trying to uninstall it ...\n");
    20902079
    20912080    VBoxDrvCfgInfUninstallAllF(L"Net", VBOXNETCFGWIN_NETADP_ID, InfRmFlags);
    2092 
     2081    NonStandardLog("NetAdp is not installed currently\n");
    20932082    return hr;
    20942083}
     
    20962085VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinNetAdpUninstall(IN INetCfg *pNc)
    20972086{
    2098     return vboxNetCfgWinNetAdpUninstall(pNc, 0);
     2087    return vboxNetCfgWinNetAdpUninstall(pNc, SUOI_FORCEDELETE);
    20992088}
    21002089
  • trunk/src/VBox/HostDrivers/win/cfg/VBoxDrvCfg.cpp

    r52241 r53038  
    352352    LPWSTR lpszPnPId;
    353353    HRESULT hr = vboxDrvCfgInfQueryModelsSectionName(hInf, &lpszModels, NULL);
     354    NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgInfQueryModelsSectionName returned lpszModels = (%S)", lpszModels));
    354355    if (hr != S_OK)
    355356    {
     
    367368    {
    368369        hr = vboxDrvCfgInfQueryKeyValue(&InfCtx, 2, &lpszPnPId, NULL);
     370        NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for models (%S) returned lpszPnPId (%S) \n", lpszModels, lpszPnPId));
     371
    369372        if (hr != S_OK)
    370373        {
     
    488491                                {
    489492                                    list.add(pDrvDetail->InfFileName);
     493                                    NonStandardLogRelCrap((__FUNCTION__": %S added to list", pDrvDetail->InfFileName));
    490494                                }
    491495                            }
     
    505509                    if (dwErr == ERROR_NO_MORE_ITEMS)
    506510                    {
     511                        NonStandardLogRelCrap((__FUNCTION__": dwErr == ERROR_NO_MORE_ITEMS -> search was finished "));
    507512                        break;
    508513                    }
     
    557562    VBoxDrvCfgStringList list(128);
    558563    HRESULT hr = vboxDrvCfgCollectInfsSetupDi(pGuidClass, lpszPnPId, list);
     564    NonStandardLogRelCrap((__FUNCTION__": vboxDrvCfgCollectInfsSetupDi returned %d devices with PnPId %S and class name %S", list.size(), lpszPnPId, lpszClassName));
    559565    if (hr == S_OK)
    560566    {
     
    575581
    576582            vboxDrvCfgInfEnumerationCallback(pRel, &Context);
    577 //            NonStandardLogRelCrap(("inf : %S\n", list.get(i)));
     583            NonStandardLogRelCrap((__FUNCTION__": inf = %S\n", list.get(i)));
    578584        }
    579585    }
     
    633639    PINFENUM_CONTEXT pContext = (PINFENUM_CONTEXT)pCtxt;
    634640    DWORD dwErr;
    635 //    NonStandardLogRelCrap(("vboxDrvCfgInfEnumerationCallback: pFileName (%S)\n", pFileName));
    636 
     641    NonStandardLogRelCrap((__FUNCTION__": lpszFileName (%S)\n", lpszFileName));
     642    NonStandardLogRelCrap((__FUNCTION__ ": pContext->InfInfo.lpszClassName = (%S)", pContext->InfInfo.lpszClassName));
    637643    HINF hInf = SetupOpenInfFileW(lpszFileName, pContext->InfInfo.lpszClassName, INF_STYLE_WIN4, NULL /*__in PUINT ErrorLine */);
    638644    if (hInf == INVALID_HANDLE_VALUE)
     
    644650            NonStandardLogCrap((__FUNCTION__ ": SetupOpenInfFileW err dwErr=%ld\n", dwErr));
    645651        }
    646 
     652        else
     653        {
     654            NonStandardLogCrap((__FUNCTION__ ": dwErr == ERROR_CLASS_MISMATCH"));
     655        }
    647656        return true;
    648657    }
     
    650659    LPWSTR lpszPnPId;
    651660    HRESULT hr = vboxDrvCfgInfQueryFirstPnPId(hInf, &lpszPnPId);
     661    NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgInfQueryFirstPnPId returned lpszPnPId = (%S)", lpszPnPId));
     662    NonStandardLogRelCrap((__FUNCTION__ ": pContext->InfInfo.lpszPnPId = (%S)", pContext->InfInfo.lpszPnPId));
    652663    if (hr == S_OK)
    653664    {
     
    694705        Context.Flags = Flags;
    695706        Context.hr = S_OK;
     707        NonStandardLogRelCrap((__FUNCTION__": Calling vboxDrvCfgEnumFiles(wszInfDirPath, vboxDrvCfgInfEnumerationCallback, &Context)"));
    696708        hr = vboxDrvCfgEnumFiles(wszInfDirPath, vboxDrvCfgInfEnumerationCallback, &Context);
    697709        NonStandardAssert(hr == S_OK);
  • trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp

    r52824 r53038  
    503503static MSIHANDLE g_hCurrentModule = NULL;
    504504
     505static VOID vboxDrvLoggerCallback(VBOXDRVCFG_LOG_SEVERITY enmSeverity, char * msg, void * pvContext)
     506{
     507    switch (enmSeverity)
     508    {
     509        case VBOXDRVCFG_LOG_SEVERITY_FLOW:
     510        case VBOXDRVCFG_LOG_SEVERITY_REGULAR:
     511            break;
     512        case VBOXDRVCFG_LOG_SEVERITY_REL:
     513            if (g_hCurrentModule)
     514                logString(g_hCurrentModule, (LPCSTR)msg);
     515            break;
     516        default:
     517            break;
     518    }
     519}
     520
    505521static VOID netCfgLoggerCallback(LPCSTR szString)
    506522{
     
    528544
    529545    VBoxNetCfgWinSetLogging((LOG_ROUTINE)netCfgLoggerCallback);
     546    /* uncomment next line if you want to add logging information from VBoxDrvCfg.cpp */
     547//    VBoxDrvCfgLoggerSet(vboxDrvLoggerCallback, NULL);
    530548}
    531549
     
    10831101    if (SUCCEEDED(hr))
    10841102    {
    1085         hr = VBoxDrvCfgInfUninstallAllSetupDi(&GUID_DEVCLASS_NET, pwszId, L"Net", 0/* could be SUOI_FORCEDELETE */);
     1103        hr = VBoxDrvCfgInfUninstallAllSetupDi(&GUID_DEVCLASS_NET, L"Net", pwszId, SUOI_FORCEDELETE/* could be SUOI_FORCEDELETE */);
    10861104        if (FAILED(hr))
    10871105        {
    10881106            logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstalled successfully, but failed to remove INF files");
    10891107        }
     1108        else
     1109            logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstalled successfully");
     1110
    10901111    }
    10911112    else
     
    11721193    if (SUCCEEDED(hr))
    11731194    {
    1174         hr = VBoxDrvCfgInfUninstallAllSetupDi(&GUID_DEVCLASS_NET, pwszId, L"Net", 0/* could be SUOI_FORCEDELETE */);
    1175         if (FAILED(hr))
    1176             logStringW(hModule, L"StopHostOnlyInterfaces: VBoxDrvCfgInfUninstallAllSetupDi failed, hr = 0x%x", hr);
     1195        logStringW(hModule, L"StopHostOnlyInterfaces: Disabling host interfaces was successful, hr = 0x%x", hr);
    11771196    }
    11781197    else
  • trunk/src/VBox/Installer/win/VBoxMergeNetAdpSeq.wxi

    r52824 r53038  
    3939    <!-- First stop the existing host-only interfaces on update ... -->
    4040    <Custom Action="ca_StopHostOnlyInterfaces" After="InstallInitialize" >
    41         <![CDATA[(UPGRADINGPRODUCTCODE) OR (REMOVE="ALL")]]>
     41        <![CDATA[(UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")]]>
    4242    </Custom>
     43
    4344    <Custom Action="ca_UninstallNetAdpArgs" Before="ca_UninstallNetAdp" >
    44         <![CDATA[(Installed) AND (REMOVE="ALL")]]>
     45        <![CDATA[(UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")]]>
    4546    </Custom>
    46     <Custom Action="ca_UninstallNetAdp" After="ca_RemoveHostOnlyInterfaces" >
    47         <![CDATA[(Installed) AND (REMOVE="ALL")]]>
     47    <Custom Action="ca_UninstallNetAdp" After="ca_StopHostOnlyInterfaces" >
     48        <![CDATA[(UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")]]>
    4849        </Custom>
    49    
     50
    5051<?endif ?>
    5152
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