Forum: Win32/Win64 API (native code)
Delphi
by WorstNightmare,
11. Jul 2009
const
FILE_READ_ACCESS = 1;
METHOD_BUFFERED = 0;
FILE_DEVICE_MASS_STORAGE = $2D;
IOCTL_STORAGE_BASE = FILE_DEVICE_MASS_STORAGE;
IOCTL_STORAGE_MEDIA_REMOVAL = $002D4804;
Forum: Win32/Win64 API (native code)
Delphi
by WorstNightmare,
11. Jul 2009
Hm ja, ich habe das STORAGE_MEDIA_REMOVAL weggelassen, den record gabs in Delphi nicht. Ich übersetze ihn mal und versuchs dann.
Forum: Win32/Win64 API (native code)
Delphi
by WorstNightmare,
11. Jul 2009
Aus dem Beispielcode von deinem Link:
uDriveType = GetDriveType(szRootName);
switch(uDriveType) {
case DRIVE_REMOVABLE:
dwAccessFlags = GENERIC_READ | GENERIC_WRITE;
break;
case DRIVE_CDROM:
dwAccessFlags = GENERIC_READ;
Forum: Win32/Win64 API (native code)
Delphi
by WorstNightmare,
11. Jul 2009
Hallo,
wie in anderen Threads hier beschrieben, schreibe ich gerade ein Programm, welches ein Laufwerk aus der Partitionstabelle löscht. Das ist auch kein Problem, allerdings weiß ich nicht, wie ich Windows sagen soll, dass es bitte die Festplatte neu laden soll. Es handelt sich um eine externe Platte, falls das von Bedeutung ist.
hDisk := CreateFile('\\.\N:', GENERIC_READ or...