====== Travailler avec les Disques ====== ===== A voir... ===== * [[prog:lazarus:cas:disks:deviceiocontrol]] * [[https://stackoverflow.com/questions/24295534/detecting-bad-sectors-using-delphi-or-freepascal/24313825#24313825]] * [[https://stackoverflow.com/questions/8506767/how-do-i-use-createfile-to-access-a-physical-disk]] * [[https://forum.lazarus.freepascal.org/index.php?topic=12230.0]] * [[https://stackoverflow.com/questions/8519658/how-to-call-a-list-of-the-physically-attached-hard-disks-using-free-pascal-or]] * [[https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1362&lngWId=7|RawDiskAccess en Delphi]] ===== Enumérer les disques (physicalDrives) ===== Pour énumérer les physical disk il y aurait plusieurs piste: * Via le WMI * Via SetupApi (une DLL) * Via la base de registre * Via IOCtl ... a creuser ==== Base de Registre ==== * Clé : ''Ordinateur\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\disk\Enum'' * Clé : ''Ordinateur\HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices'' ==== Utilisation de SetupApi ==== * Exemple de code : [[https://wiki.freepascal.org/Windows_Programming_Tips/fr#Activation_et_d.C3.A9sactivation_de_p.C3.A9riph.C3.A9riques]] * [[https://stackoverflow.com/questions/8519658/how-to-call-a-list-of-the-physically-attached-hard-disks-using-free-pascal-or]] ==== Ressources ==== * [[https://stackoverflow.com/questions/327718/how-to-list-physical-disks]] ====== Sources & Ressources ====== * Surveiller changement de disque dur : * WM_DeviceChange * [[http://delphi.cjcsoft.net/viewthread.php?tid=48860]] * [[https://docs.microsoft.com/en-us/windows/win32/devio/wm-devicechange]] * Voir aussi -> [[prog:lazarus:cas:files:files]]