Problem : the opentrace API function return a tracehandle which is an INT64 (not its adress). How can I do to get the value returned with PB?
Thanks in advance.
INT64 (or double)
perhaps someone with more knowledge will answer your question, but if you can
post a snipped that will show your problem, then i may be able to help.
i think an int64 would be returned in the registers eax:edx, so if that's the case
you may be able to save the registers to a PB variable right after the API call.
post a snipped that will show your problem, then i may be able to help.
i think an int64 would be returned in the registers eax:edx, so if that's the case
you may be able to save the registers to a PB variable right after the API call.

Not really sure but heres a snippet that will convert a double to a float, if it's of any use:
Code: Select all
Structure dblout
p1.l
p2.l
EndStructure
Procedure.f Float(p1.l,p2.l)
Global _output.f
Global _dblin.dblout
_dblin\p1=p1
_dblin\p2=p2
!FLD qword[v__dblin]
!FST dword[v__output]
ProcedureReturn _output
EndProcedure
Mark my words, when you least expect it, your uppance will come...
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
I'm not sur if this helps.. But with my iSED Lib.. It returns double an such,
have a look:
- np
have a look:
Code: Select all
Structure iSQPDouble
Hi.l
Lo.l
EndStructure
Procedure MakeiSQPDouble(LONG.f, ADDRESS.l)
!FLD dword [ Esp ]
!MOV dword Eax, [ Esp + 4 ]
!FSTP qword [ Eax ]
EndProcedure
; here is an example return
Procedure.l iSEDDrawImage(Left.f, Top.f, Width.f, Height.f)
dLeft.iSQPDouble
dTop.iSQPDouble
dWidth.iSQPDouble
dHeight.iSQPDouble
MakeiSQPDouble(Left.f, @dLeft)
MakeiSQPDouble(Top.f, @dTop)
MakeiSQPDouble(Width.f, @dWidth)
MakeiSQPDouble(Height.f, @dHeight)
ProcedureReturn CallFunctionFast(FPDrawImage, dLeft\Hi, dLeft\Lo, dTop\Hi, dTop\Lo, dWidth\Hi, dWidth\Lo, dHeight\Hi, dHeight\Lo)
EndProcedure
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
Yeah, I have no idea..tonnelier wrote:eventually, this type of thing work :
a.large_integer
a\lowpart=callfunction(...)
I think PB gives to the DLL the adress of the variable to fill in.
And for a DLL that requires only one variable a, which is a large_integer, it appears that callfunction(0,"function",a\lowpart,a\highpart) works.

Someday though, I might learn it.