0

I'm using JNR and trying to call to __stdcall function. I've already tried to load library with stdcall() convention:

mTemplateApi = LibraryLoader.create(FPTemplateAPI.class).stdcall().load("FPTemplateAPI");

And tried to annotate method with @StdCall.

public interface FPTemplateAP  
{
    @StdCall
    Pointer CreateTemplateImage(@In ByteBuffer aTemplate,
                                @Out IntByReference aWidth,
                                @Out IntByReference aHeight,
                                @In boolean aColor);

}

As result I get the following error when I try to call to method:

Exception in thread "main" java.lang.UnsatisfiedLinkError: The operation completed successfully.

at jnr.ffi.provider.jffi.AsmRuntime.newUnsatisifiedLinkError(AsmRuntime.java:40)
goto1134
  • 107
  • 11

1 Answers1

0

For now I created another dll that delegates to __stdcall dll, but uses __cdecl, and it perfectly works for me.

goto1134
  • 107
  • 11