Permalink
Browse files

update w32ce-arm build, native

  • Loading branch information...
1 parent 2d61573 commit ec169478086db75b5b9d3860ee46bc09efb56f0b @twall twall committed Sep 29, 2012
View
@@ -74,7 +74,7 @@
<condition property="test.compatibility" value="1.4">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
- <condition property="tests.exclude-patterns" value="**/VarArgsTest.java,**/AnnotatedLibraryTest.java,**/WebStartTest.java,**/PointerBufferTest.java,**/HeadlessLoadLibraryTest.java,**/StructureBufferFieldTest.java,**/PerformanceTest.java,**/*BufferArgumentsMarshalTest.java">
+ <condition property="tests.exclude-patterns" value="**/VarArgsTest.java,**/AnnotatedLibraryTest.java,**/WebStartTest.java,**/PointerBufferTest.java,**/HeadlessLoadLibraryTest.java,**/StructureBufferFieldTest.java,**/PerformanceTest.java,**/*BufferArgumentsMarshalTest.java" else="**/wince/*.java">
<equals arg1="${os.prefix}" arg2="w32ce-arm"/>
</condition>
<property name="test.compatibility" value="1.5"/>
View
Binary file not shown.
View
@@ -31,7 +31,7 @@
extern "C" {
#endif
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_WIN32_WCE)
#include "com_sun_jna_win32_DLLCallback.h"
#ifdef _WIN64
#ifdef _MSC_VER
@@ -68,7 +68,7 @@ static void * const dll_fptrs[] = {
&asmfn8, &asmfn9, &asmfn10, &asmfn11, &asmfn12, &asmfn13, &asmfn14, &asmfn15,
};
-#endif /* _WIN32 */
+#endif /* _WIN32 && !_WIN32_WCE */
static void callback_dispatch(ffi_cif*, void*, void**, void*);
static jclass classObject;
@@ -40,8 +40,8 @@
#else
#define CNAME(x) x
#endif
-#ifdef __APPLE__
-#define ENTRY(x) .globl _##x; _##x:
+#if defined(__APPLE__) || defined(_WIN32_IE)
+#define ENTRY(x) .globl CNAME(x); CNAME(x):
#else
#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x):
#endif /* __APPLE__ */
@@ -430,7 +430,9 @@ LSYM(Lepilogue_vfp):
.ffi_call_VFP_end:
UNWIND .fnend
+#ifdef __ELF__
.size CNAME(ffi_call_VFP),.ffi_call_VFP_end-CNAME(ffi_call_VFP)
+#endif
ARM_FUNC_START ffi_closure_VFP
@@ -492,7 +494,9 @@ ARM_FUNC_START ffi_closure_VFP
.ffi_closure_VFP_end:
UNWIND .fnend
+#ifdef __ELF__
.size CNAME(ffi_closure_VFP),.ffi_closure_VFP_end-CNAME(ffi_closure_VFP)
+#endif
#endif
ENTRY(ffi_arm_trampoline)
@@ -0,0 +1,113 @@
+/* Copyright (c) 2011 Timothy Wall, All Rights Reserved
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * <p/>
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ */
+package com.sun.jna.wince;
+
+import junit.framework.TestCase;
+import com.sun.jna.*;
+import com.sun.jna.ptr.*;
+import com.sun.jna.win32.*;
+import java.util.Arrays;
+import java.util.List;
+
+public class CoreDLLTest extends TestCase {
+ public static void main(java.lang.String[] argList) {
+ junit.textui.TestRunner.run(CoreDLLTest.class);
+ }
+
+ public interface CoreDLL extends StdCallLibrary {
+ public static class SECURITY_ATTRIBUTES extends Structure {
+ public int dwLength;
+ public Pointer lpSecurityDescriptor;
+ public boolean bInheritHandle;
+ public SECURITY_ATTRIBUTES() {
+ dwLength = size();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList(new String[] { "dwLength", "lpSecurityDescriptor", "bInheritHandle" });
+ }
+ }
+
+ public static class STARTUPINFO extends Structure {
+ public int cb;
+ public String lpReserved;
+ public String lpDesktop;
+ public String lpTitle;
+ public int dwX;
+ public int dwY;
+ public int dwXSize;
+ public int dwYSize;
+ public int dwXCountChars;
+ public int dwYCountChars;
+ public int dwFillAttribute;
+ public int dwFlags;
+ public short wShowWindow;
+ public short cbReserved2;
+ public ByteByReference lpReserved2;
+ public Pointer hStdInput;
+ public Pointer hStdOutput;
+ public Pointer hStdError;
+ public STARTUPINFO() {
+ cb = size();
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList(new String[] { "cb", "lpReserved", "lpDesktop", "lpTitle", "dwX", "dwY", "dwXSize", "dwYSize", "dwXCountChars", "dwYCountChars", "dwFillAttribute", "dwFlags", "wShowWindow", "cbReserved2", "lpReserved2", "hStdInput", "hStdOutput", "hStdError" });
+ }
+ }
+ public static class PROCESS_INFORMATION extends Structure {
+ public Pointer hProcess;
+ public Pointer hThread;
+ public int dwProcessId;
+ public int dwThreadId;
+
+ public static class ByReference extends PROCESS_INFORMATION implements Structure.ByReference {
+ public ByReference() {
+ }
+
+ public ByReference(Pointer memory) {
+ super(memory);
+ }
+ }
+
+ public PROCESS_INFORMATION() {
+ }
+
+ public PROCESS_INFORMATION(Pointer memory) {
+ super(memory);
+ }
+ protected List getFieldOrder() {
+ return Arrays.asList(new String[] { "hProcess", "hThread", "dwProcessId", "dwThreadId" });
+ }
+ }
+ CoreDLL INSTANCE = (CoreDLL)Native.loadLibrary("coredll", CoreDLL.class,
+ W32APIOptions.UNICODE_OPTIONS);
+ boolean CreateProcess(String lpApplicationName, String lpCommandLine,
+ SECURITY_ATTRIBUTES lpProcessAttributes,
+ SECURITY_ATTRIBUTES lpThreadAttributes,
+ boolean bInheritHandles, int dwCreationFlags,
+ Pointer lpEnvironment, String lpCurrentDirectory, STARTUPINFO lpStartupInfo,
+ PROCESS_INFORMATION lpProcessInformation) throws LastErrorException;
+ }
+
+ public void testCreateProcess() {
+ CoreDLL.PROCESS_INFORMATION processInformation = new CoreDLL.PROCESS_INFORMATION();
+ //String cmd = "/storage card/Program files/PHM Tools/regedit";
+ String cmd = null;
+ boolean status = CoreDLL.INSTANCE.CreateProcess(cmd, null, null, null,
+ false, 0x10, Pointer.NULL,
+ null, null, processInformation);
+ assertTrue("Process launch failed", status);
+ }
+}
+
+
+

0 comments on commit ec16947

Please sign in to comment.