jna

How to pass a Environment Pointer to Windows CreateProcess in Java (using jna)

醉酒当歌 提交于 2019-12-23 17:05:10
问题 I am calling Kernel32.Instance.CreateProcess to start a detached process. One issue I am facing is attempting to pass a environment block to CreateProcess each time I do the process does not start. I first used Advapi32Util.getEnvironmentBlock(environment) to create the block, then to make a Pointer (needed by CreateProcess ( I used: public static Pointer asPointer(String string) { byte[] data; try { data = Native.toByteArray(string, "UTF-8"); } catch (UnsupportedEncodingException e) { throw

Why still getting JNA error on Cassandra startup, even the jna.jar and platform.jar are there in the lib dir?

别说谁变了你拦得住时间么 提交于 2019-12-23 17:02:05
问题 I have downloaded and copied Jna.jar and Platform.jar to /usr/cassandra/apache-cassandra-1.0.7/lib folder, but still see the following error on Cassandra startup, am I missing anything? "On cassandra JNA not found. Native methods will be disabled." And the following are where I get the Jna.jar and Platform.jar https://github.com/downloads/twall/jna/jna.jar https://github.com/downloads/twall/jna/platform.jar 回答1: Based on the suggested in comments post. Ubunto 12.10 Cassandra 1.1.6 I fixed

Is there a tool which creates C header files for Delphi (Win32) DLLs?

风格不统一 提交于 2019-12-23 15:37:54
问题 Until now I have seen only tools and some information for the creation of Delphi code for a given C header file. However, in the 'Delphi first' case, there is a Delphi interface declaration and a generated DLL, and no C header. Are there tools which can extract the necessary information and build a C header file for a DLL? Such a tool could be helpful and time saving in cross-language / cross-platform projects. For example, with the C header file, it would be easier to create Java JNA binding

How to use Java Native Access to set process affinity for processes besides Java.exe?

a 夏天 提交于 2019-12-23 12:22:50
问题 Although it is fairly easy to do manually, I am attempting to automate the setting of cpu affinity in Windows 7 for various VMs after their initial creation time. The project is in Java and I am trying to avoid directly including C code, so I have been using Java Native Access, which masks things like winapi. I'm new to the library, and it's a bit lacking in tutorials or examples, although there are some basic ones findable through quick Google searches. Using the following code, I can set

Error linking JNA library on AdoptOpenJDK on MacOS

可紊 提交于 2019-12-23 10:44:46
问题 I am trying to run some JUnit tests over cassandra. But I get the following error: [08/12/19 10:48:40:411](main)([]) INFO - c.h.c.c.e.EmbeddedCassandra - Starting embedded Cassandra server. 8/12/19 10:48:41:497](main)([]) ERROR - o.a.c.u.NativeLibraryDarwin - Failed to link the C library against JNA. Native methods will be unavailable. java.lang.UnsatisfiedLinkError: /private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp: dlopen(/private/var

Error linking JNA library on AdoptOpenJDK on MacOS

主宰稳场 提交于 2019-12-23 10:43:23
问题 I am trying to run some JUnit tests over cassandra. But I get the following error: [08/12/19 10:48:40:411](main)([]) INFO - c.h.c.c.e.EmbeddedCassandra - Starting embedded Cassandra server. 8/12/19 10:48:41:497](main)([]) ERROR - o.a.c.u.NativeLibraryDarwin - Failed to link the C library against JNA. Native methods will be unavailable. java.lang.UnsatisfiedLinkError: /private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp: dlopen(/private/var

JNA:what is the purpose of getFieldOrder() in structure class

最后都变了- 提交于 2019-12-23 09:30:28
问题 I am trying to call C++ function present within a dll file,C++ function takes structure object as parameter by reference,and function will assign values in that function, So in my java application in order to pass structure object to a function i did write like this: interface someinterface extends Library{ public static class strctclass extends Structure { public static class ByReference extends tTIDFUDeviceInfo implements Structure.ByReference {} public short xxx=0; public char yyy='0';

How do you send keystrokes to an inactive window?

我怕爱的太早我们不能终老 提交于 2019-12-23 06:15:11
问题 as the title describes: Is there a way to send simulated keystrokes to an inactive window by using JNA ( ,because Java is my strongest language)? Of course when there is an alternative language, which can achieve this goal, I'd go for that. I read lots of stuff on the web, also besides JNA but with no succes for this goal. Right now I am able to simulate keystrokes with sendInput() with JNA but thats not what want, because it effects the active window. You can read about that here: https:/

Call a function of VB DLL file from java using JNA

元气小坏坏 提交于 2019-12-23 05:38:06
问题 I am new to using JNA.In all what i want to do is use the vb DLL file in java & call the functions from java. I created a simple java code for this. import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.Platform; public class Main { public interface test extends Library { void fn_Today(int a,int b); } public static void main(String[] args) { test INSTANCE = (test) Native.loadLibrary( (Platform.isWindows() ? "test" : "test"), test.class); int a = 1; int b=2; INSTANCE .fn

JNA couldn't find the specified procedure in dll file through java

只愿长相守 提交于 2019-12-23 04:26:54
问题 I am trying to access dll procedure through java but my java method is unable to find the procedure. The dll file is loaded successfully but the the procedure from C# code named Login I can't call. Below is the def of Procedure in ADHelper.dll: public static ADHelper.LoginResult Login(string UserName, string Password) { if (!ADHelper.IsUserValid(UserName, Password)) return ADHelper.LoginResult.LOGIN_USER_DOESNT_EXIST; DirectoryEntry user = ADHelper.GetUser(UserName); if (user == null) return