Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8192747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:14:45+00:00 2026-06-07T04:14:45+00:00

In my previous question here I posted the xml I am trying to serialize.

  • 0

In my previous question here I posted the xml I am trying to serialize.
Here is another XML example:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> 
    <System> 
        <Provider Name="XXXXXXXXXX" Guid="{YYYYYYYY}" />  
        <EventID>XYZ</EventID>  
        <Version>0</Version>  
        <Level>L</Level>  
        <Task>A</Task>  
        <Opcode>0</Opcode>  
        <Keywords>0x000xyzh</Keywords>  
        <TimeCreated SystemTime="2012-06-28T15:44:04.997837000Z" />  
        <EventRecordID>153</EventRecordID>  
        <Correlation ActivityID="{DDDDDDDDD}" />  
        <Execution ProcessID="199999" ThreadID="90990" />  
        <Channel>Microsoft-Windows-ABCDEFG/Admin</Channel>  
        <Computer>myPC</Computer>  
        <Security UserID="ABCABC" />  
    </System> 
    <EventData> 
        <Data Name="name1">data1</Data>  
        <Data Name="name2">data2</Data>  
        <Data Name="name3">data3</Data>  
        <ComplexData Name="XYZXYZ">0C004300310022002D004400460053005400450053002200310003004E0053003200230041002D00570041002D00320045004400000047006C002900620061006C0048006900670068005000720069006F007200240074006600120044006100730087000000000000000000000000000000</ComplexData> 
    </EventData> 
    <RenderingInfo Culture="en-US"> 
        <Message>some message </Message>  
        <Level>Information</Level>  
        <Task>XYZ</Task>  
        <Opcode>Info</Opcode>  
        <Channel />  
        <Provider />  
        <Keywords> 
            <Keyword>XYZ</Keyword>  
        </Keywords> 
    </RenderingInfo> 
</Event> 

One difference is that it has Complex Data which is a struct that defines an array of integer values (lengths of following strings …etc) and string unicodes. I figured out a way to decode that string by byte by byte but I need a cleaner way to do that. If EventRecord.ToXml() is not the best way to get the event payload including complex data / structs/ arrays then what is the best way to get that. There are a lot of Windows Event related classes on msdn and I do not know which one to use.

Thanks

EDIT:
Here is some sample of what I knwo about ComplexData:

              <data  
                  inType="win:UInt16"  
                  name="XYZLength"  
                  />  
              <data  
                  inType="win:UnicodeString"  
                  length="XYZLength"  
                  name="XYZ"  
                  />  

Which means that the first two bytes (lower endian format) are the length of the following unicode string and so on. And for the ones that have no length, I need to find the null termination which is 16 bits of zeros (2 bytes of zeros).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:14:46+00:00Added an answer on June 7, 2026 at 4:14 am
    public class Event
    {
        [XmlArrayItem(typeof(Data))]
        [XmlArrayItem(typeof(ComplexData))]
        public object[] EventData;
    }
    
    public class Data
    {
        [XmlAttribute]
        public string Name { get; set; }
    
        [XmlText]
        public string Value { get; set; }
    }
    
    public class ComplexData
    {
        [XmlAttribute]
        public string Name { get; set; }
    
        [XmlText(DataType = "hexBinary")]
        public byte[] Encoded { get; set; }
    }
    

    Please read the documentation:

    • Introducing XML Serialization
    • Controlling XML Serialization Using Attributes
    • Examples of XML Serialization
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement this algorithm description from a previous question I had here
In a previous question i made Dynamic dependent select menus i posted this example
I posted a previous question here asking about what was better, JOIN queries or
I posted a detailed question here: https://stackoverflow.com/questions/4252194/need-help-closing-accessing-my-views-in-a-simple-app-included-an-img-of-my-progr but I might have been too confusing.
Based on my previous question here and here , I found that I can
This question is a continuation of my previous question here zend models architecture (big
This is related to my previous question here . I want 4 divs (absolute
Here's my previous question about switching C callstacks. However, C++ uses a different calling
From My Previous question sending request to apple - from iphone custom application Here,
This is a related to a previous question I have asked here, see the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.