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

DiskGetDriveLayoutEx() public method

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

            DRIVE_LAYOUT_INFORMATION_EX res = new DRIVE_LAYOUT_INFORMATION_EX();

            res.PartitionStyle = data.PartitionStyle;
            res.PartitionCount = data.PartitionCount;
            res.DriveLayoutInformaiton = data.DriveLayoutInformaiton;
            res.PartitionEntry = new PARTITION_INFORMATION_EX[res.PartitionCount];

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

            return res;
        }