From f039d3f6282f4e418d0967dfa1949ca277925ceb Mon Sep 17 00:00:00 2001 From: wj32 Date: Tue, 2 Dec 2008 07:46:05 +0000 Subject: [PATCH] don't throw exception unless really needed in GetAccountName git-svn-id: svn://svn.code.sf.net/p/processhacker/code@197 21ef857c-d57f-4fe0-8362-d861dc6d29cd --- trunk/ProcessHacker/Win32.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trunk/ProcessHacker/Win32.cs b/trunk/ProcessHacker/Win32.cs index 246b01c62..1a4c55d19 100644 --- a/trunk/ProcessHacker/Win32.cs +++ b/trunk/ProcessHacker/Win32.cs @@ -1913,7 +1913,10 @@ namespace ProcessHacker domain.EnsureCapacity(domainlen); if (LookupAccountSid(0, SID, name, ref namelen, domain, ref domainlen, ref use) == 0) - throw new Exception("Could not lookup account SID: " + Win32.GetLastErrorMessage()); + { + if (name.ToString() == "" && domain.ToString() == "") + throw new Exception("Could not lookup account SID: " + Win32.GetLastErrorMessage()); + } } if (IncludeDomain)