Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConvertSdToSddl()

static int System.Security.AccessControl.Win32.ConvertSdToSddl ( byte[] binaryForm,
int requestedRevision,
SecurityInfos si,
out string resultSddl )
inlinestaticpackage

Definition at line 8 of file Win32.cs.

9 {
10 uint resultStringLength = 0u;
11 if (!global::Interop.Advapi32.ConvertSdToStringSd(binaryForm, (uint)requestedRevision, (uint)si, out var resultString, ref resultStringLength))
12 {
13 int lastWin32Error = Marshal.GetLastWin32Error();
14 resultSddl = null;
15 if (lastWin32Error == 8)
16 {
17 throw new OutOfMemoryException();
18 }
19 return lastWin32Error;
20 }
21 resultSddl = Marshal.PtrToStringUni(resultString);
22 Marshal.FreeHGlobal(resultString);
23 return 0;
24 }
static void FreeHGlobal(IntPtr hglobal)
Definition Marshal.cs:1680
static unsafe? string PtrToStringUni(IntPtr ptr)
Definition Marshal.cs:652

References System.Runtime.InteropServices.Marshal.FreeHGlobal(), System.Runtime.InteropServices.Marshal.GetLastWin32Error(), and System.Runtime.InteropServices.Marshal.PtrToStringUni().

Referenced by System.Security.AccessControl.GenericSecurityDescriptor.GetSddlForm().