Ejemplo n.º 1
0
        internal StandardInformation(ResidentHeader header, byte[] bytes, int offset, string attrName)
        {
            Name          = (ATTR_TYPE)header.commonHeader.ATTRType;
            NameString    = attrName;
            NonResident   = header.commonHeader.NonResident;
            AttributeId   = header.commonHeader.Id;
            AttributeSize = header.commonHeader.TotalSize;

            BornTime         = DateTime.FromFileTimeUtc(BitConverter.ToInt64(bytes, 0x00 + offset));
            ModifiedTime     = DateTime.FromFileTimeUtc(BitConverter.ToInt64(bytes, 0x08 + offset));
            ChangedTime      = DateTime.FromFileTimeUtc(BitConverter.ToInt64(bytes, 0x10 + offset));
            AccessedTime     = DateTime.FromFileTimeUtc(BitConverter.ToInt64(bytes, 0x18 + offset));
            Permission       = ((ATTR_STDINFO_PERMISSION)BitConverter.ToUInt32(bytes, 0x20 + offset));
            MaxVersionNumber = BitConverter.ToUInt32(bytes, 0x24 + offset);
            VersionNumber    = BitConverter.ToUInt32(bytes, 0x28 + offset);
            ClassId          = BitConverter.ToUInt32(bytes, 0x2C + offset);

            if (header.AttrSize == 0x48)
            {
                OwnerId              = BitConverter.ToUInt32(bytes, 0x30 + offset);
                SecurityId           = BitConverter.ToUInt32(bytes, 0x34 + offset);
                QuotaCharged         = BitConverter.ToUInt64(bytes, 0x38 + offset);
                UpdateSequenceNumber = BitConverter.ToInt64(bytes, 0x40 + offset);
            }
        }
Ejemplo n.º 2
0
        internal StandardInformation(ResidentHeader header, byte[] bytes, int offset, string attrName)
        {
            Name = (ATTR_TYPE)header.commonHeader.ATTRType;
            NameString = attrName;
            NonResident = header.commonHeader.NonResident;
            AttributeId = header.commonHeader.Id;
            AttributeSize = header.commonHeader.TotalSize;

            BornTime = DateTime.FromFileTimeUtc(BitConverter.ToInt64(bytes, 0x00 + offset));
            ModifiedTime = DateTime.FromFileTimeUtc(BitConverter.ToInt64(bytes, 0x08 + offset));
            ChangedTime = DateTime.FromFileTimeUtc(BitConverter.ToInt64(bytes, 0x10 + offset));
            AccessedTime = DateTime.FromFileTimeUtc(BitConverter.ToInt64(bytes, 0x18 + offset));
            Permission = ((ATTR_STDINFO_PERMISSION)BitConverter.ToUInt32(bytes, 0x20 + offset));
            MaxVersionNumber = BitConverter.ToUInt32(bytes, 0x24 + offset);
            VersionNumber = BitConverter.ToUInt32(bytes, 0x28 + offset);
            ClassId = BitConverter.ToUInt32(bytes, 0x2C + offset);

            if (header.AttrSize == 0x48)
            {
                OwnerId = BitConverter.ToUInt32(bytes, 0x30 + offset);
                SecurityId = BitConverter.ToUInt32(bytes, 0x34 + offset);
                QuotaCharged = BitConverter.ToUInt64(bytes, 0x38 + offset);
                UpdateSequenceNumber = BitConverter.ToInt64(bytes, 0x40 + offset);
            }
        }
        internal StandardInformation(ResidentHeader header, byte[] attrBytes, string attrName)
        {
            Name = (ATTR_TYPE)header.commonHeader.ATTRType;
            NameString = attrName;
            NonResident = header.commonHeader.NonResident;
            AttributeId = header.commonHeader.Id;

            BornTime = DateTime.FromFileTimeUtc(BitConverter.ToInt64(attrBytes, 0x00));
            ModifiedTime = DateTime.FromFileTimeUtc(BitConverter.ToInt64(attrBytes, 0x08));
            ChangedTime = DateTime.FromFileTimeUtc(BitConverter.ToInt64(attrBytes, 0x10));
            AccessedTime = DateTime.FromFileTimeUtc(BitConverter.ToInt64(attrBytes, 0x18));
            Permission = ((ATTR_STDINFO_PERMISSION)BitConverter.ToUInt32(attrBytes, 0x20));
            MaxVersionNumber = BitConverter.ToUInt32(attrBytes, 0x24);
            VersionNumber = BitConverter.ToUInt32(attrBytes, 0x28);
            ClassId = BitConverter.ToUInt32(attrBytes, 0x2C);
            
            if (attrBytes.Length == 0x48)
            {
                OwnerId = BitConverter.ToUInt32(attrBytes, 0x30);
                SecurityId = BitConverter.ToUInt32(attrBytes, 0x34);
                QuotaCharged = BitConverter.ToUInt64(attrBytes, 0x38);
                UpdateSequenceNumber = BitConverter.ToUInt64(attrBytes, 0x40);
            }
        }
        internal StandardInformation(ResidentHeader header, byte[] attrBytes, string attrName)
        {
            Name        = (ATTR_TYPE)header.commonHeader.ATTRType;
            NameString  = attrName;
            NonResident = header.commonHeader.NonResident;
            AttributeId = header.commonHeader.Id;

            BornTime         = DateTime.FromFileTimeUtc(BitConverter.ToInt64(attrBytes, 0x00));
            ModifiedTime     = DateTime.FromFileTimeUtc(BitConverter.ToInt64(attrBytes, 0x08));
            ChangedTime      = DateTime.FromFileTimeUtc(BitConverter.ToInt64(attrBytes, 0x10));
            AccessedTime     = DateTime.FromFileTimeUtc(BitConverter.ToInt64(attrBytes, 0x18));
            Permission       = ((ATTR_STDINFO_PERMISSION)BitConverter.ToUInt32(attrBytes, 0x20));
            MaxVersionNumber = BitConverter.ToUInt32(attrBytes, 0x24);
            VersionNumber    = BitConverter.ToUInt32(attrBytes, 0x28);
            ClassId          = BitConverter.ToUInt32(attrBytes, 0x2C);

            if (attrBytes.Length == 0x48)
            {
                OwnerId              = BitConverter.ToUInt32(attrBytes, 0x30);
                SecurityId           = BitConverter.ToUInt32(attrBytes, 0x34);
                QuotaCharged         = BitConverter.ToUInt64(attrBytes, 0x38);
                UpdateSequenceNumber = BitConverter.ToUInt64(attrBytes, 0x40);
            }
        }