Skip to content

Commit

Permalink
Changed to using the real win32 last error
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranid committed Mar 13, 2019
1 parent 08415ee commit d74e1fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NtApiDotNet/NtSecurity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public static string SecurityDescriptorToSddl(byte[] sd, SecurityInformation sec
if (!Win32NativeMethods.ConvertSecurityDescriptorToStringSecurityDescriptor(sd,
1, security_information, out SafeLocalAllocHandle handle, out int return_length))
{
throw new NtException(NtStatus.STATUS_INVALID_SID);
throw new NtException(NtObjectUtils.MapDosErrorToStatus());
}

using (handle)
Expand All @@ -395,7 +395,7 @@ public static byte[] SddlToSecurityDescriptor(string sddl)
if (!Win32NativeMethods.ConvertStringSecurityDescriptorToSecurityDescriptor(sddl, 1,
out SafeLocalAllocHandle handle, out int return_length))
{
throw new NtException(NtStatus.STATUS_INVALID_SID);
throw new NtException(NtObjectUtils.MapDosErrorToStatus());
}

using (handle)
Expand All @@ -416,7 +416,7 @@ public static Sid SidFromSddl(string sddl)
{
if (!Win32NativeMethods.ConvertStringSidToSid(sddl, out SafeLocalAllocHandle handle))
{
throw new NtException(NtStatus.STATUS_INVALID_SID);
throw new NtException(NtObjectUtils.MapDosErrorToStatus());
}
using (handle)
{
Expand Down

0 comments on commit d74e1fc

Please sign in to comment.