public static ACCESS_ALLOWED_ACE GetAce(IntPtr pAcl, int aceIndex) { if (AdvApi32.GetAce(pAcl, aceIndex, out IntPtr acePtr)) { return((ACCESS_ALLOWED_ACE)Marshal.PtrToStructure(acePtr, typeof(ACCESS_ALLOWED_ACE))); } throw new System.ComponentModel.Win32Exception(); }