AttachCurrentThread() call crashes Java Application

Hello,

I have injected a DLL having JNI code into Java Application using CreateRemoteThread() function.

Then i created a Thread using CreateThread() function in DLL_PROCESS_ATTACH.

I wanted to attach this thread to JVM already running inside the Java Application. So i used JNI_GetCreatedJVMs to get JVM pointer.

I got the JVM pointer, but when i try to call AttachCurrentThread() Java Application crashes giving EXCEPTION_ACCESS_VIOLATION error.

Please guide me.

Thanks in advance.

[525 byte] By [kaiwalyaa] at [2007-11-27 9:34:19]
# 1
Hello,I solved the problem, there was problem in buffer length parameter inJNI_GetCreatedJVMs() it was o , I set it to 1.Now I am getting JVM pointer, so there is no problem at all.
kaiwalyaa at 2007-7-12 22:58:18 > top of Java-index,Java HotSpot Virtual Machine,Specifications...