fdisqueinfo demande le nom logique du dique
alors que
FUNCTION GetDriveInformations(pPhysicalDriveNumber=0)
hDevice, resAPI sont des entiers
Disk est une _DISK_GEOMETRY // voir ci dessous
junk est un entier = 0
Resultat est une chaîne = ""
hDevice = API(kernel32_dll, "CreateFileA",
"\\.\PHYSICALDRIVE" NumériqueVersChaine(pPhysicalDriveNumber), 0,
0x00000003, Null, 3, 0, Null)
IF hDevice=-1 THEN RENVOYER Resultat
//voir exemple en C sur :
http://msdn.microsoft.com/library/default.asp…resAPI = API(kernel32_dll, "DeviceIoControl", hDevice, 0x70000 , Null, 0,
&Disk, 40, &junk, Null)
IF NOT resAPI THEN
Resultat = ""
ELSE
Resultat =
SansEspace(NumériqueVersChaine((Disk:Cylinders*Disk:TracksPerCylinder*Disk:SectorsPerTrack*Disk:BytesPerSector)/(1024*1024*1024),"10.2f"))
TAB Disk:Cylinders TAB Disk:TracksPerCylinder TAB Disk:SectorsPerTrack TAB
Disk:BytesPerSector
END
API(kernel32_dll,"CloseHandle",hDevice)
RENVOYER Resultat
//**********************
_DISK_GEOMETRY est une structure
Cylinders est un entier sans signe sur 8 octets
MediaType est un entier sans signe
TracksPerCylinder est un entier sans signe
SectorsPerTrack est un entier sans signe
BytesPerSector est un entier sans signe
END
//**********************
utilise le disque physique donc même si partitionné, il renvoie tout !