Author: ekohl
Date: Sat Dec 14 18:19:30 2013
New Revision: 61272
URL:
http://svn.reactos.org/svn/reactos?rev=61272&view=rev
Log:
[NETSHELL]
CORE-4949
Fix the network adapter name retrieval code. Adapter names should be visible again. Retest
please.
Modified:
trunk/reactos/dll/win32/netshell/connectmanager.cpp
Modified: trunk/reactos/dll/win32/netshell/connectmanager.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/connect…
==============================================================================
--- trunk/reactos/dll/win32/netshell/connectmanager.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netshell/connectmanager.cpp [iso-8859-1] Sat Dec 14 18:19:30
2013
@@ -604,12 +604,15 @@
}
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)