Exemplo n.º 1
0
 private static void SetBucketParameter(
     WindowsErrorReporting.ReportHandle reportHandle,
     WindowsErrorReporting.BucketParameterId bucketParameterId,
     string value)
 {
     WindowsErrorReporting.HandleHResult(WindowsErrorReporting.NativeMethods.WerReportSetParameter(reportHandle, bucketParameterId, bucketParameterId.ToString(), value));
 }
Exemplo n.º 2
0
 internal static extern int WerReportAddDump(
     WindowsErrorReporting.ReportHandle reportHandle,
     IntPtr hProcess,
     IntPtr hThread,
     WindowsErrorReporting.DumpType dumpType,
     IntPtr pExceptionParam,
     IntPtr dumpCustomOptions,
     WindowsErrorReporting.DumpFlags dumpFlags);
Exemplo n.º 3
0
        private static void SetBucketParameters(
            WindowsErrorReporting.ReportHandle reportHandle,
            Exception uncaughtException)
        {
            Exception exception = uncaughtException;

            while (exception.InnerException != null)
            {
                exception = exception.InnerException;
            }
            WindowsErrorReporting.SetBucketParameter(reportHandle, WindowsErrorReporting.BucketParameterId.NameOfExe, WindowsErrorReporting.TruncateExeName(WindowsErrorReporting.nameOfExe, 20));
            WindowsErrorReporting.SetBucketParameter(reportHandle, WindowsErrorReporting.BucketParameterId.FileVersionOfSystemManagementAutomation, WindowsErrorReporting.TruncateBucketParameter(WindowsErrorReporting.versionOfPowerShellLibraries, 16));
            WindowsErrorReporting.SetBucketParameter(reportHandle, WindowsErrorReporting.BucketParameterId.InnermostExceptionType, WindowsErrorReporting.TruncateExceptionType(exception.GetType().FullName, 40));
            WindowsErrorReporting.SetBucketParameter(reportHandle, WindowsErrorReporting.BucketParameterId.OutermostExceptionType, WindowsErrorReporting.TruncateExceptionType(uncaughtException.GetType().FullName, 40));
            WindowsErrorReporting.SetBucketParameter(reportHandle, WindowsErrorReporting.BucketParameterId.DeepestFrame, WindowsErrorReporting.GetDeepestFrame(uncaughtException, 50));
            WindowsErrorReporting.SetBucketParameter(reportHandle, WindowsErrorReporting.BucketParameterId.DeepestPowerShellFrame, WindowsErrorReporting.GetDeepestPowerShellFrame(uncaughtException, 50));
            WindowsErrorReporting.SetBucketParameter(reportHandle, WindowsErrorReporting.BucketParameterId.ThreadName, WindowsErrorReporting.TruncateBucketParameter(WindowsErrorReporting.GetThreadName(), 20));
        }
Exemplo n.º 4
0
 internal static extern int WerReportSubmit(WindowsErrorReporting.ReportHandle reportHandle, WindowsErrorReporting.Consent consent, WindowsErrorReporting.SubmitFlags flags, out WindowsErrorReporting.SubmitResult result);
Exemplo n.º 5
0
 internal static extern int WerReportSetParameter(WindowsErrorReporting.ReportHandle reportHandle, WindowsErrorReporting.BucketParameterId bucketParameterId, [MarshalAs(UnmanagedType.LPWStr)] string name, [MarshalAs(UnmanagedType.LPWStr)] string value);
Exemplo n.º 6
0
 internal static extern int WerReportCreate([MarshalAs(UnmanagedType.LPWStr)] string pwzEventType, WindowsErrorReporting.ReportType repType, [MarshalAs(UnmanagedType.LPStruct)] WindowsErrorReporting.ReportInformation reportInformation, out WindowsErrorReporting.ReportHandle reportHandle);