草庐IT

pDllName

全部标签

java - JNI 中的 JVM-Crash 调用 ReleaseStringUTFChars,仅在 Windows 7、Windows XP 上正常

以下是通过JNI从JavaJVM调用的C++代码的摘录:(JNIEnv*pJniEnv,jobject,jstringpDllName){stringdllName(pJniEnv->GetStringUTFChars(pDllName,NULL));//stuffhappensherelikeHINSTANCEloadedDll=LoadLibrary(dllName.c_str());pJniEnv->ReleaseStringUTFChars(pDllName,dllName.c_str());return...;}这在WindowsXP中有效,但在Windows7中崩溃并出现访