Answered by:
EventLogReader.ReadEvent() returns “The data area passed to a system call is too small” exception

Question
-
Hi team,
I am trying to read windows eventlog via c# application.When i run my application sometimes i am getting above stated exception.I don't know when this exception occurs please assist further.
try{
EventLogReader reader = new EventLogReader(query);
query.ReverseDirection = readDirection;
reader.BatchSize = 500;
long startTimeMillis = (long)timeSpan.TotalMilliseconds;
for (EventRecord eventInstance = reader.ReadEvent(); null != eventInstance; eventInstance = reader.ReadEvent())
{
}
}
catch (Exception ex)
{Console.WriteLine("Exception"+ex);
}
- Edited by Balakumar Smart Friday, April 26, 2019 10:45 AM
- Moved by Richard MuellerMVP Friday, April 26, 2019 12:59 PM Not a Forums Issues question
Friday, April 26, 2019 10:43 AM
Answers
-
This forum is for questions and discussions about the forums themselves. I would ask here:
https://social.msdn.microsoft.com/Forums/vstudio/en-us/home?forum=csharpgeneral
Richard Mueller - MVP Enterprise Mobility (Identity and Access)
- Edited by Richard MuellerMVP Friday, April 26, 2019 12:16 PM
- Proposed as answer by Dave PatrickMVP Friday, April 26, 2019 2:24 PM
- Marked as answer by Richard MuellerMVP Friday, May 3, 2019 1:19 PM
Friday, April 26, 2019 12:16 PM -
Also try asking here
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Richard MuellerMVP Friday, April 26, 2019 4:03 PM
- Marked as answer by Richard MuellerMVP Friday, May 3, 2019 1:19 PM
Friday, April 26, 2019 2:25 PM
All replies
-
This forum is for questions and discussions about the forums themselves. I would ask here:
https://social.msdn.microsoft.com/Forums/vstudio/en-us/home?forum=csharpgeneral
Richard Mueller - MVP Enterprise Mobility (Identity and Access)
- Edited by Richard MuellerMVP Friday, April 26, 2019 12:16 PM
- Proposed as answer by Dave PatrickMVP Friday, April 26, 2019 2:24 PM
- Marked as answer by Richard MuellerMVP Friday, May 3, 2019 1:19 PM
Friday, April 26, 2019 12:16 PM -
Also try asking here
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Richard MuellerMVP Friday, April 26, 2019 4:03 PM
- Marked as answer by Richard MuellerMVP Friday, May 3, 2019 1:19 PM
Friday, April 26, 2019 2:25 PM -
Thanks for updating meFriday, April 26, 2019 3:05 PM