VirtualBox

Ignore:
Timestamp:
Jul 7, 2014 5:44:56 PM (10 years ago)
Author:
vboxsync
Message:

VBoxNetFlt/win: Unbreak VBoxNetFltUninstall - apparently the previous changes made VBoxNetCfgWinNetFltUninstall return S_FALSE when we're not installed. Dunno if it can return this in other cases. Undid some of the Id vs ID inconsistencies introduced by that same changeset - Id was used before and that's the preferred way of doing it.

File:
1 edited

Legend:

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

    r51871 r51908  
    593593
    594594typedef BOOL (*VBOXNETCFGWIN_NETENUM_CALLBACK) (HDEVINFO hDevInfo, PSP_DEVINFO_DATA pDev, PVOID pContext);
    595 VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnumNetDevices(LPCWSTR pwszPnPID,
     595VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnumNetDevices(LPCWSTR pwszPnPId,
    596596                                                        VBOXNETCFGWIN_NETENUM_CALLBACK callback, PVOID pContext)
    597597{
    598     NonStandardLogFlow(("VBoxNetCfgWinEnumNetDevices: Searching for: %S\n", pwszPnPID));
     598    NonStandardLogFlow(("VBoxNetCfgWinEnumNetDevices: Searching for: %S\n", pwszPnPId));
    599599
    600600    HRESULT hr;
     
    610610        DWORD winEr;
    611611
    612         DWORD dwDevID = 0;
    613         size_t cPnPId = wcslen(pwszPnPID);
     612        DWORD dwDevId = 0;
     613        size_t cPnPId = wcslen(pwszPnPId);
    614614
    615615        PBYTE pBuffer = NULL;
     
    621621            Dev.cbSize = sizeof(SP_DEVINFO_DATA);
    622622
    623             if (!SetupDiEnumDeviceInfo(hDevInfo, dwDevID, &Dev))
     623            if (!SetupDiEnumDeviceInfo(hDevInfo, dwDevId, &Dev))
    624624            {
    625625                winEr = GetLastError();
     
    629629            }
    630630
    631             NonStandardLogFlow(("VBoxNetCfgWinEnumNetDevices: Enumerating device %ld ... \n", dwDevID));
    632             dwDevID++;
     631            NonStandardLogFlow(("VBoxNetCfgWinEnumNetDevices: Enumerating device %ld ... \n", dwDevId));
     632            dwDevId++;
    633633
    634634            if (pBuffer)
     
    677677            }
    678678
    679             PWSTR pCurID = (PWSTR)pBuffer;
    680             size_t cCurId = wcslen(pCurID);
    681 
    682             NonStandardLogFlow(("VBoxNetCfgWinEnumNetDevices: Device %ld: %S\n", dwDevID, pCurID));
     679            PWSTR pCurId = (PWSTR)pBuffer;
     680            size_t cCurId = wcslen(pCurId);
     681
     682            NonStandardLogFlow(("VBoxNetCfgWinEnumNetDevices: Device %ld: %S\n", dwDevId, pCurId));
    683683
    684684            if (cCurId >= cPnPId)
    685685            {
    686                 pCurID += cCurId - cPnPId;
    687                 if (!wcsnicmp(pCurID, pwszPnPID, cPnPId))
     686                pCurId += cCurId - cPnPId;
     687                if (!wcsnicmp(pCurId, pwszPnPId, cPnPId))
    688688                {
    689689                    if (!callback(hDevInfo, &Dev, pContext))
     
    693693        }
    694694
    695         NonStandardLogFlow(("VBoxNetCfgWinEnumNetDevices: Found %ld devices total\n", dwDevID));
     695        NonStandardLogFlow(("VBoxNetCfgWinEnumNetDevices: Found %ld devices total\n", dwDevId));
    696696
    697697        if (pBuffer)
     
    25492549                    {
    25502550                          /* get the device instance ID */
    2551                           TCHAR devID [MAX_DEVICE_ID_LEN];
     2551                          TCHAR devId[MAX_DEVICE_ID_LEN];
    25522552                          if (CM_Get_Device_ID(DeviceInfoData.DevInst,
    2553                                                devID, MAX_DEVICE_ID_LEN, 0) == CR_SUCCESS)
     2553                                               devId, MAX_DEVICE_ID_LEN, 0) == CR_SUCCESS)
    25542554                          {
    25552555                              /* compare to what we determined before */
    2556                               if (wcscmp(devID, lszPnPInstanceId) == 0)
     2556                              if (wcscmp(devId, lszPnPInstanceId) == 0)
    25572557                              {
    25582558                                  found = TRUE;
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