mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:45:50 +00:00
[IPHLPAPI] icmp.c: Complete sync with Wine Staging 1.7.55
- Restore a missing brace. - Mark all our differences (at that time). Please inspect them. CORE-10536
This commit is contained in:
parent
0341ea5e7b
commit
8ba4b11a33
2 changed files with 29 additions and 1 deletions
|
@ -603,6 +603,7 @@ DWORD WINAPI IcmpSendEcho(
|
||||||
WARN("using system ping command since SOCK_RAW was not supported.\n");
|
WARN("using system ping command since SOCK_RAW was not supported.\n");
|
||||||
return system_icmp(DestinationAddress, RequestData, RequestSize,
|
return system_icmp(DestinationAddress, RequestData, RequestSize,
|
||||||
RequestOptions, ReplyBuffer, ReplySize, Timeout);
|
RequestOptions, ReplyBuffer, ReplySize, Timeout);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Prepare the request */
|
/* Prepare the request */
|
||||||
|
@ -702,7 +703,11 @@ DWORD WINAPI IcmpSendEcho(
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
send_time = GetTickCount();
|
send_time = GetTickCount();
|
||||||
|
#ifdef __REACTOS__
|
||||||
res=sendto(icp->sid, (const char*)reqbuf, reqsize, 0, (struct sockaddr*)&addr, sizeof(addr));
|
res=sendto(icp->sid, (const char*)reqbuf, reqsize, 0, (struct sockaddr*)&addr, sizeof(addr));
|
||||||
|
#else
|
||||||
|
res=sendto(icp->sid, reqbuf, reqsize, 0, (struct sockaddr*)&addr, sizeof(addr));
|
||||||
|
#endif
|
||||||
HeapFree(GetProcessHeap (), 0, reqbuf);
|
HeapFree(GetProcessHeap (), 0, reqbuf);
|
||||||
if (res<0) {
|
if (res<0) {
|
||||||
DWORD dwBestIfIndex;
|
DWORD dwBestIfIndex;
|
||||||
|
@ -716,6 +721,7 @@ DWORD WINAPI IcmpSendEcho(
|
||||||
memcpy(&ier->Address, &IP4Addr, sizeof(IP4Addr));
|
memcpy(&ier->Address, &IP4Addr, sizeof(IP4Addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
if (WSAGetLastError()==WSAEMSGSIZE)
|
if (WSAGetLastError()==WSAEMSGSIZE)
|
||||||
ier->Status = IP_PACKET_TOO_BIG;
|
ier->Status = IP_PACKET_TOO_BIG;
|
||||||
else {
|
else {
|
||||||
|
@ -733,6 +739,24 @@ DWORD WINAPI IcmpSendEcho(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
#else
|
||||||
|
if (errno==EMSGSIZE)
|
||||||
|
SetLastError(IP_PACKET_TOO_BIG);
|
||||||
|
else {
|
||||||
|
switch (errno) {
|
||||||
|
case ENETUNREACH:
|
||||||
|
SetLastError(IP_DEST_NET_UNREACHABLE);
|
||||||
|
break;
|
||||||
|
case EHOSTUNREACH:
|
||||||
|
SetLastError(IP_DEST_HOST_UNREACHABLE);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
TRACE("unknown error: errno=%d\n",errno);
|
||||||
|
SetLastError(IP_GENERAL_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the reply */
|
/* Get the reply */
|
||||||
|
@ -744,7 +768,11 @@ DWORD WINAPI IcmpSendEcho(
|
||||||
while (poll(&fdr,1,Timeout)>0) {
|
while (poll(&fdr,1,Timeout)>0) {
|
||||||
#endif
|
#endif
|
||||||
recv_time = GetTickCount();
|
recv_time = GetTickCount();
|
||||||
|
#ifdef __REACTOS__
|
||||||
res=recvfrom(icp->sid, (char*)ip_header, maxlen, 0, (struct sockaddr*)&addr,(int*)&addrlen);
|
res=recvfrom(icp->sid, (char*)ip_header, maxlen, 0, (struct sockaddr*)&addr,(int*)&addrlen);
|
||||||
|
#else
|
||||||
|
res=recvfrom(icp->sid, (char*)ip_header, maxlen, 0, (struct sockaddr*)&addr,&addrlen);
|
||||||
|
#endif
|
||||||
TRACE("received %d bytes from %s\n",res, inet_ntoa(addr.sin_addr));
|
TRACE("received %d bytes from %s\n",res, inet_ntoa(addr.sin_addr));
|
||||||
ier->Status=IP_REQ_TIMED_OUT;
|
ier->Status=IP_REQ_TIMED_OUT;
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
|
|
|
@ -269,7 +269,7 @@ gdi32 -
|
||||||
reactos/dll/win32/gdi32/objects/linedda.c # Synced at 20090410
|
reactos/dll/win32/gdi32/objects/linedda.c # Synced at 20090410
|
||||||
|
|
||||||
iphlpapi -
|
iphlpapi -
|
||||||
reactos/dll/win32/iphlpapi/icmp.c # Partially synced to WineStaging-1.7.55
|
reactos/dll/win32/iphlpapi/icmp.c # Synced to WineStaging-1.7.55
|
||||||
|
|
||||||
kernel32 -
|
kernel32 -
|
||||||
reactos/dll/win32/kernel32/wine/actctx.c # Partly synced with Wine 1.7.55
|
reactos/dll/win32/kernel32/wine/actctx.c # Partly synced with Wine 1.7.55
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue