// Set m_provider, which allows this.
m_provider = provider;
-#if (!ES_BUILD_STANDALONE && !ES_BUILD_PN && !PLATFORM_UNIX)
+#if PLATFORM_WINDOWS
+#if (!ES_BUILD_STANDALONE && !ES_BUILD_PN)
// API available on OS >= Win 8 and patched Win 7.
// Disable only for FrameworkEventSource to avoid recursion inside exception handling.
if (this.Name != "System.Diagnostics.Eventing.FrameworkEventSource" || Environment.IsWindows8OrAbove)
metadataHandle.Free();
}
+#endif // PLATFORM_WINDOWS
#endif // FEATURE_MANAGED_ETW
Debug.Assert(!m_eventSourceEnabled); // We can't be enabled until we are completely initted.
public static void SetCurrentThreadActivityId(Guid activityId, out Guid oldActivityThatWillContinue)
{
oldActivityThatWillContinue = activityId;
-#if FEATURE_MANAGED_ETW
+#if FEATURE_MANAGED_ETW && PLATFORM_WINDOWS
// We ignore errors to keep with the convention that EventSources do not throw errors.
// Note we can't access m_throwOnWrites because this is a static method.
UnsafeNativeMethods.ManifestEtw.EventActivityIdControl(
UnsafeNativeMethods.ManifestEtw.ActivityControl.EVENT_ACTIVITY_CTRL_GET_SET_ID,
ref oldActivityThatWillContinue);
-#endif // FEATURE_MANAGED_ETW
+#endif // FEATURE_MANAGED_ETW && PLATFORM_WINDOWS
// We don't call the activityDying callback here because the caller has declared that
// it is not dying.
// We ignore errors to keep with the convention that EventSources do not throw
// errors. Note we can't access m_throwOnWrites because this is a static method.
Guid retVal = new Guid();
-#if FEATURE_MANAGED_ETW
+#if FEATURE_MANAGED_ETW && PLATFORM_WINDOWS
UnsafeNativeMethods.ManifestEtw.EventActivityIdControl(
UnsafeNativeMethods.ManifestEtw.ActivityControl.EVENT_ACTIVITY_CTRL_GET_ID,
ref retVal);
-#endif // FEATURE_MANAGED_ETW
+#endif // FEATURE_MANAGED_ETW && PLATFORM_WINDOWS
return retVal;
}
}