Commit cb9c9649 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Modified IcmpCloseHandle and IcmpSendEchoRequest so that we don't

crash if the handle is INVALID_HANDLE_VALUE.
parent 9dd9743b
......@@ -182,6 +182,11 @@ HANDLE WINAPI IcmpCreateFile(VOID)
BOOL WINAPI IcmpCloseHandle(HANDLE IcmpHandle)
{
icmp_t* icp=(icmp_t*)IcmpHandle;
if (IcmpHandle==INVALID_HANDLE_VALUE) {
/* FIXME: in fact win98 seems to ignore the handle value !!! */
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
ISOCK_shutdown(icp->sid,2);
free(icp);
......@@ -217,6 +222,12 @@ DWORD WINAPI IcmpSendEcho(
unsigned short id,seq,cksum;
int res;
if (IcmpHandle==INVALID_HANDLE_VALUE) {
/* FIXME: in fact win98 seems to ignore the handle value !!! */
SetLastError(ERROR_INVALID_HANDLE);
return 0;
}
if (ReplySize<sizeof(ICMP_ECHO_REPLY)+ICMP_MINLEN) {
SetLastError(IP_BUF_TOO_SMALL);
return 0;
......
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