From f3316ddcc3958b51010cf17abe04ead9708bb9f2 Mon Sep 17 00:00:00 2001 From: dmex04 Date: Fri, 2 Oct 2009 23:52:34 +0000 Subject: [PATCH] XP fix: AddERExcludedApplication now gets last error if it returns false. git-svn-id: svn://svn.code.sf.net/p/processhacker/code@2034 21ef857c-d57f-4fe0-8362-d861dc6d29cd --- trunk/ProcessHacker.Native/Api/Functions.cs | 2 +- trunk/ProcessHacker/Program/Program.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/trunk/ProcessHacker.Native/Api/Functions.cs b/trunk/ProcessHacker.Native/Api/Functions.cs index 828f23525..cc20a37c3 100644 --- a/trunk/ProcessHacker.Native/Api/Functions.cs +++ b/trunk/ProcessHacker.Native/Api/Functions.cs @@ -126,7 +126,7 @@ namespace ProcessHacker.Native.Api /// /// The process.exe or the path\process.exe to be excluded /// True if successfully excluded - [DllImport("faultrep.dll", CharSet = CharSet.Unicode)] + [DllImport("faultrep.dll", CharSet = CharSet.Unicode, SetLastError = true)] public static extern bool AddERExcludedApplication( [In] string ExeName ); diff --git a/trunk/ProcessHacker/Program/Program.cs b/trunk/ProcessHacker/Program/Program.cs index 82d094355..d5525cd26 100644 --- a/trunk/ProcessHacker/Program/Program.cs +++ b/trunk/ProcessHacker/Program/Program.cs @@ -131,7 +131,9 @@ namespace ProcessHacker { if (!Native.Api.Win32.AddERExcludedApplication(AppDomain.CurrentDomain.FriendlyName)) { - PhUtils.ShowWarning("Process Hacker was not excluded from Windows Error Reporting"); + PhUtils.ShowWarning( + "Process Hacker was not excluded from Windows Error Reporting: " + + Win32.GetLastErrorMessage()); } } else