Lines Matching refs:env

78     (JNIEnv *env, jobject obj, jlong jSlotID, jlong jFlags, jobject jApplication, jobject jNotify)
91 CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
101 JNU_ThrowOutOfMemoryError(env, 0);
105 ? (*env)->NewGlobalRef(env, jApplication)
107 notifyEncapsulation->jNotifyObject = (*env)->NewGlobalRef(env, jNotify);
125 if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) {
129 (*env)->DeleteGlobalRef(env, jApplication);
131 (*env)->DeleteGlobalRef(env, jNotify);
147 putNotifyEntry(env, ckSessionHandle, notifyEncapsulation);
166 (JNIEnv *env, jobject obj, jlong jSessionHandle)
175 CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
181 if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; }
184 notifyEncapsulation = removeNotifyEntry(env, ckSessionHandle);
190 (*env)->DeleteGlobalRef(env, notifyEncapsulation->jNotifyObject);
193 (*env)->DeleteGlobalRef(env, jApplicationData);
211 (JNIEnv *env, jobject obj, jlong jSlotID)
220 CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
226 if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; }
230 while ((notifyEncapsulation = removeFirstNotifyEntry(env)) != NULL) {
234 (*env)->DeleteGlobalRef(env, notifyEncapsulation->jNotifyObject);
237 (*env)->DeleteGlobalRef(env, jApplicationData);
255 (JNIEnv *env, jobject obj, jlong jSessionHandle)
262 CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
268 if (ckAssertReturnValueOK(env, rv) == CK_ASSERT_OK) {
269 jSessionInfo = ckSessionInfoPtrToJSessionInfo(env, &ckSessionInfo);
286 (JNIEnv *env, jobject obj, jlong jSessionHandle)
294 CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
300 if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return NULL ; }
304 JNU_ThrowOutOfMemoryError(env, 0);
309 if (ckAssertReturnValueOK(env, rv) == CK_ASSERT_OK) {
310 jState = ckByteArrayToJByteArray(env, ckpState, ckStateLength);
331 (JNIEnv *env, jobject obj, jlong jSessionHandle, jbyteArray jOperationState, jlong jEncryptionKeyHandle, jlong jAuthenticationKeyHandle)
340 CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
344 jByteArrayToCKByteArray(env, jOperationState, &ckpState, &ckStateLength);
345 if ((*env)->ExceptionCheck(env)) { return; }
354 if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; }
370 (JNIEnv *env, jobject obj, jlong jSessionHandle, jlong jUserType, jcharArray jPin)
378 CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
383 jCharArrayToCKCharArray(env, jPin, &ckpPinArray, &ckPinLength);
384 if ((*env)->ExceptionCheck(env)) { return; }
390 if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; }
403 (JNIEnv *env, jobject obj, jlong jSessionHandle)
408 CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
414 if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; }
429 void putNotifyEntry(JNIEnv *env, CK_SESSION_HANDLE hSession, NotifyEncapsulation *notifyEncapsulation) {
438 JNU_ThrowOutOfMemoryError(env, 0);
445 (*env)->MonitorEnter(env, notifyListLock); /* synchronize access to list */
460 (*env)->MonitorExit(env, notifyListLock); /* synchronize access to list */
468 NotifyEncapsulation * removeNotifyEntry(JNIEnv *env, CK_SESSION_HANDLE hSession) {
472 (*env)->MonitorEnter(env, notifyListLock); /* synchronize access to list */
505 (*env)->MonitorExit(env, notifyListLock); /* synchronize access to list */
515 NotifyEncapsulation * removeFirstNotifyEntry(JNIEnv *env) {
519 (*env)->MonitorEnter(env, notifyListLock); /* synchronize access to list */
532 (*env)->MonitorExit(env, notifyListLock); /* synchronize access to list */
562 JNIEnv *env;
584 returnValue = (*jvm)->GetEnv(jvm, (void **) &env, JNI_VERSION_1_2);
588 returnValue = (*jvm)->AttachCurrentThread(jvm, (void **) &env, NULL);
595 returnValue = (*jvm)->AttachCurrentThread(jvm, (void **) &env, NULL);
604 ckNotifyClass = (*env)->FindClass(env, CLASS_NOTIFY);
606 jmethod = (*env)->GetMethodID(env, ckNotifyClass, "CK_NOTIFY", "(JJLjava/lang/Object;)V");
609 (*env)->CallVoidMethod(env, notifyEncapsulation->jNotifyObject, jmethod,
613 pkcs11Exception = (*env)->ExceptionOccurred(env);
618 pkcs11ExceptionClass = (*env)->FindClass(env, CLASS_PKCS11EXCEPTION);
621 jmethod = (*env)->GetMethodID(env, pkcs11ExceptionClass, "getErrorCode", "()J");
624 errorCode = (*env)->CallLongMethod(env, pkcs11Exception, jmethod);