VirtualBox

Ignore:
Timestamp:
Aug 26, 2009 9:44:20 PM (15 years ago)
Author:
vboxsync
Message:

netadp/win: actual inf deletion with NetAdpUninstall, (not yet added to win installer)

Location:
trunk/src/VBox/HostDrivers/VBoxNetFlt/win
Files:
2 edited

Legend:

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

    r22485 r22491  
    4444        if(hr == S_OK)
    4545        {
    46             hr = VBoxNetCfgWinUninstallInfs (&GUID_DEVCLASS_NET, L"sun_VBoxNetAdp");
     46            hr = VBoxNetCfgWinUninstallInfs (&GUID_DEVCLASS_NET, L"sun_VBoxNetAdp", 0/* could be SUOI_FORCEDELETE */);
    4747            if(hr == S_OK)
    4848            {
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/WinNetConfig.cpp

    r22485 r22491  
    8181#define VBOX_NETCFG_LOCK_TIME_OUT     5000
    8282
    83 typedef bool (*ENUMERATION_CALLBACK) (LPWSTR pFileName, PVOID pContext);
     83typedef bool (*ENUMERATION_CALLBACK) (LPCWSTR pFileName, PVOID pContext);
     84
     85typedef struct _INF_INFO
     86{
     87    LPCWSTR pPnPId;
     88}INF_INFO, *PINF_INFO;
     89
     90typedef struct _INFENUM_CONTEXT
     91{
     92    INF_INFO InfInfo;
     93    DWORD Flags;
     94    HRESULT hr;
     95} INFENUM_CONTEXT, *PINFENUM_CONTEXT;
     96
     97static bool vboxNetCfgWinInfEnumerationCallback(LPCWSTR pFileName, PVOID pCtxt);
    8498
    8599class VBoxNetCfgStringList
     
    398412}
    399413
    400 VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinUninstallInfs (const GUID * pGuid, LPCWSTR pPnPId)
     414VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinUninstallInfs (const GUID * pGuid, LPCWSTR pPnPId, DWORD Flags)
    401415{
    402416    VBoxNetCfgStringList list(128);
     
    404418    if(hr == S_OK)
    405419    {
     420        INFENUM_CONTEXT Context;
     421        Context.InfInfo.pPnPId = pPnPId;
     422        Context.Flags = Flags;
     423        Context.hr = S_OK;
    406424        int size = list.size();
    407425        for (int i = 0; i < size; ++i)
    408426        {
    409             Log(L"inf : %s\n", list.get(i));
     427            LPCWSTR pInf = list.get(i);
     428            const WCHAR* pRel = wcsrchr(pInf, '\\');
     429            if(pRel)
     430                ++pRel;
     431            else
     432                pRel = pInf;
     433
     434            vboxNetCfgWinInfEnumerationCallback(pRel, &Context);
     435//            Log(L"inf : %s\n", list.get(i));
    410436        }
    411437    }
     
    461487}
    462488
    463 typedef struct _INF_INFO
    464 {
    465     LPCWSTR pPnPId;
    466 }INF_INFO, *PINF_INFO;
    467 
    468 typedef struct _INFENUM_CONTEXT
    469 {
    470     INF_INFO InfInfo;
    471     DWORD Flags;
    472     HRESULT hr;
    473 } INFENUM_CONTEXT, *PINFENUM_CONTEXT;
    474 
    475 static bool vboxNetCfgWinInfEnumerationCallback(LPCWSTR pFileName, PINFENUM_CONTEXT pContext)
    476 {
     489static bool vboxNetCfgWinInfEnumerationCallback(LPCWSTR pFileName, PVOID pCtxt)
     490{
     491    PINFENUM_CONTEXT pContext = (PINFENUM_CONTEXT)pCtxt;
    477492//    Log(L"vboxNetCfgWinInfEnumerationCallback: pFileName (%s)\n", pFileName);
    478493
     
    525540        Context.Flags = Flags;
    526541        Context.hr = S_OK;
    527         hr = vboxNetCfgWinEnumFiles(InfDirPath, (ENUMERATION_CALLBACK)vboxNetCfgWinInfEnumerationCallback, (PVOID)&Context);
     542        hr = vboxNetCfgWinEnumFiles(InfDirPath, vboxNetCfgWinInfEnumerationCallback, &Context);
    528543        Assert(hr == S_OK);
    529544        if(hr == S_OK)
     
    16551670                        //
    16561671                        hr = S_FALSE;
    1657                         Log(L"vboxNetCfgWinRemoveAllNetDevicesOfIdCallback: !!!REBOOT REQUIRED!!!\n", winEr);
     1672                        Log(L"vboxNetCfgWinRemoveAllNetDevicesOfIdCallback: !!!REBOOT REQUIRED!!!\n");
    16581673                    }
    16591674                }
     
    23572372            {
    23582373                memset(DeviceInstallParams.DriverPath, 0, sizeof(DeviceInstallParams.DriverPath));
    2359                 int pathLenght = wcslen(pInfPath) + 1/* null terminator */;
     2374                size_t pathLenght = wcslen(pInfPath) + 1/* null terminator */;
    23602375                if(pathLenght < sizeof(DeviceInstallParams.DriverPath)/sizeof(DeviceInstallParams.DriverPath[0]))
    23612376                {
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