AboutArtemus Harper Expertise I have a BS in computer science and am working towards a Masters degree.
Experience I have experience in Core Java, good background in Java swing/gui, some experience with JNI, Java reflection, and Java java.nio.*
knowledge of Java bytecode and annotations.
Basics in c++ and c#
Question Sir ,
I want to Access Windows Core (Kernel) DLL's in java
program please help with a complete step by step way,
please use an example.
Thanks.
Answer You have a couple of options... Java only supports calling native code if the name of the function is in the format it expects. For this reason, you would need to create a dll, and have it call the kernel function you want.
Or you could do it your self. To do this your self, simply create a method with the native keyword that has the parameters of the function you want to call. Then run javah on the class(es) that have the native methods. This will generate a .h file with the prototype definitions. Then create a .c file that implements those methods and calls the native call you want to do. Then compile it with a c compiler (to a dll) then load that dll in your java code with the System.load(String) method. You can then call the native method and it will invoke the kernel code.
I would probably suggest the first possibility. The website includes examples.