Permalink
Browse files

delete winping and package jna instead with win32 and win64

1 parent 2ad833e commit e96324298b4f81baae3819ee708048153621b1c2 @angryziber committed Jan 23, 2013
View
@@ -16,9 +16,15 @@ current:
linux:
ant linux
+linux64:
+ ant linux64
+
win32:
ant win32
+win64:
+ ant win64
+
mac:
ant mac
View
@@ -208,7 +208,6 @@
<mkdir dir="${dist}"/>
<unzip src="lib/picocontainer-1.0.jar" dest="${bin}.@{platform}"/>
<unzip src="${swt}/swt-@{platform}.jar" dest="${bin}.@{platform}"/>
- <copy file="ext/winping/lib/winping.dll" todir="${bin}.win32"/> <!-- TODO: support win64 -->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${bin}.@{platform}/images" includes="**/*.svg"/>
<fileset dir="${bin}.@{platform}/META-INF"/>
@@ -399,12 +398,14 @@
<target name="package-win32" depends="build-info">
<copy file="ext/rocksaw/lib/rocksaw.dll" todir="${bin}.win32"/>
+ <unzip src="${swt}/jna-win32.jar" dest="${bin}.win32"/>
<package-for platform="win32"/>
<package-exe-for platform="win32"/>
</target>
<target name="package-win64" depends="build-info">
<!--<copy file="ext/rocksaw/lib/rocksaw.dll" todir="${bin}.win64"/>-->
+ <unzip src="${swt}/jna-win64.jar" dest="${bin}.win64"/>
<package-for platform="win64"/>
<package-exe-for platform="win64"/>
</target>
Binary file not shown.
@@ -1,36 +0,0 @@
-#
-# This file is a part of Angry IP Scanner source code,
-# see http://www.azib.net/ for more information.
-# Licensed under GPLv2.
-#
-# Windows JNI pinger using Microsoft's ICMP.DLL
-# Author: Anton Keks
-#
-
-DEST = ..\lib
-
-JAVA_INCDIR = $(JDK_HOME)\include
-JAVA_INCDIR_PLAF = $(JAVA_INCDIR)\win32
-
-CC = cl
-CFLAGS = -TC
-CPPFLAGS = -I$(JAVA_INCDIR) -I$(JAVA_INCDIR_PLAF)
-
-SRC = WindowsPinger.c
-OBJ = $(SRC:.c=.obj)
-
-LIBNAME = winping
-LIBEXTENSION = dll
-LIBWINPING = $(LIBNAME).$(LIBEXTENSION)
-CLEAN_EXTENSIONS = *.obj *.$(LIBEXTENSION) *.lib *.exp
-
-all: $(LIBWINPING)
-
-.c.obj:
- $(CC) -nologo $(CFLAGS) $(CPPFLAGS) -c $< -o $(DEST)\$@
-
-$(LIBWINPING): $(OBJ)
- $(CC) -nologo -LD -o $(DEST)\$@ $**
-
-clean:
- del $(CLEAN_EXTENSIONS)
@@ -1,103 +0,0 @@
-/*
- * This file is a part of Angry IP Scanner source code,
- * see http://www.angryip.org/ for more information.
- * Licensed under GPLv2.
- *
- * Windows JNI pinger using Microsoft's ICMP.DLL
- * Author: Anton Keks
- */
-
-#include <windows.h>
-
-#include "WindowsPinger.h"
-
-
-FARPROC IcmpCreateFile = NULL;
-
-typedef BOOL (FAR WINAPI *TIcmpCloseHandle)(HANDLE IcmpHandle);
-TIcmpCloseHandle IcmpCloseHandle = NULL;
-
-typedef DWORD (FAR WINAPI *TIcmpSendEcho)(
- HANDLE IcmpHandle, /* handle returned from IcmpCreateFile() */
- u_long DestAddress, /* destination IP address (in network order) */
- LPVOID RequestData, /* pointer to buffer to send */
- WORD RequestSize, /* length of data in buffer */
- LPVOID RequestOptns, /* see Note 2 */
- LPVOID ReplyBuffer, /* see Note 1 */
- DWORD ReplySize, /* length of reply (must allow at least 1 reply) */
- DWORD Timeout /* time in milliseconds to wait for reply */
-);
-TIcmpSendEcho IcmpSendEcho = NULL;
-
-/*
- * Class: net_azib_ipscan_core_net_WindowsPinger
- * Method: nativeIcmpCreateFile
- */
-JNIEXPORT jint JNICALL
-Java_net_azib_ipscan_core_net_WindowsPinger_nativeIcmpCreateFile
-(JNIEnv *env, jclass cls)
-{
- // Initialize dlls on first use
- if (IcmpCreateFile == NULL) {
- HMODULE hICMP = LoadLibrary("icmp.dll");
- if (!hICMP) {
- // newer versions of Windows should include this one instead
- hICMP = LoadLibrary("iphlpapi.dll");
- }
-
- if (!hICMP) {
- return -1;
- }
-
- IcmpCreateFile = (FARPROC) GetProcAddress(hICMP, "IcmpCreateFile");
- IcmpCloseHandle = (TIcmpCloseHandle) GetProcAddress(hICMP, "IcmpCloseHandle");
- IcmpSendEcho = (TIcmpSendEcho) GetProcAddress(hICMP, "IcmpSendEcho");
- }
-
- return IcmpCreateFile();
-}
-
-/*
- * Class: net_azib_ipscan_core_net_WindowsPinger
- * Method: nativeIcmpCloseHandle
- */
-JNIEXPORT void JNICALL
-Java_net_azib_ipscan_core_net_WindowsPinger_nativeIcmpCloseHandle
-(JNIEnv *env, jclass cls, jint handle)
-{
- return IcmpCloseHandle((HANDLE)handle);
-}
-
-/*
- * Class: net_azib_ipscan_core_net_WindowsPinger
- * Method: nativeIcmpSendEcho
- */
-
-JNIEXPORT jint JNICALL
-Java_net_azib_ipscan_core_net_WindowsPinger_nativeIcmpSendEcho
-(JNIEnv *env, jclass cls, jint handle, jbyteArray address, jbyteArray pingData, jbyteArray replyData, jint timeout)
-{
- DWORD replyCount;
- jbyte *addrBuf, *pingDataBuf, *replyDataBuf;
- jint pingDataLen, replyDataLen;
- jclass replyClass;
- jfieldID fid;
- u_long ip;
-
- addrBuf = (*env)->GetByteArrayElements(env, address, NULL);
- pingDataBuf = (*env)->GetByteArrayElements(env, pingData, NULL);
- replyDataBuf = (*env)->GetByteArrayElements(env, replyData, NULL);
-
- pingDataLen = (*env)->GetArrayLength(env, pingData);
- replyDataLen = (*env)->GetArrayLength(env, replyData);
-
- ip = *((u_long*)addrBuf);
- replyCount = IcmpSendEcho((HANDLE)handle, ip, pingDataBuf, pingDataLen,
- NULL, replyDataBuf, replyDataLen, timeout);
-
- (*env)->ReleaseByteArrayElements(env, address, addrBuf, JNI_ABORT);
- (*env)->ReleaseByteArrayElements(env, pingData, pingDataBuf, JNI_ABORT);
- (*env)->ReleaseByteArrayElements(env, replyData, replyDataBuf, 0);
-
- return replyCount;
-}
@@ -1,45 +0,0 @@
-/*
- * This file is a part of Angry IP Scanner source code,
- * see http://www.angryip.org/ for more information.
- * Licensed under GPLv2.
- *
- * Windows JNI pinger using Microsoft's ICMP.DLL
- * Author: Anton Keks
- */
-
-#include <jni.h>
-/* Header for class net_azib_ipscan_core_net_WindowsPinger */
-
-#ifndef _Included_net_azib_ipscan_core_net_WindowsPinger
-#define _Included_net_azib_ipscan_core_net_WindowsPinger
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: net_azib_ipscan_core_net_WindowsPinger
- * Method: nativeIcmpCreateFile
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_net_azib_ipscan_core_net_WindowsPinger_nativeIcmpCreateFile
- (JNIEnv *, jclass);
-
-/*
- * Class: net_azib_ipscan_core_net_WindowsPinger
- * Method: nativeIcmpSendEcho
- * Signature: (I[B[B[BI)I
- */
-JNIEXPORT jint JNICALL Java_net_azib_ipscan_core_net_WindowsPinger_nativeIcmpSendEcho
- (JNIEnv *, jclass, jint, jbyteArray, jbyteArray, jbyteArray, jint);
-
-/*
- * Class: net_azib_ipscan_core_net_WindowsPinger
- * Method: nativeIcmpCloseHandle
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL Java_net_azib_ipscan_core_net_WindowsPinger_nativeIcmpCloseHandle
- (JNIEnv *, jclass, jint);
-
-#ifdef __cplusplus
-}
-#endif
-#endif

0 comments on commit e963242

Please sign in to comment.