PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → Hors-sujet → Autre version de fDisqueInfo
Autre version de fDisqueInfo
Débuté par philippe pasquali, 07 aoû. 2006 21:30 - 2 réponses
Posté le 07 août 2006 - 21:30
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 !
Posté le 08 août 2006 - 12:40
Tient y-a le + qui a sauté dans :
hDevice = API(kernel32_dll, "CreateFileA",
"\\.\PHYSICALDRIVE"+NumériqueVersChaine(pPhysicalDriveNumber), 0,
0x00000003, Null, 3, 0, Null)


"philippe pasquali" <philippe.pasquali@bopack.fr> a écrit dans le message de
news: 44d76df5$1@news.pcsoft.fr...

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 !

Posté le 09 août 2006 - 10:53
Tient y-a le + qui a sauté dans :
hDevice = API(kernel32_dll, "CreateFileA",
"\\.\PHYSICALDRIVE"+NumériqueVersChaine(pPhysicalDriveNumber), 0,
0x00000003, Null, 3, 0, Null)


Rassure toi ca vient pas de toi, c'est le serveur PCSoft qui les fait
sauter...