Commit 7eafc714 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

iphlpapi: Implement IcmpSendEcho and IcmpSendEcho2 via IcmpSendEcho2Ex.

parent b23039fa
...@@ -443,6 +443,50 @@ DWORD WINAPI IcmpSendEcho( ...@@ -443,6 +443,50 @@ DWORD WINAPI IcmpSendEcho(
DWORD Timeout DWORD Timeout
) )
{ {
return IcmpSendEcho2Ex(IcmpHandle, NULL, NULL, NULL, 0, DestinationAddress,
RequestData, RequestSize, RequestOptions, ReplyBuffer, ReplySize, Timeout);
}
/***********************************************************************
* IcmpSendEcho2 (IPHLPAPI.@)
*/
DWORD WINAPI IcmpSendEcho2(
HANDLE IcmpHandle,
HANDLE Event,
PIO_APC_ROUTINE ApcRoutine,
PVOID ApcContext,
IPAddr DestinationAddress,
LPVOID RequestData,
WORD RequestSize,
PIP_OPTION_INFORMATION RequestOptions,
LPVOID ReplyBuffer,
DWORD ReplySize,
DWORD Timeout
)
{
return IcmpSendEcho2Ex(IcmpHandle, Event, ApcRoutine, ApcContext, 0,
DestinationAddress, RequestData, RequestSize, RequestOptions,
ReplyBuffer, ReplySize, Timeout);
}
/***********************************************************************
* IcmpSendEcho2Ex (IPHLPAPI.@)
*/
DWORD WINAPI IcmpSendEcho2Ex(
HANDLE IcmpHandle,
HANDLE Event,
PIO_APC_ROUTINE ApcRoutine,
PVOID ApcContext,
IPAddr SourceAddress,
IPAddr DestinationAddress,
LPVOID RequestData,
WORD RequestSize,
PIP_OPTION_INFORMATION RequestOptions,
LPVOID ReplyBuffer,
DWORD ReplySize,
DWORD Timeout
)
{
icmp_t* icp=(icmp_t*)IcmpHandle; icmp_t* icp=(icmp_t*)IcmpHandle;
struct icmp* icmp_header; struct icmp* icmp_header;
struct sockaddr_in addr; struct sockaddr_in addr;
...@@ -451,6 +495,10 @@ DWORD WINAPI IcmpSendEcho( ...@@ -451,6 +495,10 @@ DWORD WINAPI IcmpSendEcho(
int reqsize, repsize; int reqsize, repsize;
DWORD send_time; DWORD send_time;
TRACE("(%p, %p, %p, %p, %08x, %08x, %p, %d, %p, %p, %d, %d)\n", IcmpHandle,
Event, ApcRoutine, ApcContext, SourceAddress, DestinationAddress, RequestData,
RequestSize, RequestOptions, ReplyBuffer, ReplySize, Timeout);
if (IcmpHandle==INVALID_HANDLE_VALUE) { if (IcmpHandle==INVALID_HANDLE_VALUE) {
/* FIXME: in fact win98 seems to ignore the handle value !!! */ /* FIXME: in fact win98 seems to ignore the handle value !!! */
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
...@@ -473,6 +521,22 @@ DWORD WINAPI IcmpSendEcho( ...@@ -473,6 +521,22 @@ DWORD WINAPI IcmpSendEcho(
return 0; return 0;
} }
if (Event)
{
FIXME("unsupported for events\n");
return 0;
}
if (ApcRoutine)
{
FIXME("unsupported for APCs\n");
return 0;
}
if (SourceAddress)
{
FIXME("unsupported for source addresses\n");
return 0;
}
/* Prepare the request */ /* Prepare the request */
id=getpid() & 0xFFFF; id=getpid() & 0xFFFF;
seq=InterlockedIncrement(&icmp_sequence) & 0xFFFF; seq=InterlockedIncrement(&icmp_sequence) & 0xFFFF;
...@@ -571,83 +635,6 @@ DWORD WINAPI IcmpSendEcho( ...@@ -571,83 +635,6 @@ DWORD WINAPI IcmpSendEcho(
return icmp_get_reply(icp->sid, buffer, send_time, ReplyBuffer, ReplySize, Timeout); return icmp_get_reply(icp->sid, buffer, send_time, ReplyBuffer, ReplySize, Timeout);
} }
/***********************************************************************
* IcmpSendEcho2 (IPHLPAPI.@)
*/
DWORD WINAPI IcmpSendEcho2(
HANDLE IcmpHandle,
HANDLE Event,
PIO_APC_ROUTINE ApcRoutine,
PVOID ApcContext,
IPAddr DestinationAddress,
LPVOID RequestData,
WORD RequestSize,
PIP_OPTION_INFORMATION RequestOptions,
LPVOID ReplyBuffer,
DWORD ReplySize,
DWORD Timeout
)
{
TRACE("(%p, %p, %p, %p, %08x, %p, %d, %p, %p, %d, %d): stub\n", IcmpHandle,
Event, ApcRoutine, ApcContext, DestinationAddress, RequestData,
RequestSize, RequestOptions, ReplyBuffer, ReplySize, Timeout);
if (Event)
{
FIXME("unsupported for events\n");
return 0;
}
if (ApcRoutine)
{
FIXME("unsupported for APCs\n");
return 0;
}
return IcmpSendEcho(IcmpHandle, DestinationAddress, RequestData,
RequestSize, RequestOptions, ReplyBuffer, ReplySize, Timeout);
}
/***********************************************************************
* IcmpSendEcho2Ex (IPHLPAPI.@)
*/
DWORD WINAPI IcmpSendEcho2Ex(
HANDLE IcmpHandle,
HANDLE Event,
PIO_APC_ROUTINE ApcRoutine,
PVOID ApcContext,
IPAddr SourceAddress,
IPAddr DestinationAddress,
LPVOID RequestData,
WORD RequestSize,
PIP_OPTION_INFORMATION RequestOptions,
LPVOID ReplyBuffer,
DWORD ReplySize,
DWORD Timeout
)
{
TRACE("(%p, %p, %p, %p, %08x, %08x, %p, %d, %p, %p, %d, %d): stub\n", IcmpHandle,
Event, ApcRoutine, ApcContext, SourceAddress, DestinationAddress, RequestData,
RequestSize, RequestOptions, ReplyBuffer, ReplySize, Timeout);
if (Event)
{
FIXME("unsupported for events\n");
return 0;
}
if (ApcRoutine)
{
FIXME("unsupported for APCs\n");
return 0;
}
if (SourceAddress)
{
FIXME("unsupported for source addresses\n");
return 0;
}
return IcmpSendEcho(IcmpHandle, DestinationAddress, RequestData,
RequestSize, RequestOptions, ReplyBuffer, ReplySize, Timeout);
}
/* /*
* Copyright (c) 1989 The Regents of the University of California. * Copyright (c) 1989 The Regents of the University of California.
* All rights reserved. * All rights reserved.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment