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
This commit is contained in:
wj32
2008-12-02 07:46:05 +00:00
parent 1f1f2cc38a
commit f039d3f628
+4 -1
View File
@@ -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)