1 //------------------------------------------------------------------------------
2 // <copyright file="etwprovider.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //------------------------------------------------------------------------------
7 using System.Runtime.InteropServices;
8 using System.Diagnostics.CodeAnalysis;
10 namespace System.Diagnostics.Eventing
12 [StructLayout(LayoutKind.Explicit, Size = 16)]
13 [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
14 public struct EventDescriptor
19 private byte m_version;
21 private byte m_channel;
25 private byte m_opcode;
27 private ushort m_task;
29 private long m_keywords;
31 [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]
32 public EventDescriptor(
44 throw new ArgumentOutOfRangeException("id", SR.GetString(SR.ArgumentOutOfRange_NeedNonNegNum));
47 if (id > ushort.MaxValue)
49 throw new ArgumentOutOfRangeException("id", SR.GetString(SR.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue));
57 m_keywords = keywords;
61 throw new ArgumentOutOfRangeException("task", SR.GetString(SR.ArgumentOutOfRange_NeedNonNegNum));
64 if (task > ushort.MaxValue)
66 throw new ArgumentOutOfRangeException("task", SR.GetString(SR.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue));
69 m_task = (ushort)task;
101 [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")]