public static SECURITY_DESCRIPTOR RealToSecurityDescriptor(SECURITY_DESCRIPTOR_REAL sr) { SECURITY_DESCRIPTOR RealToSecurityDescriptorRet = default; var sd = NewSecurityDescriptor(); Marshal.StructureToPtr(sr.Sacl, sd.Sacl, false); Marshal.StructureToPtr(sr.Dacl, sd.Dacl, false); RealToSecurityDescriptorRet = sd; return(RealToSecurityDescriptorRet); }
public static SECURITY_DESCRIPTOR_REAL SecurityDescriptorToReal(SECURITY_DESCRIPTOR sd) { SECURITY_DESCRIPTOR_REAL SecurityDescriptorToRealRet = default; var sr = new SECURITY_DESCRIPTOR_REAL(); MemPtr msacl = sd.Sacl; MemPtr mdacl = sd.Dacl; sr.Sacl = msacl.ToStruct <ACL>(); sr.Dacl = mdacl.ToStruct <ACL>(); SecurityDescriptorToRealRet = sr; return(SecurityDescriptorToRealRet); }