internal static byte[] GetDacl(string filename)
        {
            int lengthNeeded = 0;
            int num2         = UnsafeNativeMethods.GetFileSecurity(filename, 7, null, 0, ref lengthNeeded);
            int lastError    = Marshal.GetLastWin32Error();

            if (num2 != 0)
            {
                return(s_nullDacl);
            }
            if (HttpException.HResultFromLastError(lastError) != -2147024774)
            {
                return(null);
            }
            byte[] securityDescriptor = new byte[lengthNeeded];
            if (UnsafeNativeMethods.GetFileSecurity(filename, 7, securityDescriptor, securityDescriptor.Length, ref lengthNeeded) == 0)
            {
                return(null);
            }
            byte[] buffer2 = (byte[])s_interned[securityDescriptor];
            if (buffer2 == null)
            {
                lock (s_interned.SyncRoot)
                {
                    buffer2 = (byte[])s_interned[securityDescriptor];
                    if (buffer2 == null)
                    {
                        buffer2             = securityDescriptor;
                        s_interned[buffer2] = buffer2;
                    }
                }
            }
            return(buffer2);
        }