Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Calling Windows API

From: patrick::philipot::laposte::net at: 13-Dec-2004 13:40

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: "FAT32^@YYYYYYYYYYYYY" == "FAT32^@YYYYYYYYYYYYY" What do I have to do to get only "FAT32" ? -- Regards, Patrick