Skip to content

Commit

Permalink
windows service resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson committed Jan 2, 2025
1 parent b0ece58 commit bdb07ad
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions wpinet/src/main/native/windows/MulticastServiceResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include <wpi/ConvertUTF.h>
#include <wpi/SmallString.h>
Expand Down Expand Up @@ -49,10 +50,8 @@ MulticastServiceResolver::MulticastServiceResolver(
if (wpi::ends_with_lower(serviceType, ".local")) {
wpi::sys::windows::UTF8ToUTF16(serviceType, wideStorage);
} else {
wpi::SmallString<128> storage;
storage.append(serviceType);
storage.append(".local");
wpi::sys::windows::UTF8ToUTF16(storage.str(), wideStorage);
wpi::sys::windows::UTF8ToUTF16(fmt::format("{}.local", serviceType),
wideStorage);
}
pImpl->serviceType = std::wstring{wideStorage.data(), wideStorage.size()};
}
Expand All @@ -71,10 +70,10 @@ static _Function_class_(DNS_QUERY_COMPLETION_ROUTINE) VOID WINAPI
MulticastServiceResolver::Impl* impl =
reinterpret_cast<MulticastServiceResolver::Impl*>(pQueryContext);

wpi::SmallVector<DNS_RECORDW*, 4> PtrRecords;
wpi::SmallVector<DNS_RECORDW*, 4> SrvRecords;
wpi::SmallVector<DNS_RECORDW*, 4> TxtRecords;
wpi::SmallVector<DNS_RECORDW*, 4> ARecords;
std::vector<DNS_RECORDW*> PtrRecords;
std::vector<DNS_RECORDW*> SrvRecords;
std::vector<DNS_RECORDW*> TxtRecords;
std::vector<DNS_RECORDW*> ARecords;

{
DNS_RECORDW* current = pQueryResults->pQueryRecords;
Expand Down

0 comments on commit bdb07ad

Please sign in to comment.