Example #1
0
        public string GetName()
        {
            switch (Use)
            {
            case SidNameUse.Domain:
            case SidNameUse.Invalid:
            case SidNameUse.Unknown:
                return(string.Empty);

            default:
                return(Name.ToString());
            }
        }
        /// <summary>
        /// Lower case a string according to the internal NTDLL string routines.
        /// </summary>
        /// <param name="str">The string to lower case.</param>
        /// <param name="throw_on_error">True to throw on error.</param>
        /// <returns>The lower case string.</returns>
        public static NtResult <string> Downcase(string str, bool throw_on_error)
        {
            UnicodeStringOut out_str = new UnicodeStringOut();

            try
            {
                return(NtRtl.RtlUpcaseUnicodeString(ref out_str, new UnicodeString(str), true).CreateResult(throw_on_error, () => out_str.ToString()));
            }
            finally
            {
                NtRtl.RtlFreeUnicodeString(ref out_str);
            }
        }