DeviceIOControlLib.Wrapper.DiskDeviceWrapper.DiskGetDriveLayout C# (CSharp) Method

DiskGetDriveLayout() public method

http://msdn.microsoft.com/en-us/library/windows/desktop/aa365173(v=vs.85).aspx
public DiskGetDriveLayout ( ) : DRIVE_LAYOUT_INFORMATION
return DeviceIOControlLib.Objects.Disk.DRIVE_LAYOUT_INFORMATION
        public DRIVE_LAYOUT_INFORMATION DiskGetDriveLayout()
        {
            DRIVE_LAYOUT_INFORMATION_INTERNAL data = DeviceIoControlHelper.InvokeIoControl<DRIVE_LAYOUT_INFORMATION_INTERNAL>(Handle, IOControlCode.DiskGetDriveLayout);

            DRIVE_LAYOUT_INFORMATION res = new DRIVE_LAYOUT_INFORMATION();

            res.PartitionCount = data.PartitionCount;
            res.Signature = data.Signature;
            res.PartitionEntry = new PARTITION_INFORMATION[res.PartitionCount];

            for (int i = 0; i < res.PartitionCount; i++)
                res.PartitionEntry[i] = data.PartitionEntry[i];

            return res;
        }