-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update EventSource.xml #9247
Update EventSource.xml #9247
Conversation
Learn Build status updates of commit b8142a3: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Tagging subscribers to this area: @dotnet/area-system-diagnostics-tracing Issue DetailsClamp fileTime to > Jan 1st, 1601 SummaryDateTime.MinValue causes arg.ToFileTimeUtc() to throw an exception. When using mc.exe to translate a manifest specifying a Data element with inType="win:SYSTEMTIME" outType="xs:dateTime" to c# code, the generated code can handle DateTime.MinValue and it clamps the value to 0b11110000. However, when using EventRegister to convert an EventSource class to a manifest, the manifest it builds uses inType="win:FILETIME" for a parameter of type DateTime. Then, when using mc.exe to translate that manifest to c#, it generates the code specified in this documentation: long argFileTime = arg.ToFileTime(); Which causes the code using this class to throw an exception instead of acting how it did previously, which was having the datetime clamped to the earliest systemtime. Fixes #9246
|
CC @davmason |
@msnilsen - Thanks for investigating the issue and contributing a fix to the docs. Very much appreciated! |
Clamp fileTime to > Jan 1st, 1601
Learn Build status updates of commit e4b7c36: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Thanks! Looks good to me outside of Tarek's feedback |
Clamp fileTime to > Jan 1st, 1601
Summary
DateTime.MinValue causes arg.ToFileTimeUtc() to throw an exception.
When using mc.exe to translate a manifest specifying a Data element with inType="win:SYSTEMTIME" outType="xs:dateTime" to c# code, the generated code can handle DateTime.MinValue and it clamps the value to 0b11110000.
However, when using EventRegister to convert an EventSource class to a manifest, the manifest it builds uses inType="win:FILETIME" for a parameter of type DateTime. Then, when using mc.exe to translate that manifest to c#, it generates the code specified in this documentation:
long argFileTime = arg.ToFileTime();
userDataPtr[0].DataPointer = (UInt64)(&argFileTime);
userDataPtr[0].Size = (uint)(sizeof(long));
Which causes the code using this class to throw an exception instead of acting how it did previously, which was having the datetime clamped to the earliest systemtime.
Fixes #9246