Esempio n. 1
0
        public static void Create(string path = null, DumpLevel level = DumpLevel.Minimal)
        {
            var executable = typeof(Minidump).Assembly.GetName().Name + ".exe";
            var arguments  = $"\"{path}\" --level {level}";
            var process    = Process.Start(executable, arguments);

            Debug.Assert(process != null, nameof(process) + " != null");
            process.WaitForExit();
        }
 /// <summary>
 /// Dump messages using the existing handler.
 /// If no handler exists, no action would be taken.
 /// </summary>
 /// <param name="messageName">Name of the message</param>
 /// <param name="messageDescription">Description of the message</param>
 /// <param name="dumpLevel">Dump Level</param>
 /// <param name="payload">A byte array representing
 /// the real data of the message</param>
 public static void OnDumpMessage(string messageName,
                                  string messageDescription,
                                  DumpLevel dumpLevel,
                                  byte[] payload)
 {
     if (DumpMessage != null)
     {
         DumpMessage(messageName, messageDescription,
                     dumpLevel, payload);
     }
 }
 /// <summary>
 /// Dumps network message to ETW provider.
 /// </summary>
 /// <param name="messageName">The Name of the Message. In format protocol:message</param>
 /// <param name="dumpLevel">An enum indicating whether this message is a complete message on the wire or only part of the encrypted structure.</param>
 /// <param name="comments">Some comments about the dumped message.</param>
 /// <param name="payload">The byte array to dump.</param>
 public static void DumpMessage(string messageName, DumpLevel dumpLevel, string comments, byte[] payload)
 {
     ExtendedLoggerConfig.TestSuiteEvents.EventWriteRawMessage(
         ExtendedLoggerConfig.TestSuiteName,
         ExtendedLoggerConfig.CaseName,
         messageName,
         (ushort)dumpLevel,
         comments,
         (ushort)payload.Length,
         payload
         );
 }
Esempio n. 4
0
 /// <summary>
 /// Dumps network message to ETW provider.
 /// </summary>
 /// <param name="messageName">The Name of the Message. In format protocol:message</param>
 /// <param name="dumpLevel">An enum indicating whether this message is a complete message on the wire or only part of the encrypted structure.</param>
 /// <param name="comments">Some comments about the dumped message.</param>
 /// <param name="payload">The byte array to dump.</param>
 static public void DumpMessage(string messageName, DumpLevel dumpLevel, string comments, byte[] payload)
 {
     ExtendedLoggerConfig.TestSuiteEvents.EventWriteRawMessage(
         ExtendedLoggerConfig.TestSuiteName,
         ExtendedLoggerConfig.CaseName,
         messageName,
         (ushort)dumpLevel,
         comments,
         (ushort)payload.Length,
         payload
         );
 }
Esempio n. 5
0
 public static void Create(string path = null, DumpLevel level = DumpLevel.Minimal)
 {
     try
     {
         var executable = typeof(Minidump).Assembly.Location;
         var arguments  = $"\"{path}\" --level {level}";
         var startInfo  = new ProcessStartInfo(executable, arguments)
         {
             UseShellExecute = false
         };
         var process = Process.Start(startInfo);
         Debug.Assert(process != null, nameof(process) + " != null");
         process.WaitForExit();
     }
     catch (Exception)
     {
         // we do not want a recursive minidump here, ignore this exception
     }
 }