Skip to content

Commit

Permalink
Abstractions UserGet catch Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
MutonUfoAI committed Aug 26, 2016
1 parent 8784440 commit 301af02
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pGina/src/Abstractions/WindowsApi/pInvokes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,15 @@ public static Boolean UserGet(string username, string domain, ref structenums.US
int lngReturn = SafeNativeMethods.NetUserGetInfo((String.IsNullOrEmpty(domain)) ? null : domain, username, 4, out bufPtr);
if (lngReturn == 0)
{
userinfo4 = (structenums.USER_INFO_4)Marshal.PtrToStructure(bufPtr, typeof(structenums.USER_INFO_4));
try
{
userinfo4 = (structenums.USER_INFO_4)Marshal.PtrToStructure(bufPtr, typeof(structenums.USER_INFO_4));
}
catch (Exception ex)
{
LibraryLogging.Error("UserGet Marshal.PtrToStructure error:{0}", ex.ToString());
return false;
}
}
else if (lngReturn == 2221)
{
Expand Down

0 comments on commit 301af02

Please sign in to comment.