I have a native DLL that wraps access to C++ objects. This DLL is again wrapped by my JNI DLL to access its functions. A C++ object is created by the native DLL function UINT32 create_zs( WHND ). The return parameter is the handle to the created object. To call a method of the C++ object, the native DLL provides a set of functions like BOOLEN zs_initialize( UINT32 ) where the parameter is the handle to the C++ object.
Now, create_zs() works fine and the returned handle seems to be valid, but when I access the wrapper functions of the method calls I get errors like
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x06ff5448, pid=16768, tid=16760
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_03-b07 interpreted mode)
# Problematic frame:
# C 0x06ff5448
For me it seems that the created C++ object is not valid anymore.
A have to precise that:
- The native DLL was already running in other environments (should be OK)
- A init function is called in my JNI DLL which starts a Windows thread.
- This thread loads the native library and ...
- ...calls the zs_create() function of this library.
- The handle to the created C++ object is stored at module level of my JNI DLL for later usage in my native methods.
- The access to the C++ object methods fail as well in the created windows thread as later in the native (Java) methods.
Thanks in advance for every hint that could resolve the problem. I assume it is an understanding problem of myself.