#endif
{
[StructLayout(LayoutKind.Explicit, Size = 16)]
-#if !CORECLR && !ES_BUILD_PN
+#if ES_BUILD_STANDALONE
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
-#endif // !CORECLR && !ES_BUILD_PN
+#endif
/*
EventDescriptor was public in the separate System.Diagnostics.Tracing assembly(pre NS2.0),
/// Only here because System.Diagnostics.EventProvider needs one more extensibility hook (when it gets a
/// controller callback)
/// </summary>
-#if !CORECLR && !ES_BUILD_PN
+#if ES_BUILD_STANDALONE
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
-#endif // !CORECLR && !ES_BUILD_PN
+#endif
internal partial class EventProvider : IDisposable
{
// This is the windows EVENT_DATA_DESCRIPTOR structure. We expose it because this is what
int etwSessionId;
if (int.TryParse(strId, out etwSessionId))
{
+#if ES_BUILD_STANDALONE
// we need to assert this permission for partial trust scenarios
(new RegistryPermission(RegistryPermissionAccess.Read, regKey)).Assert();
+#endif
var data = key.GetValue(valueName) as byte[];
if (data != null)
{
string valueName = "ControllerData_Session_" + etwSessionId.ToString(CultureInfo.InvariantCulture);
// we need to assert this permission for partial trust scenarios
-#if !CORECLR
+#if ES_BUILD_STANDALONE
(new RegistryPermission(RegistryPermissionAccess.Read, regKey)).Assert();
#endif
using (var key = Registry.LocalMachine.OpenSubKey(regKey))
using System.Reflection;
using System.Resources;
using System.Security;
-#if !CORECLR && !ES_BUILD_PN
+#if ES_BUILD_STANDALONE
using System.Security.Permissions;
-#endif // !CORECLR && !ES_BUILD_PN
+#endif
using System.Text;
using System.Threading;
}
if (s_currentPid == 0)
{
-#if ES_BUILD_STANDALONE && !ES_BUILD_PCL && !CORECLR
+#if ES_BUILD_STANDALONE
// for non-BCL EventSource we must assert SecurityPermission
new SecurityPermission(PermissionState.Unrestricted).Assert();
#endif
// RET
//
// If we find this pattern we return the XXX. Otherwise we return -1.
-#if !CORECLR
+#if ES_BUILD_STANDALONE
(new ReflectionPermission(ReflectionPermissionFlag.MemberAccess)).Assert();
#endif
byte[] instrs = method.GetMethodBody().GetILAsByteArray();
}
}
-// Defining some no-ops in PCL builds
-#if ES_BUILD_PCL
-namespace System.Security
-{
- class SuppressUnmanagedCodeSecurityAttribute : Attribute { }
-
- enum SecurityAction { Demand }
-}
-
-namespace System.Security.Permissions
-{
- class HostProtectionAttribute : Attribute { public bool MayLeakOnAbort { get; set; } }
- class PermissionSetAttribute : Attribute
- {
- public PermissionSetAttribute(System.Security.SecurityAction action) { }
- public bool Unrestricted { get; set; }
- }
-}
-#endif
-
#if ES_BUILD_STANDALONE
namespace Microsoft.Win32
{