Briefly, here are the steps:1. Use CreateFile to open PhysicalDriveX, that is the USB Flash disk2. IOCTL_DISK_GET_DRIVE_GEOMETRY_EX to get the physical disk’s geometry ( we need some information in it to fill partition data)3. IOCTL_DISK_CREATE_DISK to creates an empty partition.4. IOCTL_DISK_SET_DRIVE_LAYOUT_EX to repartition a disk as specified.Note: use IOCTL_DISK_UPDATE_PROPERTIES to synchronize system view after IOCTL_DISK_CREATE_DISK…
Tag: storage
Test Unit Ready (TUR)
The SCSI Test Unit Ready command is used to determine if a device is ready to transfer data (read/write). The device will then return either good status or a check condition SCSI communication takes place between an initiator and a target. The initiator sends a command to the target which then responds. SCSI commands are…