Represents a directory in the native resources data directory of a windows assembly image.
Inheritance: FileSegment
Ejemplo n.º 1
0
        internal static ImageResourceDirectory FromReadingContext(ReadingContext context)
        {
            var reader = context.Reader;

            var directory = new ImageResourceDirectory
            {
                StartOffset     = reader.Position,
                Characteristics = reader.ReadUInt32(),
                TimeDateStamp   = reader.ReadUInt32(),
                MajorVersion    = reader.ReadUInt16(),
                MinorVersion    = reader.ReadUInt16(),
            };

            var numberOfNamedEntries = reader.ReadUInt16();
            var numberOfIdEntries    = reader.ReadUInt16();

            for (int i = 0; i < numberOfNamedEntries; i++)
            {
                directory.Entries.Add(ImageResourceDirectoryEntry.FromReadingContext(context));
            }

            for (int i = 0; i < numberOfIdEntries; i++)
            {
                directory.Entries.Add(ImageResourceDirectoryEntry.FromReadingContext(context));
            }

            return(directory);
        }
Ejemplo n.º 2
0
        internal static ImageResourceDirectory FromReadingContext(ReadingContext context)
        {
            var reader = context.Reader;

            var directory = new ImageResourceDirectory
            {
                StartOffset = reader.Position,
                Characteristics = reader.ReadUInt32(),
                TimeDateStamp = reader.ReadUInt32(),
                MajorVersion = reader.ReadUInt16(),
                MinorVersion = reader.ReadUInt16(),
            };

            var numberOfNamedEntries = reader.ReadUInt16();
            var numberOfIdEntries = reader.ReadUInt16();

            for (int i = 0; i < numberOfNamedEntries; i++)
                directory.Entries.Add(ImageResourceDirectoryEntry.FromReadingContext(context));

            for (int i = 0; i < numberOfIdEntries; i++)
                directory.Entries.Add(ImageResourceDirectoryEntry.FromReadingContext(context));

            return directory;
        }