Ejemplo n.º 1
0
 public System.Boolean WriteEvent(System.Diagnostics.Eventing.EventDescriptor eventDescriptor, System.String data)
 //QC   Intervals :(System.Diagnostics.Eventing.EventDescriptor) System.Diagnostics.Eventing.EventProvider.WriteEvent.eventDescriptor Interval   0 :         null : null
 //QC             :                                                                                                                   Interval   1 :          new : new
 //QC   Intervals :(System.String) System.Diagnostics.Eventing.EventProvider.WriteEvent.data Interval   0 :         null : null
 //QC             :                                                                          Interval   1 :          new : new
 {
     return(true);
 }
Ejemplo n.º 2
0
 public System.Boolean WriteEvent(ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, int dataCount, IntPtr ppCall)
 //QC   Intervals :(System.Diagnostics.Eventing.EventDescriptor) System.Diagnostics.Eventing.EventProvider.WriteEvent.eventDescriptor Interval   0 :         null : null
 //QC             :                                                                                                                   Interval   1 :          new : new
 //QC   Intervals :(System.Object[]) System.Diagnostics.Eventing.EventProvider.WriteEvent.eventPayload Interval   0 :         null : null
 //QC             :                                                                                    Interval   1 :          new : new
 {
     return(true);
 }
Ejemplo n.º 3
0
 public System.Boolean WriteTransferEvent(System.Diagnostics.Eventing.EventDescriptor eventDescriptor, System.Guid relatedActivityId, System.Object[] eventPayload)
 //QC   Intervals :(System.Diagnostics.Eventing.EventDescriptor) System.Diagnostics.Eventing.EventProvider.WriteTransferEvent.eventDescriptor Interval   0 :         null : null
 //QC             :                                                                                                                           Interval   1 :          new : new
 //QC   Intervals :(System.Guid) System.Diagnostics.Eventing.EventProvider.WriteTransferEvent.relatedActivityId Interval   0 :         null : null
 //QC             :                                                                                             Interval   1 :          new : new
 //QC   Intervals :(System.Object[]) System.Diagnostics.Eventing.EventProvider.WriteTransferEvent.eventPayload Interval   0 :         null : null
 //QC             :                                                                                            Interval   1 :          new : new
 {
     return(true);
 }
Ejemplo n.º 4
0
        protected unsafe bool WriteTransferEvent(ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, Guid relatedActivityId, int dataCount, IntPtr data)
        {
            uint num        = 0;
            Guid activityId = GetActivityId();

            num = Microsoft.Win32.UnsafeNativeMethods.EventWriteTransfer(this.m_regHandle, ref eventDescriptor, (activityId == Guid.Empty) ? null : &activityId, &relatedActivityId, (uint)dataCount, (void *)data);
            if (num != 0)
            {
                SetLastError((int)num);
                return(false);
            }
            return(true);
        }
        protected unsafe void WriteEventCore(
            System.Diagnostics.Eventing.EventDescriptor eventId,
            uint eventDataCount, EventData *data)
        {
            if (!isProviderEnabled)
            {
                return;
            }

            uint result = UnsafeNativeMethods.EventWrite(traceRegistrationHandle,
                                                         ref eventId, eventDataCount, data);

            if (result != 0)
            {
                throw new InvalidOperationException("Exception while trying to write a message");
            }
        }
Ejemplo n.º 6
0
        public unsafe bool WriteEvent(ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, string data)
        {
            uint num = 0;

            if (data == null)
            {
                throw new ArgumentNullException("dataString");
            }
            if (this.IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
            {
                EventData data2;
                if (data.Length > 0x7fd4)
                {
                    t_returnCode = WriteEventErrorCode.EventTooBig;
                    return(false);
                }
                data2.Size     = (uint)((data.Length + 1) * 2);
                data2.Reserved = 0;

                /* TODO: REVIEW:
                 * fixed (char* str = ((char*) data))
                 * {
                 * char* chPtr = str;
                 * Guid activityId = GetActivityId();
                 *      data2.DataPointer = (ulong) chPtr;
                 * if (s_preWin7)
                 * {
                 * num = Microsoft.Win32.UnsafeNativeMethods.EventWrite(this.m_regHandle, ref eventDescriptor, 1, (void*) &data2);
                 * }
                 * else
                 * {
                 * num = Microsoft.Win32.UnsafeNativeMethods.EventWriteTransfer(this.m_regHandle, ref eventDescriptor, (activityId == Guid.Empty) ? null : &activityId, null, 1, (void*) &data2);
                 * }
                 * }
                 */
            }
            if (num != 0)
            {
                SetLastError((int)num);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 7
0
 internal static extern int EventEnabled([In] long registrationHandle, [In] ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor);
Ejemplo n.º 8
0
 public bool WriteEvent(ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, string data)
 {
     throw null;
 }
Ejemplo n.º 9
0
 public bool WriteEvent(ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, params object[] eventPayload)
 {
     throw null;
 }
Ejemplo n.º 10
0
 protected bool WriteEvent(ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, int dataCount, System.IntPtr data)
 {
     throw null;
 }
Ejemplo n.º 11
0
 public bool WriteTransferEvent(ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, System.Guid relatedActivityId, params object[] eventPayload)
 {
     throw null;
 }
Ejemplo n.º 12
0
 protected bool WriteTransferEvent(ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, System.Guid relatedActivityId, int dataCount, System.IntPtr data)
 {
     throw null;
 }
Ejemplo n.º 13
0
        public unsafe bool WriteTransferEvent(ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, Guid relatedActivityId, params object[] eventPayload)
        {
            uint num = 0;

            if (this.IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
            {
                Guid       activityId     = GetActivityId();
                int        length         = 0;
                EventData *dataDescriptor = null;
                if ((eventPayload != null) && (eventPayload.Length != 0))
                {
                    length = eventPayload.Length;
                    if (length > 0x20)
                    {
                        throw new ArgumentOutOfRangeException("eventPayload", System.SR.GetString("ArgumentOutOfRange_MaxArgExceeded", new object[] { 0x20 }));
                    }
                    uint       num3     = 0;
                    int        index    = 0;
                    int[]      numArray = new int[8];
                    string[]   strArray = new string[8];
                    EventData *dataPtr2 = (EventData *)stackalloc byte[(((IntPtr)length) * sizeof(EventData))];
                    dataDescriptor = dataPtr2;
                    byte *dataBuffer = stackalloc byte[(IntPtr)(0x10 * length)];
                    for (int i = 0; i < eventPayload.Length; i++)
                    {
                        string str = EncodeObject(ref eventPayload[i], dataDescriptor, dataBuffer);
                        dataBuffer += 0x10;
                        num3       += dataDescriptor->Size;
                        dataDescriptor++;
                        if (str != null)
                        {
                            if (index >= 8)
                            {
                                throw new ArgumentOutOfRangeException("eventPayload", System.SR.GetString("ArgumentOutOfRange_MaxStringsExceeded", new object[] { 8 }));
                            }
                            strArray[index] = str;
                            numArray[index] = i;
                            index++;
                        }
                    }
                    if (num3 > 0xffca)
                    {
                        Thread.SetData(s_returnCodeSlot, 2);
                        return(false);
                    }

                    fixed(char *str2 = ((char *)strArray[0]))
                    {
                        char *chPtr = str2;

                        fixed(char *str3 = ((char *)strArray[1]))
                        {
                            char *chPtr2 = str3;

                            fixed(char *str4 = ((char *)strArray[2]))
                            {
                                char *chPtr3 = str4;

                                fixed(char *str5 = ((char *)strArray[3]))
                                {
                                    char *chPtr4 = str5;

                                    fixed(char *str6 = ((char *)strArray[4]))
                                    {
                                        char *chPtr5 = str6;

                                        fixed(char *str7 = ((char *)strArray[5]))
                                        {
                                            char *chPtr6 = str7;

                                            fixed(char *str8 = ((char *)strArray[6]))
                                            {
                                                char *chPtr7 = str8;

                                                fixed(char *str9 = ((char *)strArray[7]))
                                                {
                                                    char *chPtr8 = str9;

                                                    dataDescriptor = dataPtr2;
                                                    if (strArray[0] != null)
                                                    {
                                                        dataDescriptor[numArray[0]].DataPointer = (ulong)chPtr;
                                                    }
                                                    if (strArray[1] != null)
                                                    {
                                                        dataDescriptor[numArray[1]].DataPointer = (ulong)chPtr2;
                                                    }
                                                    if (strArray[2] != null)
                                                    {
                                                        dataDescriptor[numArray[2]].DataPointer = (ulong)chPtr3;
                                                    }
                                                    if (strArray[3] != null)
                                                    {
                                                        dataDescriptor[numArray[3]].DataPointer = (ulong)chPtr4;
                                                    }
                                                    if (strArray[4] != null)
                                                    {
                                                        dataDescriptor[numArray[4]].DataPointer = (ulong)chPtr5;
                                                    }
                                                    if (strArray[5] != null)
                                                    {
                                                        dataDescriptor[numArray[5]].DataPointer = (ulong)chPtr6;
                                                    }
                                                    if (strArray[6] != null)
                                                    {
                                                        dataDescriptor[numArray[6]].DataPointer = (ulong)chPtr7;
                                                    }
                                                    if (strArray[7] != null)
                                                    {
                                                        dataDescriptor[numArray[7]].DataPointer = (ulong)chPtr8;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }

                    str4 = null;
                    str5 = null;
                    str6 = null;
                    str7 = null;
                    str8 = null;
                    str9 = null;
                }
                if ((relatedActivityId == Guid.Empty) && s_preWin7)
                {
                    num = Microsoft.Win32.UnsafeNativeMethods.EventWrite(this.m_regHandle, ref eventDescriptor, (uint)length, (void *)dataDescriptor);
                }
                else
                {
                    num = Microsoft.Win32.UnsafeNativeMethods.EventWriteTransfer(this.m_regHandle, ref eventDescriptor, (activityId == Guid.Empty) ? null : &activityId, ((relatedActivityId == Guid.Empty) && !s_preWin7) ? null : &relatedActivityId, (uint)length, (void *)dataDescriptor);
                }
            }
            if (num != 0)
            {
                SetLastError((int)num);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 14
0
 public bool WriteEvent(ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor, params object[] eventPayload)
 {
     return(this.WriteTransferEvent(ref eventDescriptor, Guid.Empty, eventPayload));
 }
 internal static extern unsafe uint EventWrite(
     [In] UInt64 registrationHandle,
     [In] ref System.Diagnostics.Eventing.EventDescriptor eventDescriptor,
     [In] uint userDataCount,
     [In] EventData *userData);