[PATCH v2 2/3] iphlpapi: Report NO_ERROR when succeeded.

Zhiyi Zhang zzhang at codeweavers.com
Sat Aug 4 22:05:00 CDT 2018


Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 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 b965874a53..159b7bef18 100644
--- a/dlls/iphlpapi/icmp.c
+++ b/dlls/iphlpapi/icmp.c
@@ -434,7 +434,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 87c3ebfac6..f964878d68 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);
-- 
2.17.1





More information about the wine-devel mailing list