예제 #1
0
        internal static CommonNetworkRelativeLink Parse(BinaryReader reader, ref byte[] bytes, ref StringBuilder sb)
        {
            var cnrl = new CommonNetworkRelativeLink();
            var cs   = reader.ReadUInt32();

            cnrl.Flags = (CommonNetworkRelativeLinkFlags)reader.ReadInt32();

            var nno = reader.ReadUInt32();
            var dno = reader.ReadUInt32();

            cnrl.NetworkProviderType = (NetworkProviderType)reader.ReadInt32();

            var nnou = nno <= 0x14 ? 0 : reader.ReadUInt32();
            var dnou = nno <= 0x14 ? 0 : reader.ReadUInt32();

            if (nno > 0)
            {
                cnrl.NetName = reader.ReadAnsiString(ref bytes);
            }
            if (dno > 0)
            {
                cnrl.DeviceName = reader.ReadAnsiString(ref bytes);
            }
            if (nnou > 0)
            {
                cnrl.UnicodeNetName = reader.ReadUnicodeString(ref sb);
            }
            if (dnou > 0)
            {
                cnrl.UnicodeDeviceName = reader.ReadUnicodeString(ref sb);
            }

            return(cnrl);
        }
예제 #2
0
        internal static LinkInfo Parse(BinaryReader reader, ref byte[] bytes, ref StringBuilder sb)
        {
            var li = new LinkInfo();

            var size = reader.ReadUInt32();
            var hs   = reader.ReadUInt32();
            var lif  = (LinkInfoFlags)reader.ReadInt32();

            var  vidOffset = reader.ReadUInt32();
            var  lbpOffset = reader.ReadUInt32();
            var  cnrlOffset = reader.ReadUInt32();
            var  cpsOffset = reader.ReadUInt32();
            uint lbpuOffset, cpsuOffset;

            if (hs >= 0x24)
            {
                lbpuOffset = reader.ReadUInt32();
                cpsuOffset = reader.ReadUInt32();
            }
            else
            {
                lbpuOffset = cpsuOffset = 0;
            }
            if (vidOffset > 0)
            {
                li.VolumeID = VolumeID.Parse(reader, ref bytes, ref sb);
            }
            if (lbpOffset > 0)
            {
                li.LocalBasePath = reader.ReadAnsiString(ref bytes);
            }
            if (cnrlOffset > 0)
            {
                li.CommonNetworkRelativeLink = CommonNetworkRelativeLink.Parse(reader, ref bytes, ref sb);
            }
            if (cpsOffset > 0)
            {
                li.CommonPathSuffix = reader.ReadAnsiString(ref bytes);
            }
            if (lbpuOffset > 0)
            {
                li.UnicodeLocalBasePath = reader.ReadUnicodeString(ref sb);
            }
            if (cpsuOffset > 0)
            {
                li.UnicodeCommonPathSuffix = reader.ReadUnicodeString(ref sb);
            }

            return(li);
        }