예제 #1
0
        private static string GetSecurityPermissions(COMSD sdtype)
        {
            IntPtr sd = IntPtr.Zero;

            try
            {
                int hr = CoGetSystemSecurityPermissions(sdtype, out sd);
                if (hr != 0)
                {
                    throw new Win32Exception(hr);
                }

                int    length = GetSecurityDescriptorLength(sd);
                byte[] ret    = new byte[length];
                Marshal.Copy(sd, ret, 0, length);
                return(GetStringSDForSD(ret));
            }
            finally
            {
                if (sd != IntPtr.Zero)
                {
                    LocalFree(sd);
                }
            }
        }
예제 #2
0
 private extern static int CoGetSystemSecurityPermissions(COMSD comSDType, out IntPtr ppSD);
예제 #3
0
 public static extern HRESULT CoGetSystemSecurityPermissions(COMSD comSDType, [NativeTypeName("PSECURITY_DESCRIPTOR *")] void **ppSD);