lib/mapi/pst.rb
# load the flat list of desc records recursively
#
# corresponds to
# * _pst_build_desc_ptr
# * record_descriptor
load the flat list of desc records recursively
corresponds to
_pst_build_desc_ptr
record_descriptor
load the flat list of desc records recursively corresponds to _pst_build_desc_ptr record_descriptor
def load_desc_rec offset, linku1, start_val
		@desc_offsets << offset
		buf = pst_read_block_size offset, Desc::BLOCK_SIZE, false
		item_count = buf[ITEM_COUNT_OFFSET]
		desc = Desc.new buf[BACKLINK_OFFSET, 4]
		raise 'blah 1' unless desc.desc_id == linku1
		if buf[LEVEL_INDICATOR_OFFSET] == 0
			raise "have too many active items in index (#{item_count})" if item_count > Desc::COUNT_MAX
			buf[0, Desc::SIZE * item_count].scan(/.{#{Desc::SIZE}}/mo).each_with_index do |data, i|
				desc = Desc.new data
				raise 'blah 3' if i == 0 and start_val != 0 and desc.desc_id != start_val
				break if desc.desc_id == 0
				@desc << desc
			end
		else
			raise "have too many active items in index (#{item_count})" if item_count > Index::COUNT_MAX
			buf[0, TablePtr::SIZE * item_count].scan(/.{#{TablePtr::SIZE}}/mo).each_with_index do |data, i|
				table = TablePtr.new data
				raise 'blah 3' if i == 0 and start_val != -1 and table.start != start_val
				break if table.start == 0
				load_desc_rec table.offset, table.u1, table.start
			end
		end
	end
def load_desc_rec offset , linku1 , start_val @desc_offsets << offset buf = pst_read_block_size offset , Desc :: BLOCK_SIZE , false item_count = buf [ ITEM_COUNT_OFFSET ] desc = Desc . new buf [ BACKLINK_OFFSET , 4 ] raise 'blah 1' unless desc . desc_id == linku1 if buf [ LEVEL_INDICATOR_OFFSET ] == 0 raise "have too many active items in index (#{item_count})" if item_count > Desc :: COUNT_MAX buf [ 0 , Desc :: SIZE * item_count ] . scan ( / .{ #{ Desc :: SIZE } } /mo ) . each_with_index do | data , i | desc = Desc . new data raise 'blah 3' if i == 0 and start_val != 0 and desc . desc_id != start_val break if desc . desc_id == 0 @desc << desc end else raise "have too many active items in index (#{item_count})" if item_count > Index :: COUNT_MAX buf [ 0 , TablePtr :: SIZE * item_count ] . scan ( / .{ #{ TablePtr :: SIZE } } /mo ) . each_with_index do | data , i | table = TablePtr . new data raise 'blah 3' if i == 0 and start_val != - 1 and table . start != start_val break if table . start == 0 load_desc_rec table . offset , table . u1 , table . start end end end
load the flat list of desc records recursively
corresponds to
 _pst_build_desc_ptr
 record_descriptor
load the flat list of desc records recursively corresponds to _pst_build_desc_ptr record_descriptor
# not real desc # leaf pointers # split the data into item_count desc objects # first entry # this shouldn't really happen i'd imagine # node pointers # split the data into item_count table pointers # for the first value, we expect the start to be equal note that ids -1, so even for the # first we expect it to be equal. thats the 0x21 (dec 33) desc record. this means we assert # that the first desc record is always 33... # this shouldn't really happen i'd imagine
offset
linku1
start_val