ExitDbgEngNativeMode() public method

public ExitDbgEngNativeMode ( ) : void
return void
示例#1
0
文件: Report.cs 项目: tiandian/msos
        public void Execute(CommandExecutionContext context)
        {
            var reportDocument = new ReportDocument();

            var components = from type in Assembly.GetExecutingAssembly().GetTypes()
                             where type.GetInterface(typeof(IReportComponent).FullName) != null
                             where !type.IsAbstract
                             select(IReportComponent) Activator.CreateInstance(type);

            // Many commands require a DbgEng target to be available, so it makes sense to
            // initialize it early-on and use it across all components that need it.
            context.EnterDbgEngNativeMode();
            try
            {
                foreach (var component in components)
                {
                    if (component.Generate(context))
                    {
                        reportDocument.Components.Add(component);
                    }
                }
            }
            catch (Exception ex)
            {
                reportDocument.AnalysisResult = AnalysisResult.InternalError;
                reportDocument.AnalysisError  = ex.ToString();
            }
            context.ExitDbgEngNativeMode();

            reportDocument.AnalysisEndTime = DateTime.Now;

            string jsonReport = JsonConvert.SerializeObject(reportDocument, Formatting.Indented, new StringEnumConverter());

            File.WriteAllText(FileName, jsonReport);
        }
示例#2
0
文件: Quit.cs 项目: goldshtn/msos
 public void Execute(CommandExecutionContext context)
 {
     if (context.IsInDbgEngNativeMode)
     {
         context.ExitDbgEngNativeMode();
         context.WriteLine("Exited DbgEng mode; you are now back in msos.");
     }
     else
     {
         context.ShouldQuit = true;
     }
 }
示例#3
0
文件: Quit.cs 项目: tiandian/msos
 public void Execute(CommandExecutionContext context)
 {
     if (context.IsInDbgEngNativeMode)
     {
         context.ExitDbgEngNativeMode();
         context.WriteLine("Exited DbgEng mode; you are now back in msos.");
     }
     else
     {
         context.ShouldQuit = true;
     }
 }