Task:
List all available drive partitions with their volumes, parameteres
(most important partition size, to calculate partition sector count)
This must be a windows application.
PartitionSectorCount = PartitionSize / 512;
I used the DeviceIoControl(...) API function width
IOCTL_DISK_GET_DRIVE_LAYOUT parameter to list
all available partitions on specified disk.
It works but there is one problem.
It returns all partitions by their numbers, there is no
information about drive letter.
How can I idenitfy partition drive letter?
I need that because the drive letter of partition is
key to open it with CreateFile(...) API
function to have direct access to that portion of drive.
There is another solution.
is to
1. open direct access to all portions of drive
2. read MBR (master boot record) which contains main information
about partitions.
I don't like this solution because it's dangerous.
Error in my application may destroy file systems on entire disk drive.
That's why I preffer to have full access only to some portion of
drive, only to one partition to prevent any damage.
__________________
Regards, Aram