1

Closed

Trace flags are not properly evaluated for short-cutting

description

Hi,
 
First of all thanks for the great project!
 
Now for my question, on line 149 in the "Trace" function within the ClassicProvider class I found the following if-statement:
 
 
if (!this.enabled ||
(this.Flags & traceFlags) != traceFlags ||
 this.Level <= traceLevel)
 
 
Isn't the first function argument (EtwTraceFlag traceFlag) supposed to be used in the second line of this expression instead of the class variable traceFlags? "this.Flags" is a property that returns "this.traceFlags", so "(this.Flags & traceFlags)" will obviously result in just the value of "this.traceFlags" and thus the 'does not equal' expression will always return false since the same variables are being compared.
 
 
if(!this.enabled ||
(this.Flags & traceFlag) != traceFlag ||
this.Level <= traceLevel)
Closed Dec 2, 2009 at 9:51 PM by ahopper
Fixed by change 40740.

comments