public void GetSecurity(SecurityInformation RequestedInformation, out IntPtr ppSecurityDescriptor, [MarshalAs(UnmanagedType.Bool)] bool fDefault) { byte[] raw_sd = _sd ?? _handle.GetSecurityDescriptorBytes(RequestedInformation); IntPtr ret = Win32NativeMethods.LocalAlloc(0, new IntPtr(raw_sd.Length)); Marshal.Copy(raw_sd, 0, ret, raw_sd.Length); ppSecurityDescriptor = ret; }