Changeset 57147 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/win/cfg
- Timestamp:
- Jul 31, 2015 4:36:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp
r57143 r57147 2962 2962 SetErrBreak(("SetupDiOpenDevRegKey failed (0x%08X)", GetLastError())); 2963 2963 2964 cbSize = sizeof(pWCfgGuidString);2965 DWORD ret;2966 ret = RegQueryValueExW (hkey, L"NetCfgInstanceId", NULL,2967 &dwValueType, (LPBYTE) pWCfgGuidString, &cbSize);2968 2969 RegCloseKey (hkey);2970 2971 2964 if (!SetupDiGetDeviceRegistryPropertyW(hDeviceInfo, &DeviceInfoData, 2972 2965 SPDRP_FRIENDLYNAME , /* IN DWORD Property,*/ … … 2996 2989 } 2997 2990 } 2991 2992 /* Query the instance ID; on Windows 10, the registry key may take a short 2993 * while to appear. Microsoft recommends waiting for up to 5 seconds. 2994 */ 2995 for (int retries = 0; retries < 5 * 5; ++retries) 2996 { 2997 cbSize = sizeof(pWCfgGuidString); 2998 ret = RegQueryValueExW (hkey, L"NetCfgInstanceId", NULL, 2999 &dwValueType, (LPBYTE) pWCfgGuidString, &cbSize); 3000 /* As long as the return code is FILE_NOT_FOUND, sleep and retry. */ 3001 if (ret == ERROR_FILE_NOT_FOUND) 3002 Sleep(200); /* 1/5 of a second. */ 3003 else 3004 break; 3005 } 3006 RegCloseKey (hkey); 3007 3008 if (ret != ERROR_SUCCESS) 3009 SetErrBreak(("Querying NetCfgInstanceId failed (0x%08X)", GetLastError())); 2998 3010 } 2999 3011 while (0);
Note:
See TracChangeset
for help on using the changeset viewer.