コード例 #1
0
        internal AttributeList(NonResident nonRes)
        {
            Name          = (FileRecordAttribute.ATTR_TYPE)nonRes.Name;
            NameString    = nonRes.NameString;
            NonResident   = nonRes.NonResident;
            AttributeId   = nonRes.AttributeId;
            AttributeSize = nonRes.AttributeSize;

            #region AttributeReference

            List <AttrRef> refList = new List <AttrRef>();

            byte[] bytes = nonRes.GetBytes();

            int i = 0;

            while (i < bytes.Length)
            {
                AttrRef attrRef = new AttrRef(bytes, i);
                refList.Add(attrRef);
                i += attrRef.RecordLength;
            }
            AttributeReference = refList.ToArray();

            #endregion AttributeReference
        }
コード例 #2
0
        internal AttributeList(ResidentHeader header, byte[] attrBytes, string attrName)
        {
            Name = (Attr.ATTR_TYPE)header.commonHeader.ATTRType;
            NameString = attrName;
            NonResident = header.commonHeader.NonResident;
            AttributeId = header.commonHeader.Id;

            #region AttributeReference

            int i = 0;
            List<AttrRef> refList = new List<AttrRef>();

            while (i < attrBytes.Length)
            {
                AttrRef attrRef = new AttrRef(NativeMethods.GetSubArray(attrBytes, (uint)i, (uint)BitConverter.ToUInt16(attrBytes, i + 0x04)));
                refList.Add(attrRef);
                i += attrRef.RecordLength;
            }
            AttributeReference = refList.ToArray();

            #endregion AttributeReference
        }
コード例 #3
0
        internal AttributeList(ResidentHeader header, byte[] bytes, int offset, string attrName)
        {
            Name = (FileRecordAttribute.ATTR_TYPE)header.commonHeader.ATTRType;
            NameString = attrName;
            NonResident = header.commonHeader.NonResident;
            AttributeId = header.commonHeader.Id;

            #region AttributeReference

            int i = offset;
            List<AttrRef> refList = new List<AttrRef>();
            
            while (i < offset + header.AttrSize)
            {
                AttrRef attrRef = new AttrRef(bytes, i);
                refList.Add(attrRef);
                i += attrRef.RecordLength;
            }
            AttributeReference = refList.ToArray();

            #endregion AttributeReference
        }
コード例 #4
0
        internal AttributeList(ResidentHeader header, byte[] attrBytes, string attrName)
        {
            Name        = (Attr.ATTR_TYPE)header.commonHeader.ATTRType;
            NameString  = attrName;
            NonResident = header.commonHeader.NonResident;
            AttributeId = header.commonHeader.Id;

            #region AttributeReference

            int            i       = 0;
            List <AttrRef> refList = new List <AttrRef>();

            while (i < attrBytes.Length)
            {
                AttrRef attrRef = new AttrRef(Util.GetSubArray(attrBytes, (uint)i, (uint)BitConverter.ToUInt16(attrBytes, i + 0x04)));
                refList.Add(attrRef);
                i += attrRef.RecordLength;
            }
            AttributeReference = refList.ToArray();

            #endregion AttributeReference
        }
コード例 #5
0
        internal AttributeList(ResidentHeader header, byte[] bytes, int offset, string attrName)
        {
            Name        = (FileRecordAttribute.ATTR_TYPE)header.commonHeader.ATTRType;
            NameString  = attrName;
            NonResident = header.commonHeader.NonResident;
            AttributeId = header.commonHeader.Id;

            #region AttributeReference

            int            i       = 0;
            List <AttrRef> refList = new List <AttrRef>();

            while (i < bytes.Length)
            {
                AttrRef attrRef = new AttrRef(bytes, i + offset);
                refList.Add(attrRef);
                i += attrRef.RecordLength;
            }
            AttributeReference = refList.ToArray();

            #endregion AttributeReference
        }