Mosa.ClassLib.BinaryFormat.GetUInt C# (CSharp) Метод

GetUInt() публичный Метод

Gets the usigned int.
public GetUInt ( uint offset ) : uint
offset uint The offset.
Результат uint
        public uint GetUInt(uint offset)
        {
            uint value = data[offset++];
            value += (uint)(data[offset++] << 8);
            value += (uint)(data[offset++] << 16);
            value += (uint)(data[offset++] << 24);

            return value;
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Reads the master boot block.
        /// </summary>
        /// <returns></returns>
        public bool Read()
        {
            valid = false;

            MasterBootBlock mbr = new MasterBootBlock(diskDevice);

            if (!mbr.Valid)
                return false;

            if ((mbr.Partitions[0].PartitionType != PartitionType.GPT) ||
                (mbr.Partitions[1].PartitionType != PartitionType.Empty) ||
                (mbr.Partitions[2].PartitionType != PartitionType.Empty) ||
                (mbr.Partitions[3].PartitionType != PartitionType.Empty) ||
                (!mbr.Partitions[0].Bootable) || (mbr.Partitions[0].StartLBA != 1))
                return false;

            BinaryFormat gpt = new BinaryFormat(diskDevice.ReadBlock(1, 1));

            if ((gpt.GetByte(0) != 45) && (gpt.GetByte(1) != 46) && (gpt.GetByte(2) != 49) && (gpt.GetByte(3) != 20) &&
                (gpt.GetByte(4) != 50) && (gpt.GetByte(5) != 41) && (gpt.GetByte(6) != 52) && (gpt.GetByte(7) != 54))
                return false;

            if ((gpt.GetUInt(GPT.Revision) != GPTConstant.SupportedRevision) ||
                (gpt.GetUInt(GPT.HeaderSize) != GPTConstant.HeaderSize) ||
                (gpt.GetUInt(GPT.Reserved) != 0) ||
                (gpt.GetUInt(GPT.PartitionStartingLBA) != 2)
                )
                return false;

            valid = true;

            return valid;
        }
All Usage Examples Of Mosa.ClassLib.BinaryFormat::GetUInt