RE: GetDiskFreeSpaceA

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

> -----Original Message-----
> From: Travis Beaty [mailto:travisbeaty at arn.net]
 
> As I plug along on the installer, I've run into a bit of a 
> snag when it 
> comes to calling the API function GetDiskFreeSpace().  I have 
> linked to the function like this:
> 
> -- start code
> include win32lib.ew
> 
> atom aGetDiskFreeSpace
> 
> aGetDiskFreeSpace = define_c_func(kernel32,
>     "GetDiskFreeSpaceA",
>      {C_POINTER, C_POINTER, C_POINTER, C_POINTER,
>       C_POINTER}, 
>       C_ULONG)
> 
> -- end code
>  
> Unfortunately, aGetDiskFreeSpace is getting a value of -1, which 
> means that the poor installer is backfiring something fierce.

You can't use the same values for the dll as win32lib defines with
define_c_proc/func.  This is because win32lib doesn't actually call
open_dll/define... until c_func/proc is called, to avoid loading things into
memory.  So, what you end up with is an index to the actual value which is
stored in a sequence.  

You'll need to either open the dll yourself, or use the win32lib routines
for linking/calling dll routines.

Matt Lewis

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

Search



Quick Links

User menu

Not signed in.

Misc Menu