Exemple #1
0
        internal DynamicDisk(VirtualDisk disk)
        {
            _disk   = disk;
            _header = GetPrivateHeader(_disk);

            TocBlock toc = GetTableOfContents();

            long dbStart = (_header.ConfigurationStartLba * 512) + (toc.Item1Start * 512);

            _disk.Content.Position = dbStart;
            _database = new Database(_disk.Content);
        }
Exemple #2
0
        private TocBlock GetTableOfContents()
        {
            byte[] buffer = new byte[_header.TocSizeLba * 512];
            _disk.Content.Position = (_header.ConfigurationStartLba * 512) + (1 * _header.TocSizeLba * 512);

            _disk.Content.Read(buffer, 0, buffer.Length);
            TocBlock tocBlock = new TocBlock();

            tocBlock.ReadFrom(buffer, 0);

            if (tocBlock.Signature == "TOCBLOCK")
            {
                return(tocBlock);
            }

            return(null);
        }
        private TocBlock GetTableOfContents()
        {
            byte[] buffer = new byte[_header.TocSizeLba * 512];
            _disk.Content.Position = (_header.ConfigurationStartLba * 512) + (1 * _header.TocSizeLba * 512);

            _disk.Content.Read(buffer, 0, buffer.Length);
            TocBlock tocBlock = new TocBlock();
            tocBlock.ReadFrom(buffer, 0);

            if (tocBlock.Signature == "TOCBLOCK")
            {
                return tocBlock;
            }

            return null;
        }