[*] remove half-removed expression and readd missing cache clear
This commit is contained in:
parent
85a575eb95
commit
2b91302128
@ -819,7 +819,6 @@ namespace Aurora::Console::ConsoleStd
|
||||
// Enable escape processing; enable colored output
|
||||
dwMode |= ENABLE_PROCESSED_OUTPUT;
|
||||
ok = SetConsoleMode(gOutputStream, dwMode);
|
||||
auto er = GetLastError();
|
||||
SysAssert(ok, "Couldn't set console mode");
|
||||
|
||||
// Set the output stream to use UTF-8
|
||||
|
@ -77,6 +77,8 @@ namespace Aurora::IO::Net
|
||||
{
|
||||
auto pCurrAddresses = pAddresses.get();
|
||||
|
||||
adaptersOut.clear();
|
||||
|
||||
while (pCurrAddresses)
|
||||
{
|
||||
auto pAdapter = AuMakeSharedThrow<NetAdapter>();
|
||||
@ -125,7 +127,7 @@ namespace Aurora::IO::Net
|
||||
|
||||
|
||||
auto pGateway = pCurrAddresses->FirstGatewayAddress;
|
||||
if (pAnycast)
|
||||
if (pGateway)
|
||||
{
|
||||
NetEndpoint ep;
|
||||
if (pGateway->Address.iSockaddrLength <= sizeof(ep.hint))
|
||||
@ -134,7 +136,7 @@ namespace Aurora::IO::Net
|
||||
DeoptimizeEndpoint(ep);
|
||||
}
|
||||
|
||||
adapter.anycast = ep.ip;
|
||||
adapter.gateway = ep.ip;
|
||||
}
|
||||
|
||||
auto pDnsServers = pCurrAddresses->FirstDnsServerAddress;
|
||||
@ -164,41 +166,6 @@ namespace Aurora::IO::Net
|
||||
|
||||
static void PrecacheAdapters()
|
||||
{
|
||||
#if 0
|
||||
ULONG ulOutBufLen = 0;
|
||||
DWORD dwSize = 0;
|
||||
DWORD dwRetVal = 0;
|
||||
|
||||
dwRetVal = ::GetInterfaceInfo(NULL, &ulOutBufLen);
|
||||
if (dwRetVal == ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
gIpInfo = AuReinterpretCast<IP_INTERFACE_INFO>(AuMakeSharedArray<AuUInt8>(ulOutBufLen));
|
||||
SysAssert(gIpInfo);
|
||||
}
|
||||
|
||||
dwRetVal = ::GetInterfaceInfo(gIpInfo.get(), &ulOutBufLen);
|
||||
if (dwRetVal != NO_ERROR)
|
||||
{
|
||||
if (dwRetVal == ERROR_NO_DATA)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SysPushErrorNet("Couldn't fetch interfaces");
|
||||
return;
|
||||
}
|
||||
|
||||
for (AuUInt i = 0;
|
||||
i < gIpInfo->NumAdapters;
|
||||
i++)
|
||||
{
|
||||
printf("Adapter Index[%d]: %ld\n", i,
|
||||
gIpInfo->Adapter[i].Index);
|
||||
printf("Adapter Name[%d]: %ws\n\n", i,
|
||||
gIpInfo->Adapter[i].Name);
|
||||
}
|
||||
#endif
|
||||
|
||||
auto pAdaptersV4 = GetAddressesForFamily(AF_INET);
|
||||
auto pAdaptersV6 = GetAddressesForFamily(AF_INET6);
|
||||
AddressesToList(pAdaptersV4, gIpv4Adapters);
|
||||
|
Loading…
Reference in New Issue
Block a user