Signed-off-by: Yeshun Ye yeyeshun@uniontech.com --- dlls/iphlpapi/iphlpapi_main.c | 9 ++++++++- dlls/iphlpapi/tests/iphlpapi.c | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 09414d26dde..21edd9ee128 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -706,9 +706,16 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen) DWORD i; PIP_ADDR_STRING currentIPAddr = &ptr->IpAddressList; BOOL firstIPAddr = TRUE; + NET_LUID luid; + GUID guid;
/* on Win98 this is left empty, but whatever */ - getInterfaceNameByIndex(table->indexes[ndx], ptr->AdapterName); + ConvertInterfaceIndexToLuid(table->indexes[ndx], &luid); + ConvertInterfaceLuidToGuid(&luid, &guid); + sprintf(ptr->AdapterName, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], + guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], + guid.Data4[6], guid.Data4[7]); getInterfaceNameByIndex(table->indexes[ndx], ptr->Description); ptr->AddressLength = sizeof(ptr->Address); getInterfacePhysicalByIndex(table->indexes[ndx], diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index 44ead2580bf..807b9446cb7 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -2406,8 +2406,8 @@ static void test_GetAdaptersInfo_AdapterName(void) } ptr = ptr->Next; } - todo_wine ok(IpAddress[0], "A valid IP must be present for adapter [%s]\n", pCurrentAddress->AdapterName); - todo_wine ok(IpMask[0], "A valid mask must be present for adapter [%s]\n", pCurrentAddress->AdapterName); + ok(IpAddress[0], "A valid IP must be present for adapter [%s]\n", pCurrentAddress->AdapterName); + ok(IpMask[0], "A valid mask must be present for adapter [%s]\n", pCurrentAddress->AdapterName); HeapFree(GetProcessHeap(), 0, buf); } pCurrentAddress = pCurrentAddress->Next;