[NETSHELL]

CORE-4949
Fix the network adapter name retrieval code. Adapter names should be visible again. Retest please.

svn path=/trunk/; revision=61272
This commit is contained in:
Eric Kohl 2013-12-14 18:19:30 +00:00
parent 602a8fa908
commit d0d5cf63bb

View file

@ -604,12 +604,15 @@ CNetConnectionManager::EnumerateINetConnections()
}
RegCloseKey(hSubKey);
}
if (SetupDiGetDeviceRegistryPropertyW(hInfo, &DevInfo, SPDRP_DEVICEDESC, NULL, (PBYTE)szNetCfg, sizeof(szNetCfg)/sizeof(WCHAR), &dwSize))
/* Get the adapter device description */
dwSize = 0;
SetupDiGetDeviceRegistryPropertyW(hInfo, &DevInfo, SPDRP_DEVICEDESC, NULL, NULL, 0, &dwSize);
if (dwSize != 0)
{
szNetCfg[(sizeof(szNetCfg)/sizeof(WCHAR))-1] = L'\0';
pNew->Props.pszwDeviceName = (LPWSTR)CoTaskMemAlloc((wcslen(szNetCfg)+1) * sizeof(WCHAR));
pNew->Props.pszwDeviceName = (LPWSTR)CoTaskMemAlloc(dwSize);
if (pNew->Props.pszwDeviceName)
wcscpy(pNew->Props.pszwDeviceName, szNetCfg);
SetupDiGetDeviceRegistryPropertyW(hInfo, &DevInfo, SPDRP_DEVICEDESC, NULL, (PBYTE)pNew->Props.pszwDeviceName, dwSize, &dwSize);
}
if (pCurrent)