"Support for extended partition tables is easy!" he says...
"Piece of cake!" he says... "15 minutes" he says... Well, a day later, we can now deal with extended partition tables. It was almost easy. The offsets in an extended partition table are relative to the location of that table...mostly. The exception is if an extended partition table contains an entry for another extended table. Then the offset provided is relative to the *first* extended partition table found, not the current one. This was also complicated by the NTFS library code which needs to be fed a device special file corresponding to the filesystem partition. So if I am cruising alone creating a whole disk image using /dev/ad0 and I hit a partition containing an NTFS, I have to figure out the BSD name for that particular partition: "hmm..I'm looking at partition 3? That would be /dev/ad0s3". Its easy for the first 4 partitions, but for extended partitions, I had to figure out how BSD mapped those partitions into device names. Once I became aware of the DIOCGSLICEINFO ioctl, this was easy as it gave back all the info needed.