function mapping delphi/pascal dll in jna handle and string
问题 I'm trying to call a function in a delphi dll using JNA. the function definition is: function myFuncGetName (aHandle : THandle; var aBuf : pwideChar ): integer; export; my jna mapping looks like this: int myFuncGetName(PointerByReference aHandle, WString aBuf); the return value should be 0 for success and -1 for fail and I'm always getting -1. I have started up WinDbg and attached to the process and it breaks at myFuncGetName. 057cb384 eb11 jmp myDLL!myFuncGetName+0x87 (057cb397) 057cb386