예제 #1
0
        internal VolumeId(byte[] bytes, int offset)
        {
            VolumeIdSize      = BitConverter.ToInt32(bytes, offset);
            DriveType         = (DRIVE_TYPE)BitConverter.ToUInt32(bytes, offset + 0x04);
            DriveSerialNumber = BitConverter.ToUInt32(bytes, offset + 0x08);
            VolumeLabelOffset = BitConverter.ToUInt32(bytes, offset + 0x0C);

            int suboffset = 0;

            if (VolumeLabelOffset == 0x14)
            {
                VolumeLabelOffsetUnicode = BitConverter.ToUInt32(bytes, offset + 0x10);
                suboffset = 0x14;
            }
            else
            {
                suboffset = 0x10;
            }

            Data = Helper.GetSubArray(bytes, offset + suboffset, VolumeIdSize - suboffset);
        }
예제 #2
0
        internal VolumeId(byte[] bytes, int offset)
        {
            VolumeIdSize = BitConverter.ToUInt32(bytes, offset);
            DriveType = (DRIVE_TYPE)BitConverter.ToUInt32(bytes, offset + 0x04);
            DriveSerialNumber = BitConverter.ToUInt32(bytes, offset + 0x08);
            VolumeLabelOffset = BitConverter.ToUInt32(bytes, offset + 0x0C);

            int suboffset = 0;

            if (VolumeLabelOffset == 0x14)
            {
                VolumeLabelOffsetUnicode = BitConverter.ToUInt32(bytes, offset + 0x10);
                suboffset = 0x14;
            }
            else
            {
                suboffset = 0x10;
            }

            Data = NativeMethods.GetSubArray(bytes, (uint)offset + (uint)suboffset, VolumeIdSize - (uint)suboffset);
        }