Skip to content

Commit

Permalink
Update EventProvider.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
davmason committed Feb 16, 2023
1 parent d041560 commit 391ba78
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -800,11 +800,6 @@ protected override unsafe void HandleEnableNotification(
// change that needs more careful staging.
List<KeyValuePair<SessionInfo, bool>> sessionsChanged = GetChangedSessions();

if (sessionsChanged.Count == 0)
{
sessionsChanged.Add(new KeyValuePair<SessionInfo, bool>(new SessionInfo(0, 0), true));
}

foreach (KeyValuePair<SessionInfo, bool> session in sessionsChanged)
{
int sessionChanged = session.Key.sessionIdBit;
Expand Down Expand Up @@ -858,7 +853,8 @@ internal override unsafe void Register(EventSource eventSource)
_gcHandle = GCHandle.Alloc(this);

long registrationHandle = 0;
Guid providerId = eventSource.Guid;
_providerId = eventSource.Guid;
Guid providerId = _providerId;
uint status = Interop.Advapi32.EventRegister(
&providerId,
&Callback,
Expand All @@ -872,7 +868,6 @@ internal override unsafe void Register(EventSource eventSource)

Debug.Assert(_registrationHandle == 0);
_registrationHandle = registrationHandle;
_providerId = providerId;
}

// Unregister an event provider.
Expand Down

0 comments on commit 391ba78

Please sign in to comment.