RE: Wrapping GetVolumeInfo: help required

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

Your problem is in passing nVolumenameSize as a double.  A 'double' is
actually a 64-bit floating point number.  You actually want a long integer,
which is a 32-bit integer.  Change to the C_DOUBLE to C_LONG:

define_c_func(hKernel32_dll, "GetVolumeInformationA", 
     {C_POINTER, C_POINTER, C_LONG, C_POINTER, C_POINTER, 
 C_POINTER, C_POINTER, C_DOUBLE}, C_INT)

and it should work for you.

> -----Original Message-----
> From: Henri.Goffin at sbs.be [mailto:Henri.Goffin at sbs.be]
> 
> this is my first serious attempt to wrap an API call, namely 
> GetVolumeInfo. I get error code 24 which, if i'm right, means 
> 
> ERROR_BAD_LENGTH: The program issued a command but the 
> command length is incorrect.
> 
> Can someone tell me what's wrong?
> 
> hGetVolumeInfo=
>     define_c_func(hKernel32_dll, "GetVolumeInformationA", 
>     {C_POINTER, C_POINTER, C_DOUBLE, C_POINTER, C_POINTER, 
> C_POINTER, C_POINTER, C_DOUBLE}, C_INT)

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

Search



Quick Links

User menu

Not signed in.

Misc Menu