Patrick Philipot wrote:

>Hello Rebol-List,
>
>I've got a problem when calling windows API.
>
>Here is an example :
>
>; GetVolumeInformationA is returning the disk system (FAT32 or NTFS)
>; in a buffer (FileSystemNameBuffer)that I have declared
>; FileSystemNameBuffer: "YYYYYYYYYYYYYYYYYYY"
>
>kernel32.dll: load/library %/C/WINDOWS/system32/kernel32.dll
>GetVolumeInfo: make routine! [
>        disk [string!]
>        lpVolumeNameBuffer [string!]
>        size [integer!]
>        lpVolumeSerialNumber [integer!]
>        lpMaximumComponentLength [integer!]
>        lpFileSystemFlags [integer!]
>        lpFileSystemNameBuffer [string!]
>        size2 [integer!]
>        return: [integer!]
>] kernel32.dll "GetVolumeInformationA"
>VolumeNameBuffer: "XXXXXXXXXXXXXXXXXXXX"
>FileSystemNameBuffer: "YYYYYYYYYYYYYYYYYYY"
>GetVolumeInfo "C:\" VolumeNameBuffer 20 0 0 0 FileSystemNameBuffer 20
>?? FileSystemNameBuffer
>
>The problem is that I don't get a clean buffer but
>
>  
>
>>>?? FileSystemNameBuffer
>>>      
>>>
>FileSystemNameBuffer: "[EMAIL PROTECTED]"
>== "[EMAIL PROTECTED]"
>  
>
It should be easy to copy/part find string "^@" or something like that, 
but, arent  those additional parameters just pointers? Try change their 
typ, e.g. to [char*] and see what gets into buffers, maybe rebol will do 
it for you. I would also try to stop preallocating those buffers with 
content. What about make string! 100 or something like that? Dunno, 
let's hope some more experienced rebollers step-in here and give you the 
right answers ...

cheers,
-pekr-

>What do I have to do to get only "FAT32" ?
>
>  
>



-- 
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.

Reply via email to