protected override void WriteReportTypeSpecificSection(XmlWriter reportFile) { using (new SafeXmlTag(reportFile, "exception-report").WithAttribute("is-clr-terminating", base.IsFlagSet(ReportOptions.ReportTerminateAfterSend) ? "1" : "0")) { using (new SafeXmlTag(reportFile, "application").WithAttribute("name", base.AppName).WithAttribute("version", WatsonReport.ExchangeFormattedVersion(base.AppVersion))) { } using (new SafeXmlTag(reportFile, "assembly").WithAttribute("name", base.BucketingParameter <WatsonExceptionReport.BucketParamId>(WatsonExceptionReport.BucketParamId.AssemblyName)).WithAttribute("version", base.BucketingParameter <WatsonExceptionReport.BucketParamId>(WatsonExceptionReport.BucketParamId.AssemblyVer))) { } using (SafeXmlTag safeXmlTag4 = new SafeXmlTag(reportFile, "exception")) { safeXmlTag4.SetContent(WatsonReport.SanitizeException(this.exception.ToString())); } using (new SafeXmlTag(reportFile, "base-exception").WithAttribute("target-site", this.baseExceptionTargetSite).WithAttribute("assembly-name", this.baseExceptionAssemblyName).WithAttribute("method-name", this.baseExceptionMethodName)) { } using (SafeXmlTag safeXmlTag6 = new SafeXmlTag(reportFile, "process").WithAttribute("eip", "0x" + ((IntPtr.Size == 4) ? this.exceptionEIP.ToString("x8") : this.exceptionEIP.ToString("x16"))).WithAttribute("bitness", (IntPtr.Size * 8).ToString()).WithAttribute("pid", base.ProcessId.ToString())) { if (base.ProcessId == DiagnosticsNativeMethods.GetCurrentProcessId()) { safeXmlTag6.WithAttribute("managed-tid", Environment.CurrentManagedThreadId.ToString()).WithAttribute("native-tid", DiagnosticsNativeMethods.GetCurrentThreadId().ToString()); } } if (this.lids != null) { using (SafeXmlTag safeXmlTag7 = new SafeXmlTag(reportFile, "location-ids")) { safeXmlTag7.SetContent(this.lids); } } } }
protected override void BeforeSubmit() { if (base.ProcessId != DiagnosticsNativeMethods.GetCurrentProcessId()) { try { this.debugPrivilege = new Privilege("SeDebugPrivilege"); this.debugPrivilege.Enable(); } catch { } } base.IsFlagSet(ReportOptions.DoNotFreezeThreads); }