Ejemplo n.º 1
0
        /// <summary>
        /// </summary>
        /// <param name="reader">
        /// </param>
        /// <param name="head">
        /// </param>
        /// <param name="bits">
        /// </param>
        internal MsfDirectory(PdbReader reader, PdbFileHeader head, BitAccess bits)
        {
            bits.MinCapacity(head.directorySize);
            var pages = reader.PagesFromSize(head.directorySize);

            // 0..n in page of directory pages.
            reader.Seek(head.directoryRoot, 0);
            bits.FillBuffer(reader.reader, pages * 4);

            var stream = new DataStream(head.directorySize, bits, pages);
            bits.MinCapacity(head.directorySize);
            stream.Read(reader, bits);

            // 0..3 in directory pages
            int count;
            bits.ReadInt32(out count);

            // 4..n
            var sizes = new int[count];
            bits.ReadInt32(sizes);

            // n..m
            this.streams = new DataStream[count];
            for (var i = 0; i < count; i++)
            {
                if (sizes[i] <= 0)
                {
                    this.streams[i] = new DataStream();
                }
                else
                {
                    this.streams[i] = new DataStream(sizes[i], bits, reader.PagesFromSize(sizes[i]));
                }
            }
        }
Ejemplo n.º 2
0
        internal MsfDirectory(PdbReader reader, PdbFileHeader head, BitAccess bits)
        {
            int pages = reader.PagesFromSize(head.directorySize);

            // 0..n in page of directory pages.
            bits.MinCapacity(head.directorySize);
            int directoryRootPages = head.directoryRoot.Length;
            int pagesPerPage       = head.pageSize / 4;
            int pagesToGo          = pages;

            for (int i = 0; i < directoryRootPages; i++)
            {
                int pagesInThisPage = pagesToGo <= pagesPerPage ? pagesToGo : pagesPerPage;
                reader.Seek(head.directoryRoot[i], 0);
                bits.Append(reader.reader, pagesInThisPage * 4);
                pagesToGo -= pagesInThisPage;
            }
            bits.Position = 0;

            DataStream stream = new DataStream(head.directorySize, bits, pages);

            bits.MinCapacity(head.directorySize);
            stream.Read(reader, bits);

            // 0..3 in directory pages
            int count;

            bits.ReadInt32(out count);

            // 4..n
            int[] sizes = new int[count];
            bits.ReadInt32(sizes);

            // n..m
            streams = new DataStream[count];
            for (int i = 0; i < count; i++)
            {
                if (sizes[i] <= 0)
                {
                    streams[i] = new DataStream();
                }
                else
                {
                    streams[i] = new DataStream(sizes[i], bits,
                                                reader.PagesFromSize(sizes[i]));
                }
            }
        }
Ejemplo n.º 3
0
        internal MsfDirectory(PdbReader reader, PdbFileHeader head, BitAccess bits)
        {
            int pages = reader.PagesFromSize(head.directorySize);

              // 0..n in page of directory pages.
              bits.MinCapacity(head.directorySize);
              int directoryRootPages = head.directoryRoot.Length;
              int pagesPerPage = head.pageSize / 4;
              int pagesToGo = pages;
              for (int i = 0; i < directoryRootPages; i++) {
            int pagesInThisPage = pagesToGo <= pagesPerPage ? pagesToGo : pagesPerPage;
            reader.Seek(head.directoryRoot[i], 0);
            bits.Append(reader.reader, pagesInThisPage * 4);
            pagesToGo -= pagesInThisPage;
              }
              bits.Position = 0;

              DataStream stream = new DataStream(head.directorySize, bits, pages);
              bits.MinCapacity(head.directorySize);
              stream.Read(reader, bits);

              // 0..3 in directory pages
              int count;
              bits.ReadInt32(out count);

              // 4..n
              int[] sizes = new int[count];
              bits.ReadInt32(sizes);

              // n..m
              streams = new DataStream[count];
              for (int i = 0; i < count; i++) {
            if (sizes[i] <= 0) {
              streams[i] = new DataStream();
            } else {
              streams[i] = new DataStream(sizes[i], bits,
                                      reader.PagesFromSize(sizes[i]));
            }
              }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// </summary>
        /// <param name="reader">
        /// </param>
        /// <param name="head">
        /// </param>
        /// <param name="bits">
        /// </param>
        internal MsfDirectory(PdbReader reader, PdbFileHeader head, BitAccess bits)
        {
            bits.MinCapacity(head.directorySize);
            var pages = reader.PagesFromSize(head.directorySize);

            // 0..n in page of directory pages.
            reader.Seek(head.directoryRoot, 0);
            bits.FillBuffer(reader.reader, pages * 4);

            var stream = new DataStream(head.directorySize, bits, pages);

            bits.MinCapacity(head.directorySize);
            stream.Read(reader, bits);

            // 0..3 in directory pages
            int count;

            bits.ReadInt32(out count);

            // 4..n
            var sizes = new int[count];

            bits.ReadInt32(sizes);

            // n..m
            this.streams = new DataStream[count];
            for (var i = 0; i < count; i++)
            {
                if (sizes[i] <= 0)
                {
                    this.streams[i] = new DataStream();
                }
                else
                {
                    this.streams[i] = new DataStream(sizes[i], bits, reader.PagesFromSize(sizes[i]));
                }
            }
        }