hi, i ither get 00's or many diffrent error messages when i use the following code
i need to get it working plz!!!

vb:


Public Declare Sub getallspaces Lib "QUSER32.DLL" (ByVal ppath As String, ByRef ptotal As Single, ByRef pfree As Single, ByRef pused As Single)


asm:


.data
Dtotal REAL4 0.0
Dfree REAL4 0.0
Dused REAL4 0.0
...
...
...
.code
...
...
...
... more procs above here

getallspaces Proc,pcdrivePTR:DWORD,ppTOTAL:REAL4,pFREE:REAL4,pUSED:REAL4
Invoke GetDiskFreeSpaceEx, pcdrivePTR, NULL, Addr Dtotal, Addr Dfree
fld Dtotal
fstp ppTOTAL
fld Dfree
fstp pFREE
fld Dtotal
fld Dfree
fsub Dtotal
fstp pUSED
mov eax, 01

ret
getallspaces EndP

Posted on 2002-04-14 18:24:51 by Qages
Public Declare Sub getallspaces Lib "QUSER32.DLL" (ByVal ppath As String, _
ByRef ptotal As Single, _
ByRef pfree As Single, _
ByRef pused As Single)

Your string is passed fine, but you are passing pointers to the other three variables, then in the asm code you are treating the pointers as the actual values.
Posted on 2002-04-14 20:47:07 by sluggy
k ive got it working with QWORds, but how do i get the bytes used? i cant put the Qword into the resestars,if i do it by all memory addresses it wont compile, how to i sub a qword by a qword!?
Posted on 2002-04-14 22:08:33 by Qages
but how do i get the bytes used?
AFAIK, you cannot just pass a byte from the VB to the ASM, because all call parameters are actually DWORDs. So, even though you are passing a byte to the asm function, the asm function recieves a DWORD on the stack for each byte, and the byte is stored in the low part of the low word of that DWORD.

Posted on 2002-04-14 23:25:47 by sluggy
thats totaly not what im asking, im talking about disck space, i have the total, and the free, i subtract the free from the total to get the used bytes on my c: drive, how do ido this , the regestars are only 32bit and the data type is 64bit, how do i do any math with this diffrence?? im talking about asm, forget the vb all vb is for is to call my function.
Posted on 2002-04-15 15:57:02 by Qages
Yes, i see, what you want to do is simple enough. I can't give you a code snippet (because i've never done any real math in asm, i use HLL to do that :) ). There are a couple of big-number libraries floating around, why don't you use one of those if you can't use MMX?
Posted on 2002-04-15 17:02:03 by sluggy
D00DS, IVE GOT IT
example of a number in a qword
[00][00][00] [00][00][00][01]
[01][00][00][00] [00][00][00] rev
[---16777216---] [-----65280----] in dd segs
[-------72057594037993216-------]

(256^4*16777216)+65280=72057594037993216

(256^4*HIGH DD OF DQ)+LOW DD OF DQ

omg im smart
Posted on 2002-04-15 17:44:36 by Qages