From 3825be96f30a9916a81ddf63d664ec84bfe08606 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Sun, 5 Aug 2018 11:05:00 +0800 Subject: [PATCH] iphlpapi: Report NO_ERROR when IcmpSendEcho() succeeded. Signed-off-by: Zhiyi Zhang Signed-off-by: Alexandre Julliard --- dlls/iphlpapi/icmp.c | 3 +++ dlls/iphlpapi/tests/iphlpapi.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/iphlpapi/icmp.c b/dlls/iphlpapi/icmp.c index 0d80248e0c9..496ad2ada87 100644 --- a/dlls/iphlpapi/icmp.c +++ b/dlls/iphlpapi/icmp.c @@ -424,7 +424,10 @@ DWORD WINAPI IcmpSendEcho( TRACE("received an ICMP packet of type,code=%d,%d\n",icmp_header->icmp_type,icmp_header->icmp_code); if (icmp_header->icmp_type==ICMP_ECHOREPLY) { if ((icmp_header->icmp_id==id) && (icmp_header->icmp_seq==seq)) + { ier->Status=IP_SUCCESS; + SetLastError(NO_ERROR); + } } else { switch (icmp_header->icmp_type) { case ICMP_UNREACH: diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index 8d71c745755..609abb3762c 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -1118,7 +1118,7 @@ todo_wine error = GetLastError(); reply = (ICMP_ECHO_REPLY *)replydata; ok(ret, "IcmpSendEcho failed unexpectedly\n"); - todo_wine ok(error == NO_ERROR, "Expect last error:0x%08x, got:0x%08x\n", NO_ERROR, error); + ok(error == NO_ERROR, "Expect last error:0x%08x, got:0x%08x\n", NO_ERROR, error); ok(INADDR_LOOPBACK == ntohl(reply->Address), "Address mismatch, expect:%s, got: %s\n", ntoa(INADDR_LOOPBACK), ntoa(reply->Address)); ok(reply->Status == IP_SUCCESS, "Expect status:0x%08x, got:0x%08x\n", IP_SUCCESS, reply->Status);