Re: QWORD (int64) question

new topic     » goto parent     » topic index » view thread      » older message » newer message

Elliott Sales de Andrade writes:
> I think I asked this before, but I would like to know how 
> to get return values that are QWORD's. Someone said 
> that QWORD's are pointers, but they are not. When 
> passing QWORD's they use two INT's in VB, so it is definitely 
> not 32 bits. I am guessing that I would have to use ASM to do this.

I think you can probably *pass* 64-bit integers by
passing two consecutive 32-bit arguments. 
They'll be pushed on the call stack.
Be careful to get them in the right order.

As for receiving a 64-bit integer as a result,
I don't know what the C calling convention is for that.
As a wild guess, unlikely to work, but maybe worth a shot,
you could try declaring (via define_c_func()), the return
value as C_DOUBLE, and then recover the 8 bytes that
are returned using atom_to_float64(). I think doubles
are returned in a floating-point register, so they'd have to
return the 64-bit integer in the same register, which isn't too likely.
More likely, they use two 32-bit registers. You'd have to
maybe disassemble some compiled C code to get the answer,
and then use some machine code similar to Matt Lewis' DLL code.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu