Changeset 59077 in vbox for trunk/src/VBox
- Timestamp:
- Dec 10, 2015 3:48:40 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp
r59046 r59077 3317 3317 if (SetupDiOpenDeviceInfo(hDevInfo, pwszId, NULL, 0, &DevInfoData)) 3318 3318 { 3319 if (SetupDiGetDeviceRegistryPropertyW(hDevInfo, &DevInfoData, 3320 SPDRP_FRIENDLYNAME, NULL, 3321 (PBYTE)wszDevName, RT_ELEMENTS(wszDevName), NULL)) 3319 DWORD err = ERROR_SUCCESS; 3320 if (!SetupDiGetDeviceRegistryPropertyW(hDevInfo, &DevInfoData, 3321 SPDRP_FRIENDLYNAME, NULL, 3322 (PBYTE)wszDevName, RT_ELEMENTS(wszDevName), NULL)) 3323 { 3324 err = GetLastError(); 3325 if (err == ERROR_INVALID_DATA) 3326 { 3327 err = SetupDiGetDeviceRegistryPropertyW(hDevInfo, &DevInfoData, 3328 SPDRP_DEVICEDESC, NULL, 3329 (PBYTE)wszDevName, RT_ELEMENTS(wszDevName), NULL) 3330 ? ERROR_SUCCESS 3331 : GetLastError(); 3332 } 3333 } 3334 if (err == ERROR_SUCCESS) 3322 3335 { 3323 3336 hr = VBoxNetCfgWinGenHostonlyConnectionName(wszDevName, wszConnectionNewName, &cbName); … … 3330 3343 hr = VBoxNetCfgWinRenameConnection(wszGuid, wszConnectionNewName); 3331 3344 if (FAILED(hr)) 3332 NonStandardLogFlow((" NetIf: VBoxNetCfgWinRenameConnection failed (0x%x)\n", hr));3345 NonStandardLogFlow(("VBoxNetCfgWinRenameHostOnlyConnection: VBoxNetCfgWinRenameConnection failed (0x%x)\n", hr)); 3333 3346 } 3334 3347 else 3335 3348 { 3336 DWORD winEr = GetLastError();3337 hr = HRESULT_FROM_WIN32( winEr);3349 err = GetLastError(); 3350 hr = HRESULT_FROM_WIN32(err); 3338 3351 if (SUCCEEDED(hr)) 3339 3352 hr = E_FAIL; 3340 NonStandardLogFlow(("StringFromGUID2 failed winEr=%u, hr=0x%x\n", winEr, hr));3353 NonStandardLogFlow(("StringFromGUID2 failed err=%u, hr=0x%x\n", err, hr)); 3341 3354 } 3342 3355 } 3343 3356 else 3344 NonStandardLogFlow((" NetIf: VBoxNetCfgWinGenHostonlyConnectionName failed (0x%x)\n", hr));3357 NonStandardLogFlow(("VBoxNetCfgWinRenameHostOnlyConnection: VBoxNetCfgWinGenHostonlyConnectionName failed (0x%x)\n", hr)); 3345 3358 if (SUCCEEDED(hr) && pDevName) 3346 3359 { … … 3355 3368 else 3356 3369 { 3357 DWORD winEr = GetLastError(); 3358 hr = HRESULT_FROM_WIN32(winEr); 3359 NonStandardLogFlow(("NetIf: SetupDiGetDeviceRegistryPropertyW failed (0x%x)\n", winEr)); 3370 hr = HRESULT_FROM_WIN32(err); 3371 NonStandardLogFlow(("VBoxNetCfgWinRenameHostOnlyConnection: SetupDiGetDeviceRegistryPropertyW failed (0x%x)\n", err)); 3360 3372 } 3361 3373 } 3362 3374 else 3363 3375 { 3364 DWORD winEr = GetLastError();3365 hr = HRESULT_FROM_WIN32( winEr);3366 NonStandardLogFlow((" NetIf: SetupDiOpenDeviceInfo failed (0x%x)\n", winEr));3376 DWORD err = GetLastError(); 3377 hr = HRESULT_FROM_WIN32(err); 3378 NonStandardLogFlow(("VBoxNetCfgWinRenameHostOnlyConnection: SetupDiOpenDeviceInfo failed (0x%x)\n", err)); 3367 3379 } 3368 3380 SetupDiDestroyDeviceInfoList(hDevInfo);
Note:
See TracChangeset
for help on using the changeset viewer.