1

i have a windows shared library(*.dll) compiled specifically to be used from Java via JNI. Is it possible for me to call this dll from a C application? I want to call the same functions java calls but from a native c executable. How could i do that since the function definitions are JNICALL not STDCALL? Anyone has encountered the same problem?

I do not have the source code for the DLL in order to recompile it. I just need to use it's exported functions from C not from Java.

thank you, JD

JD_GRINDER
  • 344
  • 2
  • 6
  • *Why* do you "need" to use this specific DLL? Can't you find any other third-party library which has the same functionality you want? One where you don't have to set up the whole Java runtime environment just to use a few functions? Also, there's the hint you need: You need to use JNI to be able to use a JNI module. – Some programmer dude Nov 09 '17 at 00:56
  • 1
    You basically need to [embed a java virtual machine](https://stackoverflow.com/questions/7506329/embed-java-into-a-c-application) in your C application. The DLL could potentially interact with the JVM in any way so you need to give it a full JVM. – xiaofeng.li Nov 09 '17 at 00:59
  • Unfortunately there are no third party modules i can use. I have to use this DLL or reverse engineer it's internals. Since i am not able to go into RE( contractual limitations) i need to use this dll. – JD_GRINDER Nov 09 '17 at 00:59

0 Answers0