up vote -1 down vote favorite I've function that converts image applying some filter. When i trigger it (via .dll) and JNI interface in java for the first time I recive correct result. But when i want to call it second time, I get an access violation exception. I may add that i don't use any constant in this assembly program. What can cause such issues? I've debugged by this program and it seems it is getting wrong value mov rcx, env mov rdx, image mov r8, count mov rax, functionTable call QWORD PTR[rax + 173 * 8] mov rdx, rax these call return to me 0 in rax. In the first call it returns proper value My JNI function public native void function(int image, int width, int height); I may add that I've exacly the same code but written in .cpp also called by java and there everything works fine. MASM is written for Windows x64 ABI assembly jni x86-64 masm masm64 share | improve this question edited Nov 12 at 8:14 Michael 42.2k 8 42 92 ...