Exemplo n.º 1
0
        internal static void AppDomainUnhandledException(
            object sender,
            UnhandledExceptionEventArgs args)
        {
            Exception  exceptionObject = (Exception)args.ExceptionObject;
            IETWTracer etwTracer       = PSETWTracerFactory.GetETWTracer(PSKeyword.ManagedPlugin);

            etwTracer.OperationalChannel.WriteError(PSEventId.AppDomainUnhandledException, PSOpcode.Close, PSTask.None, (object)exceptionObject.GetType().ToString(), (object)exceptionObject.Message, (object)exceptionObject.StackTrace);
            etwTracer.AnalyticChannel.WriteError(PSEventId.AppDomainUnhandledException_Analytic, PSOpcode.Close, PSTask.None, (object)exceptionObject.GetType().ToString(), (object)exceptionObject.Message, (object)exceptionObject.StackTrace);
        }
Exemplo n.º 2
0
 private void WriteCurrentFragmentAndReset()
 {
     using (IETWTracer etwTracer = PSETWTracerFactory.GetETWTracer(PSKeyword.Transport))
     {
         etwTracer.AnalyticChannel.WriteVerbose(PSEventId.SentRemotingFragment, PSOpcode.Send, PSTask.None, (object)this.currentFragment.ObjectId, (object)this.currentFragment.FragmentId, (object)(this.currentFragment.IsStartFragment ? 1 : 0), (object)(this.currentFragment.IsEndFragment ? 1 : 0), (object)(uint)this.currentFragment.BlobLength, (object)new PSETWBinaryBlob(this.currentFragment.Blob, 0, this.currentFragment.BlobLength));
         byte[] bytes  = this.currentFragment.GetBytes();
         int    length = bytes.Length;
         int    offset = 0;
         if (!this.notifyOnWriteFragmentImmediately)
         {
             lock (this.syncObject)
             {
                 if (this.isDisposed)
                 {
                     return;
                 }
                 if (this.writeStream == null)
                 {
                     this.writeStream = new MemoryStream(this.fragmentSize);
                     SerializedDataStream._trace.WriteLine("Created write stream: {0}", (object)this.writeStream.GetHashCode());
                     this.writeOffset = 0;
                 }
                 while (length > 0)
                 {
                     int num = this.writeStream.Capacity - this.writeOffset;
                     if (num == 0)
                     {
                         this.EnqueueWriteStream();
                         num = this.writeStream.Capacity - this.writeOffset;
                     }
                     int count = length > num ? num : length;
                     length -= count;
                     this.writeStream.Position = (long)this.writeOffset;
                     this.writeStream.Write(bytes, offset, count);
                     offset           += count;
                     this.writeOffset += count;
                     this.length      += (long)count;
                 }
             }
         }
         if (this.onDataAvailableCallback != null)
         {
             this.onDataAvailableCallback(bytes, this.currentFragment.IsEndFragment);
         }
         this.currentFragment.FragmentId      = ++this.fragmentId;
         this.currentFragment.IsStartFragment = false;
         this.currentFragment.IsEndFragment   = false;
         this.currentFragment.BlobLength      = 0;
         this.currentFragment.Blob            = new byte[this.fragmentSize];
     }
 }
Exemplo n.º 3
0
 private void ReportExceptionForETW(XmlException exception)
 {
     using (IETWTracer etwTracer = PSETWTracerFactory.GetETWTracer(PSKeyword.Serializer))
         etwTracer.AnalyticChannel.WriteError(PSEventId.Serializer_XmlExceptionWhenDeserializing, PSOpcode.Exception, PSTask.Serialization, (object)exception.LineNumber, (object)exception.LinePosition, (object)exception.ToString());
 }