diff --git a/rosapps/net/ping/makefile b/rosapps/net/ping/makefile index 88ec9215105..5f8d29ed6f4 100644 --- a/rosapps/net/ping/makefile +++ b/rosapps/net/ping/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.2 2001/12/31 18:24:13 sedwards Exp $ +# $Id: makefile,v 1.3 2004/01/16 04:43:19 mtempel Exp $ PATH_TO_TOP=../../../reactos @@ -8,6 +8,8 @@ TARGET_APPTYPE = console TARGET_NAME = ping +TARGET_CFLAGS = -D__USE_W32_SOCKETS + TARGET_SDKLIBS = ntdll.a ws2_32.a TARGET_OBJECTS = $(TARGET_NAME).o diff --git a/rosapps/net/ping/ping.c b/rosapps/net/ping/ping.c index 326c56c6e98..26f397f2269 100644 --- a/rosapps/net/ping/ping.c +++ b/rosapps/net/ping/ping.c @@ -1,4 +1,4 @@ -/* $Id: ping.c,v 1.2 2004/01/12 22:45:53 sedwards Exp $ +/* $Id: ping.c,v 1.3 2004/01/16 04:43:19 mtempel Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS ping utility @@ -8,6 +8,7 @@ * REVISIONS: * CSH 01/09/2000 Created */ +//#include #include #include #include @@ -18,6 +19,9 @@ //#define DBG /* FIXME: Where should this be? */ +#ifdef CopyMemory +#undef CopyMemory +#endif #define CopyMemory(Destination, Source, Length) memcpy(Destination, Source, Length); /* Should be in the header files somewhere (exported by ntdll.dll) */ @@ -421,7 +425,7 @@ BOOL DecodeResponse(PCHAR buffer, UINT size, PSOCKADDR_IN from) if (size < IphLength + ICMP_MINSIZE) { #ifdef DBG printf("Bad size (0x%X < 0x%X)\n", size, IphLength + ICMP_MINSIZE); -#endif DBG +#endif /* DBG */ return FALSE; } @@ -430,14 +434,14 @@ BOOL DecodeResponse(PCHAR buffer, UINT size, PSOCKADDR_IN from) if (Icmp->Icmp.Type != ICMPMSG_ECHOREPLY) { #ifdef DBG printf("Bad ICMP type (0x%X should be 0x%X)\n", Icmp->Icmp.Type, ICMPMSG_ECHOREPLY); -#endif DBG +#endif /* DBG */ return FALSE; } if (Icmp->Icmp.Id != (USHORT)GetCurrentProcessId()) { #ifdef DBG printf("Bad ICMP id (0x%X should be 0x%X)\n", Icmp->Icmp.Id, (USHORT)GetCurrentProcessId()); -#endif DBG +#endif /* DBG */ return FALSE; } @@ -510,7 +514,7 @@ BOOL Ping(VOID) printf("Sending packet\n"); DisplayBuffer(Buffer, sizeof(ICMP_ECHO_PACKET) + DataSize); printf("\n"); -#endif DBG +#endif /* DBG */ Status = sendto(IcmpSock, Buffer, sizeof(ICMP_ECHO_PACKET) + DataSize, 0, (SOCKADDR*)&Target, sizeof(Target)); @@ -541,7 +545,7 @@ BOOL Ping(VOID) printf("Received packet\n"); DisplayBuffer(Buffer, Status); printf("\n"); -#endif DBG +#endif /* DBG */ } if (Status == SOCKET_ERROR) { if (WSAGetLastError() != WSAETIMEDOUT) {