Read IPv6 address from mDNS record.

PiperOrigin-RevId: 822743670
This commit is contained in:
Francis Tsui
2025-10-22 14:35:56 -07:00
committed by Copybara-Service
parent 7e8cbfc140
commit bd21843464
9 changed files with 242 additions and 116 deletions
@@ -310,6 +310,23 @@ std::vector<std::string> InspectableReader::ReadStringArray(
return result;
}
GUID InspectableReader::ReadGuid(IInspectable inspectable) {
if (inspectable == nullptr) {
return GUID{};
}
auto property_value =
inspectable.try_as<winrt::Windows::Foundation::IPropertyValue>();
if (property_value == nullptr) {
throw std::invalid_argument("no property value interface.");
}
if (property_value.Type() !=
winrt::Windows::Foundation::PropertyType::Guid) {
throw std::invalid_argument("not guid data type.");
}
return property_value.GetGuid();
}
std::optional<std::wstring> GetDnsHostName() {
DWORD size = 0;