Zhiyi Zhang : iphlpapi: Report NO_ERROR when IcmpSendEcho() succeeded.

Alexandre Julliard julliard at winehq.org
Wed Aug 15 14:39:54 CDT 2018


Module: wine
Branch: master
Commit: 3825be96f30a9916a81ddf63d664ec84bfe08606
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3825be96f30a9916a81ddf63d664ec84bfe08606

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Sun Aug  5 11:05:00 2018 +0800

iphlpapi: Report NO_ERROR when IcmpSendEcho() succeeded.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 0d80248..496ad2a 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 8d71c74..609abb3 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);




More information about the wine-cvs mailing list