internal bool Debug;
private bool DebugActivityId;
+ private const int DefaultAppDomainID = 1;
+
/// <summary>
/// Get callbacks when the ETW sends us commands`
/// </summary>
Level = EventLevel.Informational, Keywords = Keywords.TaskTransfer | Keywords.Tasks)]
public void TaskScheduled(
int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
- int TaskID, int CreatingTaskID, int TaskCreationOptions, int appDomain)
+ int TaskID, int CreatingTaskID, int TaskCreationOptions, int appDomain = DefaultAppDomainID)
{
// IsEnabled() call is an inlined quick check that makes this very fast when provider is off
if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.TaskTransfer | Keywords.Tasks))
// using the last 8 bytes as the provider GUID for this provider.
// These were generated by CreateGuid, and are reasonably random (and thus unlikley to collide
uint pid = EventSource.s_currentPid;
- int appDomainID = System.Threading.Thread.GetDomainID();
return new Guid(taskID,
- (short)appDomainID, (short)(appDomainID >> 16),
+ (short)DefaultAppDomainID, (short)(DefaultAppDomainID >> 16),
(byte)pid, (byte)(pid >> 8), (byte)(pid >> 16), (byte)(pid >> 24),
0xff, 0xdc, 0xd7, 0xb5);
}
Task currentTask = Task.InternalCurrent;
Task parentTask = m_contingentProperties?.m_parent;
etwLog.TaskScheduled(ts.Id, currentTask == null ? 0 : currentTask.Id,
- this.Id, parentTask == null ? 0 : parentTask.Id, (int)this.Options,
- System.Threading.Thread.GetDomainID());
+ this.Id, parentTask == null ? 0 : parentTask.Id, (int)this.Options);
return true;
}
else