DriveHandle = CreateFile(DiskName,
GENERIC_WRITE | GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (DriveHandle != INVALID_HANDLE_VALUE)
{
stDriveLayout = (DRIVE_LAYOUT_INFORMATION *)malloc(128 *
sizeof(PARTITION_INFORMATION)+4);
ZeroMemory(stDriveLayout, (128 * sizeof(PARTITION_INFORMATION)+4));
res = DeviceIoControl(DriveHandle,
IOCTL_DISK_GET_DRIVE_LAYOUT,
NULL,
0,
stDriveLayout,
(128 * sizeof(PARTITION_INFORMATION)+4),
&cbReturned,
NULL);
}
Thanks in advance
Christian Studer
http://www.realtimesoft.com
Thanks in advance
Aleko
"Christian Studer" <cst...@dplanet.ch> wrote in message
news:e09K0LqbBHA.1932@tkmsftngp03...
Look at the PartitionType member of the PARTITION_INFORMATION structure to
see the type of partition. If the entry is unused, then it won't have any
valid information. Look at the ntdddisk.h for the strucure and partition
type details. You can also get some of the information from the internet.
"Aleko Boychev" <al...@crosswinds.net> wrote in message
news:O982JzobBHA.1972@tkmsftngp04...
Look at the PartitionType member of the PARTITION_INFORMATION structure to
see the type of partition. If the entry is unused, then it won't have any
valid information. Look at the ntdddisk.h for the strucure and partition
type details. You can also get some of the information from the internet.
"Aleko Boychev" <al...@crosswinds.net> wrote in message
news:O982JzobBHA.1972@tkmsftngp04...
Thanks, Aleko
"Ramu" <ra...@uswest.net> wrote in message
news:ejtBE4tbBHA.2016@tkmsftngp07...
DWORD nBufferSize = sizeof(DRIVE_LAYOUT_INFORMATION) +
(16 * sizeof(PARTITION_INFORMATION));
stDriveLayout = (DRIVE_LAYOUT_INFORMATION*)malloc
(nBufferSize);
Nathan
>.
>