winws: show adapter names in --nlm-list

This commit is contained in:
bol-van 2024-07-14 14:44:29 +03:00
parent 3e1f705932
commit f653c39290

View File

@ -1003,6 +1003,11 @@ static bool AdapterID2Name(const GUID *guid,char *name,DWORD name_len)
if ((w_win32_error = RegOpenKeyExA(HKEY_LOCAL_MACHINE,sNetworkCards,0,KEY_ENUMERATE_SUB_KEYS,&hkNetworkCards)) == ERROR_SUCCESS) if ((w_win32_error = RegOpenKeyExA(HKEY_LOCAL_MACHINE,sNetworkCards,0,KEY_ENUMERATE_SUB_KEYS,&hkNetworkCards)) == ERROR_SUCCESS)
{ {
guid2str(guid, sguid+1);
sguid[0]='{';
sguid[37]='}';
sguid[38]='\0';
for (dwIndex=0;;dwIndex++) for (dwIndex=0;;dwIndex++)
{ {
dwLen=sizeof(sidx)-1; dwLen=sizeof(sidx)-1;
@ -1011,11 +1016,6 @@ static bool AdapterID2Name(const GUID *guid,char *name,DWORD name_len)
{ {
sidx[dwLen]='\0'; sidx[dwLen]='\0';
guid2str(guid, sguid+1);
sguid[0]='{';
sguid[37]='}';
sguid[38]='\0';
if ((w_win32_error = RegOpenKeyExA(hkNetworkCards,sidx,0,KEY_QUERY_VALUE,&hkCard)) == ERROR_SUCCESS) if ((w_win32_error = RegOpenKeyExA(hkNetworkCards,sidx,0,KEY_QUERY_VALUE,&hkCard)) == ERROR_SUCCESS)
{ {
dwLen=sizeof(val)-1; dwLen=sizeof(val)-1;