Closed robmv closed 7 years ago
Thanks! @sstecko I think this may explain some of the craziness you were seeing on 32 bit Windows.
Published as 0.2.3
Thanks, that was fast 😂
😀 Wow! Thanks much. This makes a lot of sense.
Ah unfortunately this didn't address my specific issue. I still get a "Exception code: 0xc0000005" when trying to call FindClass on windows i686 32 bit
@sstecko If you have a small test case, I can look at it tomorrow when I have a Windows near.
I am using the jni
crate, a wrapper consumer of jni-sys
. My crash happened accesing the result of my first call to a JNIEnv
function, specifically GetStringUTFChars
.
I call this too:
fn throw_exception(env: &JNIEnv, message: &str) {
let rt_ex = env.find_class("java/lang/RuntimeException").unwrap();
env.throw_new(rt_ex, message).unwrap();
}
that should call FindClass
, but haven't seen the case on Windows 32 bit when it actually fails and the exception is thrown. I will force it tomorrow to see what happen.
I've gotten ctest set up so we shouldn't run into anything like this in the future hopefully: #5.
JNICALL on Windows is defined as __stdcall. All non varargs functions now use extern "system" in order to let Rust compiler choose stdcall on Windows x86 32 bits, for 64 bits and other platforms "system" == "C".