From c63dbf8419cd40fd21422ccc73e231677f24b95c Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 18 Nov 2015 13:03:55 +0100 Subject: winrt: Set error if host cannot be found in QHostInfoAgent::fromName Task-number: QTBUG-49478 Change-Id: Iab745100621db51219a42d575020783f6e9f310a Reviewed-by: Andrew Knight --- src/network/kernel/qhostinfo_winrt.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/kernel/qhostinfo_winrt.cpp b/src/network/kernel/qhostinfo_winrt.cpp index 3d2344726b..0659e0ed55 100644 --- a/src/network/kernel/qhostinfo_winrt.cpp +++ b/src/network/kernel/qhostinfo_winrt.cpp @@ -49,6 +49,8 @@ using namespace ABI::Windows::Networking::Sockets; QT_BEGIN_NAMESPACE +#define E_NO_SUCH_HOST 0x80072af9 + //#define QHOSTINFO_DEBUG QHostInfo QHostInfoAgent::fromName(const QString &hostName) @@ -98,8 +100,11 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) return results; } - if (!endpointPairs) + if (hr == E_NO_SUCH_HOST || !endpointPairs) { + results.setError(QHostInfo::HostNotFound); + results.setErrorString(tr("Host %1 could not be found.").arg(hostName)); return results; + } unsigned int size; endpointPairs->get_Size(&size); -- cgit v1.2.3