I am using the following code in order to find the free space
for the specified hard drive. I am getting some weird output by using this
API. Could someone please help me in point out the issue.
Here is my code
String ls_total_bytes, ls_free_bytes, ls_used_bytes
Double ld_total_bytes, ld_high_temp,
ld_low_temp,ld_free_bytes,ld_used_bytes
LARGE_INTEGER lli_caller, lli_total, lli_free
ZeroMemory( lli_caller, 8 )
ZeroMemory( lli_total, 8 )
ZeroMemory( lli_free, 8 )
GetDiskFreeSpaceExA(ls_drive , lli_caller, lli_total, lli_free )
ld_total_bytes = (lli_total.HighPart * 4294967295.0) +
lli_total.LowPart
ld_free_bytes = (lli_free.HighPart * 4294967295.0) +
lli_free.LowPart
ld_used_bytes = ld_total_bytes - ld_free_bytes
In the above coding I am getting ld_total_bytes = 0 eventhough I
have the value in both highpart & lowpart.
Any help will be greatly appreciated
Thanks
Karthik
--
Terry Dykstra (TeamSybase)
http://powerbuilder.codeXchange.sybase.com/
http://www.pb9books.com
product enhancement requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement
"Karthik" <kp...@laborfinders.com> wrote in message
news:43427ca3$1@forums-2-dub...
unsignedlong highpart
unsignedlong lowpart
API Declarations are
SUBROUTINE ZeroMemory(ref structure lpVoid, ulong dwSizeofStruct) LIBRARY
"kernel32.dll" Alias for "RtlZeroMemory;ansi"
FUNCTION boolean GetDiskFreeSpaceExA( string lpDirName, REF
LARGE_INTEGER lpFreeBytesToCaller, REF LARGE_INTEGER lpTotalBytes,
REF LARGE_INTEGER lpTotalFreeBytes ) LIBRARY "kernel32.dll" alias for
"GetDiskFreeSpaceExA;ansi"
"Terry Dykstra" <tddy...@forestoil.ca> wrote in message
news:434296e3@forums-1-dub...
LARGE_INTEGER lli_caller, lli_total, lli_free
LongLong ll_free, ll_total
GetDiskFreeSpaceExA("C:\" , lli_caller, lli_total, lli_free )
ll_free = LongLong ( lli_free.lowpart, lli_free.highpart )
ll_total = LongLong ( lli_total.lowpart, lli_total.highpart )
Good Luck,
Brad
I make it to work.
"Brad Wery" <bradweryatagricoreunited.com> wrote in message
news:4342a9aa@forums-1-dub...