1. RE: GetDiskFreeSpaceA

> -----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 message » categorize

2. RE: GetDiskFreeSpaceA

Howdy y'all!

On 11 Jun 2001, at 8:24, Matthew Lewis wrote:

> 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.

I did that, and it worked flawlessly.  Thank you.

Travis Beaty
Claude, Texas.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu