-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
as title says,
this works in ffi mode
const MyStruct = RefStruct({a: 'int', b:'int'});
const PtrMyStruct = ref.refType(MyStruct);
const MyLib = ffi.Library('mylib.dll',{
setCB:['void', ['pointer']],
//...other things
});
let myCB = ffi.Callback('void', [PtrMyStruct ]], (ptrInCallback) => {
let struct = prtInCallback.deref();
// now, I got a js object, everything is ok
));
MyLib.setCB(myCB);here is my fastcall codes
const lib = fastcall.Library('mylib.dll')
lib.struct( 'struct MyStruct{int a; int b}'
lib.declare( 'void (*CB)( MyStruct * ptrInCallback)'
lib.function('void setCB(CB)')
lib.interface.setCB((ptrInCallback)=>{
let struct = prtInCallback.deref();
//Error!!!, value of ptrInCallback is uint8array[0]
})Thank you!
Metadata
Metadata
Assignees
Labels
No labels