jna

Couldn't load library from loader

陌路散爱 提交于 2019-12-25 03:42:48
问题 I have a problem loading some .dll libraries through my android app, in fact there is tons of questions about this issue but not any one of them solves my problem, the following is how I'm trying to implement them: public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); System.loadLibrary("NetSDKDLL"); // this is where I'm getting the Exception simpleDLL INSTANCE =

Couldn't load library from loader

佐手、 提交于 2019-12-25 03:42:46
问题 I have a problem loading some .dll libraries through my android app, in fact there is tons of questions about this issue but not any one of them solves my problem, the following is how I'm trying to implement them: public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); System.loadLibrary("NetSDKDLL"); // this is where I'm getting the Exception simpleDLL INSTANCE =

JNA passing String by reference to dll but non return

瘦欲@ 提交于 2019-12-25 03:32:12
问题 Hi I have a problem with java and dll. I need to pass string value to dll by reference but, It's not successful. public short ReadData(int block_id, int offset, int data_size,StringByReference dataBuf, IntByReference err_code); The problem is StringByReference dataBuf , I try many way to find solution but it doesn't work. The call function is: ReadData(0, 4, 13, ??? , status); Cause it Had no .dll document. function `public static short Read_Data(int card_type, int block_id, int offset, int

Java JNA mapping D2D1CreateFactory from D2D1

瘦欲@ 提交于 2019-12-25 02:51:08
问题 I was trying to map the function D2D1CreateFactory from the DLL D2D1.dll. From there I want to build up on creating a Direct2D Java mapping, but that's off-topic. I so far had this: public WinNT.HRESULT D2D1CreateFactory(int factoryType, REFIID riid, ID2D1Factory.ByReference ppIFactory); The ID2D1Factory looks like this: public class ID2D1Factory extends IUnknown { public ID2D1Factory() { } public ID2D1Factory(Pointer pvInstance) { super(pvInstance); } } When I try to run my code using the

Java JNA mapping D2D1CreateFactory from D2D1

最后都变了- 提交于 2019-12-25 02:51:04
问题 I was trying to map the function D2D1CreateFactory from the DLL D2D1.dll. From there I want to build up on creating a Direct2D Java mapping, but that's off-topic. I so far had this: public WinNT.HRESULT D2D1CreateFactory(int factoryType, REFIID riid, ID2D1Factory.ByReference ppIFactory); The ID2D1Factory looks like this: public class ID2D1Factory extends IUnknown { public ID2D1Factory() { } public ID2D1Factory(Pointer pvInstance) { super(pvInstance); } } When I try to run my code using the

How to get Windows process Description from Java?

一个人想着一个人 提交于 2019-12-25 02:29:16
问题 Here is the code to get list of currently running process in windows. import com.sun.jna.platform.win32.Kernel32; import com.sun.jna.platform.win32.Tlhelp32; import com.sun.jna.platform.win32.WinDef; import com.sun.jna.platform.win32.WinNT; import com.sun.jna.win32.W32APIOptions; import com.sun.jna.Native; public class ListProcesses { public static void main(String[] args) { Kernel32 kernel32 = (Kernel32) Native.loadLibrary(Kernel32.class, W32APIOptions.UNICODE_OPTIONS); Tlhelp32

Writing a JNA wrapper for Libftd3xx

删除回忆录丶 提交于 2019-12-25 02:15:31
问题 I'm currently trying to write a JNA wrapper for Libftd3xx (a library for FTDI chips). Unfortunately, I have never done this before and need some help from you guys to set things up correctly. I already managed to call native code from my app following this nicely written tutorial for Android Studio. Furthermore, I managed to successfully compile the FTDI driver on my Windows 10 machine resulting in the file "libftd3xx.so". Now I would like to call into the FTDI driver using JNA. The JNA

How does the SQL Server JDBC Trusted Connection Authentication work?

[亡魂溺海] 提交于 2019-12-25 01:46:45
问题 How does the SQL Server JDBC Trusted Connection Authentication work? (ie how does the trusted connection authenticate the logged in AD user in such a transparent and elegant fashion and how can I implement a similar authentication solution for my client-server applications in Java without a database connection or any use of the existing SQL Server solution.) Assumptions * Working within a Windows 2003 domain * You have access to the Windows API via JNI/JNA 回答1: It depends on the client. For

Simulate keystrokes in inactive windows

六月ゝ 毕业季﹏ 提交于 2019-12-25 01:35:46
问题 I'd like to simulate 'real' keystrokes in an inactive window. After some research I found the Windows api. Since Im used to Java, I quickly found JNA, which implements the winapi. I wrote some code, that could simulate keystrokes in a active window with the sendInput() method. The window did not detect virtual keycodes. After some search, windows with directinput need scancodes apparently. And it worked with the following code: import com.sun.jna.platform.win32.BaseTSD; import com.sun.jna

Reading shared memory from c++/c# program in java

点点圈 提交于 2019-12-24 23:12:37
问题 How can I read a shared memory section like "Global\something_something" in java that was created and is updated by a c#/c++ program? I found some tutorials, but they either work with "real files" or have some other additional stuff. I know that I have to make native calls via jna, for example, to the windows api and use something like the openFileMapping function. Are there tutorials I have missed or could someone give me a bit of example code? Is using jna or jni the only way to that sort