S
SynthDanG
Guest
I have a DLL that uses Java via the Java Native Interface. My DLL creates a Java virtual machine, and then uses JNI to execute commands in Java. This all works great. The DLL is in a standard format that can be into numerous music applications.
Java, however, uses exceptions internally, but these exceptions are all caught and handled within the Java virtual machine. For example, whenever the Java Virtual Machine is created, this exception appears in the output window:
Exception thrown at 0x00000250AB3D03B4 in Voltage Modular.exe: 0xC0000005: Access violation reading location 0x0000000000000000
This is perfectly normal. The same thing happens on macOS, for example. It's been well-documented that creating a Java Virtual Machine via JNI will cause this exception to be thrown. The exception is caught somewhere inside of the Java virtual machine, and the exception never reaches my DLL or the main application.
Now, one of the music programs that is loading my .DLL is somehow seeing that an exception is being thrown, and is deciding that there is an error with my DLL. I don't know how the program knows about these exceptions. These Java exceptions do not trigger SetUnhandledExceptionFilter() or any CRT error-handling or signal-throwing functions. They're thrown and caught deep within Java. I can't find any sort of Windows hook to find out if a program is throwing an exception.
Perhaps it's attaching a debugger of sorts? If that's the case, can I prevent that in some way? I want to stop the music program from detecting that these exceptions occur, but I can't figure out how it would do that in the first place -- otherwise I'd try to override this action by detecting it and handling it myself first!
I'd appreciate any advice.
Thanks,
Dan
Continue reading...
Java, however, uses exceptions internally, but these exceptions are all caught and handled within the Java virtual machine. For example, whenever the Java Virtual Machine is created, this exception appears in the output window:
Exception thrown at 0x00000250AB3D03B4 in Voltage Modular.exe: 0xC0000005: Access violation reading location 0x0000000000000000
This is perfectly normal. The same thing happens on macOS, for example. It's been well-documented that creating a Java Virtual Machine via JNI will cause this exception to be thrown. The exception is caught somewhere inside of the Java virtual machine, and the exception never reaches my DLL or the main application.
Now, one of the music programs that is loading my .DLL is somehow seeing that an exception is being thrown, and is deciding that there is an error with my DLL. I don't know how the program knows about these exceptions. These Java exceptions do not trigger SetUnhandledExceptionFilter() or any CRT error-handling or signal-throwing functions. They're thrown and caught deep within Java. I can't find any sort of Windows hook to find out if a program is throwing an exception.
Perhaps it's attaching a debugger of sorts? If that's the case, can I prevent that in some way? I want to stop the music program from detecting that these exceptions occur, but I can't figure out how it would do that in the first place -- otherwise I'd try to override this action by detecting it and handling it myself first!
I'd appreciate any advice.
Thanks,
Dan
Continue reading...