************** Mehr infos bei Microsoft SDK -Disk Management- ************** **MSDN Libray ** Windows Development ** Windows Base Services ** Files and I/O ** SDK Documentation ** Storage ** Storage Reference Disk Management Control Codes The following control codes are used in disk management. Control code Operation IOCTL_DISK_CREATE_DISK Initializes the specified disk and disk partition table using the specified information. IOCTL_DISK_DELETE_DRIVE_LAYOUT Removes the boot signature from the master boot record. IOCTL_DISK_FORMAT_TRACKS Formats a contiguous set of floppy disk tracks. IOCTL_DISK_FORMAT_TRACKS_EX Formats a contiguous set of floppy disk tracks with an extended set of track specification parameters. IOCTL_DISK_GET_CACHE_INFORMATION Retrieves the disk cache configuration data. IOCTL_DISK_GET_DRIVE_GEOMETRY_EX Retrieves information about the physical disk's geometry. IOCTL_DISK_GET_DRIVE_LAYOUT_EX Retrieves information about the number of partitions on a disk and the features of each partition. IOCTL_DISK_GET_LENGTH_INFO Retrieves the length of the specified disk, volume, or partition. IOCTL_DISK_GET_PARTITION_INFO_EX Retrieves partition information for AT and EFI (Extensible Firmware Interface) partitions. IOCTL_DISK_GROW_PARTITION Enlarges the specified partition. IOCTL_DISK_IS_WRITABLE Determines whether the specified disk is writable. IOCTL_DISK_PERFORMANCE Provides disk performance information. IOCTL_DISK_PERFORMANCE_OFF Disables disk performance information. IOCTL_DISK_REASSIGN_BLOCKS Maps disk blocks to spare-block pool. IOCTL_DISK_SET_CACHE_INFORMATION Sets the disk cache configuration data. IOCTL_DISK_SET_DRIVE_LAYOUT_EX Partitions a disk. IOCTL_DISK_SET_PARTITION_INFO_EX Sets the disk partition type. IOCTL_DISK_UPDATE_PROPERTIES Invalidates the cached partition table of the specified disk and re-enumerates the disk. IOCTL_DISK_VERIFY Performs logical format of a disk extent. The following are defragmentation control codes. Value Meaning FSCTL_GET_RETRIEVAL_POINTERS Get information about a file's cluster use. FSCTL_GET_VOLUME_BITMAP Get a bitmap of cluster allocation. FSCTL_MOVE_FILE Move all or part of a file from one set of clusters to another within a volume. ************************************************************************************************************************************* Um Sektor lesen zu können 32Bit hDrive = CreateFile(Drive,GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL) ;öffnet Laufwerk a=DeviceIoControl(hDrive,FSCTL_LOCK_VOLUME,NULL,0,NULL,0,&ReturnnedByteCounnt,NULL) ;nur ich habe jetz zugriff a=SetFilePointerEx(hDrive,liDistanceToMove,&lpNewFilePointer,FILE_BEGIN) ;zum Sektor xy a=ReadFile(hDrive,&buffer,botsec_byte_pro_sector,&sec_anz_gelesen,NULL) ;Sektor lesen a=DeviceIoControl(hDrive,FSCTL_UNLOCK_VOLUME,NULL,0,NULL,0,&ReturnnedByteCounnt,NULL) ;wieder frei für alle a=DeviceIoControl(hDrive,FSCTL_DISMOUNT_VOLUME,NULL,0,NULL,0,&ReturnnedByteCounnt,NULL) a=CloseHandle(hDrive) ab Win7 geht es nur noch über "Programm im Kopalietätsmodus ausführen unter Eigenschaften" Windows XP also die EXE in XP-Modus ausführen. Win7 CreateFileEx geht nicht SetFilePointerEx geht nicht win8 CreateFile2 geht nicht