Ejemplo n.º 1
0
        /// <summary>
        /// http://social.msdn.microsoft.com/Forums/en-US/os_binaryfile/thread/a5f9c653-40f5-4638-85d3-00c54607d984/
        /// Outlook 2003 MUST have a valid rgbFillLevel for write operations
        /// </summary>
        private void UpdateFillLevelMap()
        {
            int blocksToProcess     = Math.Min(m_dataTree.DataBlockCount, 8);
            HeapOnNodeHeader header = this.HeapHeader;

            for (int blockIndex = 0; blockIndex < blocksToProcess; blockIndex++)
            {
                if (m_blocksToUpdate.Contains(blockIndex))
                {
                    HeapOnNodeBlockData blockData = GetBlockData(blockIndex);
                    byte fillLevel = HeapOnNodeHelper.GetBlockFillLevel(blockData);
                    header.rgbFillLevel[blockIndex] = fillLevel;
                }
            }
            UpdateHeapHeader(header);

            for (int blockIndex = 8; blockIndex < m_dataTree.DataBlockCount; blockIndex += 128)
            {
                int blocksLeft = m_dataTree.DataBlockCount - blockIndex;
                blocksToProcess = Math.Min(blocksLeft, 128);
                HeapOnNodeBitmapHeader bitmapHeader = GetBitmapHeader(blockIndex);
                for (int blockOffset = 0; blockOffset < blocksToProcess; blockOffset++)
                {
                    if (m_blocksToUpdate.Contains(blockIndex + blockOffset))
                    {
                        HeapOnNodeBlockData blockData = GetBlockData(blockIndex + blockOffset);
                        byte fillLevel = HeapOnNodeHelper.GetBlockFillLevel(blockData);
                        bitmapHeader.rgbFillLevel[blockOffset] = fillLevel;
                    }
                }
                UpdateBitmapHeader(blockIndex, bitmapHeader);

                blocksLeft -= blocksToProcess;
            }
        }
Ejemplo n.º 2
0
        public void UpdateBitmapHeader(int blockIndex, HeapOnNodeBitmapHeader header)
        {
            HeapOnNodeBitmapBlockData blockData = (HeapOnNodeBitmapBlockData)GetBlockData(blockIndex);

            // header is fixed length, so we won't overwrite anything but the old header
            blockData.BitmapHeader = header;
            UpdateBuffer(blockIndex, blockData);
        }
Ejemplo n.º 3
0
 public HeapOnNodeBitmapBlockData(byte[] buffer)
 {
     BitmapHeader = new HeapOnNodeBitmapHeader(buffer);
     PopulateHeapItems(buffer, BitmapHeader.ibHnpm);
 }
Ejemplo n.º 4
0
 public HeapOnNodeBitmapBlockData()
 {
     BitmapHeader = new HeapOnNodeBitmapHeader();
 }