public void Parse <T>(EventRecordReader reader, T writer, EventMetadata[] metadataArray, RuntimeEventMetadata runtimeMetadata)
            where T : IEtwWriter
        {
            writer.WriteEventBegin(EventMetadata, runtimeMetadata);

            writer.WritePropertyBegin(ImageBase);
            writer.WritePointer(reader.ReadPointer());
            writer.WritePropertyEnd();

            writer.WritePropertyBegin(ImageSize);
            writer.WriteUInt32(reader.ReadUInt32());
            writer.WritePropertyEnd();

            reader.ReadPointer();

            writer.WritePropertyBegin(TimeDateStamp);
            writer.WriteUInt32(reader.ReadUInt32());
            writer.WritePropertyEnd();

            writer.WritePropertyBegin(OriginalFileName);
            writer.WriteUnicodeString(reader.ReadUnicodeString());
            writer.WritePropertyEnd();

            writer.WriteEventEnd();
        }
Ejemplo n.º 2
0
        public void Parse <T>(EventRecordReader reader, T writer, EventMetadata[] metadataArray, RuntimeEventMetadata runtimeMetadata)
            where T : IEtwWriter
        {
            writer.WriteEventBegin(EventMetadata, runtimeMetadata);

            int pointerSize    = (runtimeMetadata.Flags & Etw.EVENT_HEADER_FLAG_32_BIT_HEADER) != 0 ? 4 : 8;
            int numberOfStacks = (runtimeMetadata.UserDataLength - 16) / pointerSize;

            writer.WritePropertyBegin(EventTimeStampMetadata);
            writer.WriteUInt64(reader.ReadUInt64());
            writer.WritePropertyEnd();

            writer.WritePropertyBegin(StackProcessMetadata);
            writer.WriteUInt32(reader.ReadUInt32());
            writer.WritePropertyEnd();

            writer.WritePropertyBegin(StackThreadMetadata);
            writer.WriteUInt32(reader.ReadUInt32());

            writer.WritePropertyBegin(StacksPropertyMetadata);

            writer.WriteArrayBegin();

            for (int i = 0; i < numberOfStacks; ++i)
            {
                writer.WritePointer(reader.ReadPointer());
            }

            writer.WriteArrayEnd();

            writer.WritePropertyEnd();
            writer.WriteEventEnd();
        }