1. RE: Wrapping GetVolumeInfo: help required
- Posted by Matthew Lewis <matthewwalkerlewis at YAHOO.COM> Oct 12, 2001
- 368 views
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)