public JNIResult GetEnv(out JNIEnv penv, int version) { if (getEnv == null) { MethodWrapper.GetDelegateForFunctionPointer(functions.GetEnv, ref getEnv); } IntPtr env; JNIResult result = getEnv.Invoke(native, out env, version); penv = new JNIEnv(env); return(result); }
public JNIResult AttachCurrentThread(out JNIEnv penv, JavaVMInitArgs?args) { if (attachCurrentThread == null) { MethodWrapper.GetDelegateForFunctionPointer(functions.AttachCurrentThread, ref attachCurrentThread); } IntPtr env; JNIResult result; if (args.HasValue) { JavaVMInitArgs initArgs = args.Value; result = attachCurrentThread.Invoke(native, out env, &initArgs); } else { result = attachCurrentThread.Invoke(native, out env, null); } penv = new JNIEnv(env); return(result); }