Esempio n. 1
0
 public CreateDirPack(BER br) {
     NewDirectoryID = br.ReadUInt32();
 }
Esempio n. 2
0
        public FileParameters(BER br, bool IsFile, ushort Bitmap) {
            Stream si = br.BaseStream;
            Int64 off = si.Position;

            IsDirectory = !IsFile;

            ushort? LongNameOff = null;
            ushort? ShortNameOff = null;

            if (0 != (Bitmap & 1U)) Attributes = br.ReadUInt16();
            if (0 != (Bitmap & 2U)) ParentDirectoryID = br.ReadUInt32();
            if (0 != (Bitmap & 4U)) CreationDate = br.ReadUInt32();
            if (0 != (Bitmap & 8U)) ModificationDate = br.ReadUInt32();
            if (0 != (Bitmap & 16U)) BackupDate = br.ReadUInt32();
            if (0 != (Bitmap & 32U)) FinderInfo = br.ReadBytes(32);
            if (0 != (Bitmap & 64U)) LongNameOff = br.ReadUInt16();
            if (0 != (Bitmap & 128U)) ShortNameOff = br.ReadUInt16();
            if (0 != (Bitmap & 256U)) NodeID = br.ReadUInt32();
            if (IsFile) {
                if (0 != (Bitmap & 512U)) DataForkSize = br.ReadUInt32();
                if (0 != (Bitmap & 1024U)) ResourceForkSize = br.ReadUInt32();
                if (0 != (Bitmap & 2048U)) ExtDataForkSize = br.ReadInt64();
                if (0 != (Bitmap & 4096U)) throw new NotSupportedException("Launch limit");
                if (0 != (Bitmap & 8192U)) throw new NotSupportedException("UTF-8 name");
                if (0 != (Bitmap & 16384U)) ExtResourceForkSize = br.ReadInt64();
                if (0 != (Bitmap & 32768U)) UnixPrivs = new FPUnixPrivs(br);
            }
            else {
                if (0 != (Bitmap & 512U)) OffspringCount = br.ReadUInt16();
                if (0 != (Bitmap & 1024U)) throw new NotSupportedException("Owner ID");
                if (0 != (Bitmap & 2048U)) throw new NotSupportedException("Group ID");
                if (0 != (Bitmap & 4096U)) AccessRights = br.ReadUInt32();
                if (0 != (Bitmap & 8192U)) throw new NotSupportedException("Unicode Name");
                if (0 != (Bitmap & 16384U)) throw new NotSupportedException("?");
                if (0 != (Bitmap & 32768U)) UnixPrivs = new FPUnixPrivs(br);
            }

            if (LongNameOff.HasValue) {
                si.Position = off + LongNameOff.Value;
                LongName = UtAfp.Read1Str(si);
            }
            if (ShortNameOff.HasValue) {
                si.Position = off + ShortNameOff.Value;
                ShortName = UtAfp.Read1Str(si);
            }
        }
Esempio n. 3
0
 public FPUnixPrivs(BER br) {
     uid = br.ReadUInt32();
     gid = br.ReadUInt32();
     permissions = br.ReadUInt32();
     ua_permissions = br.ReadUInt32();
 }
Esempio n. 4
0
        public VolumeParameters(BER br, ushort Bitmap) {
            Stream si = br.BaseStream;
            Int64 off = si.Position;

            ushort? VolNameOff = null;

            if (0 != (Bitmap & 1U)) VolAttribute = br.ReadUInt16();
            if (0 != (Bitmap & 2U)) VolSignature = br.ReadUInt16();
            if (0 != (Bitmap & 4U)) CreateDate = br.ReadUInt32();
            if (0 != (Bitmap & 8U)) ModDate = br.ReadUInt32();
            if (0 != (Bitmap & 16U)) VolBackupDate = br.ReadUInt32();
            if (0 != (Bitmap & 32U)) VolID = br.ReadUInt16();
            if (0 != (Bitmap & 64U)) VolBytesFree = br.ReadUInt32();
            if (0 != (Bitmap & 128U)) VolBytesTotal = br.ReadUInt32();

            if (0 != (Bitmap & 256U)) VolNameOff = br.ReadUInt16();
            if (0 != (Bitmap & 512U)) VolExtBytesFree = br.ReadUInt64();
            if (0 != (Bitmap & 1024U)) VolExtBytesTotal = br.ReadUInt64();
            if (0 != (Bitmap & 2048U)) VolBlockSize = br.ReadUInt32();

            if (VolNameOff != null) {
                si.Position = off + VolNameOff.Value;
                VolName = UtAfp.Read1Str(si);
            }
        }
Esempio n. 5
0
 public DSIPack(Stream si) {
     BER br = new BER(si);
     Flags = br.ReadByte();
     Command = br.ReadByte();
     RequestID = br.ReadUInt16();
     ErrorCode = br.ReadInt32();
     TotalDataLength = br.ReadUInt32();
     Reserved = br.ReadUInt32();
     Payload = br.ReadBytes(Convert.ToInt32(TotalDataLength));
 }
Esempio n. 6
0
 public GetSrvrParmsPack(BER br) {
     ServerTime = br.ReadUInt32();
     {
         int cx = br.ReadByte();
         for (int x = 0; x < cx; x++) Volumes.Add(new VolStruc(br));
     }
 }