@@ -621,6 +621,12 @@ internal override DynamicTraceEventData TryLookup(TraceEvent unknownEvent)
621621 /// </summary>
622622 internal static DynamicTraceEventData TryLookupWorker ( TraceEvent unknownEvent , Dictionary < MapKey , IDictionary < long , string > > mapTable = null )
623623 {
624+ // We are not able to handle WPP events in this parser.
625+ if ( unknownEvent . lookupAsWPP )
626+ {
627+ return null ;
628+ }
629+
624630 // Is this a TraceLogging style
625631 DynamicTraceEventData ret = null ;
626632
@@ -1192,7 +1198,7 @@ protected unsafe ExternalTraceEventParser(TraceEventSource source, bool dontRegi
11921198 parsedTemplate = TryLookup ( unknown ) ;
11931199 if ( parsedTemplate == null )
11941200 {
1195- m_state . m_templates . Add ( unknown . Clone ( ) , null ) ; // add an entry to remember that we tried and failed.
1201+ m_state . m_templates . Add ( unknown . CloneToTemplate ( ) , null ) ; // add an entry to remember that we tried and failed.
11961202 }
11971203 }
11981204 if ( parsedTemplate == null )
@@ -1369,7 +1375,6 @@ internal class TraceEventComparer : IEqualityComparer<TraceEvent>
13691375 {
13701376 public bool Equals ( TraceEvent x , TraceEvent y )
13711377 {
1372- Debug . Assert ( ! ( x . lookupAsWPP && x . lookupAsClassic ) ) ;
13731378 if ( x . lookupAsClassic != y . lookupAsClassic )
13741379 {
13751380 return false ;
@@ -1380,15 +1385,15 @@ public bool Equals(TraceEvent x, TraceEvent y)
13801385 return false ;
13811386 }
13821387
1383- if ( x . lookupAsClassic )
1388+ if ( x . lookupAsWPP )
13841389 {
13851390 Debug . Assert ( x . taskGuid != Guid . Empty && y . taskGuid != Guid . Empty ) ;
1386- return ( x . taskGuid == y . taskGuid ) && ( x . Opcode == y . Opcode ) ;
1391+ return ( x . taskGuid == y . taskGuid ) && ( x . ID == y . ID ) ;
13871392 }
1388- else if ( x . lookupAsWPP )
1393+ else if ( x . lookupAsClassic )
13891394 {
13901395 Debug . Assert ( x . taskGuid != Guid . Empty && y . taskGuid != Guid . Empty ) ;
1391- return ( x . taskGuid == y . taskGuid ) && ( x . ID == y . ID ) ;
1396+ return ( x . taskGuid == y . taskGuid ) && ( x . Opcode == y . Opcode ) ;
13921397 }
13931398 else
13941399 {
0 commit comments