Exemple #1
0
        private static string GetPrivilegeName(NativeHelpers.LUID luid)
        {
            UInt32 nameLen = 0;

            NativeMethods.LookupPrivilegeName(null, ref luid, null, ref nameLen);

            StringBuilder name = new StringBuilder((int)(nameLen + 1));

            if (!NativeMethods.LookupPrivilegeName(null, ref luid, name, ref nameLen))
            {
                throw new Win32Exception("LookupPrivilegeName() failed");
            }

            return(name.ToString());
        }
Exemple #2
0
 public static extern bool LookupPrivilegeValue(
     string lpSystemName,
     string lpName,
     out NativeHelpers.LUID lpLuid);
Exemple #3
0
 public static extern bool LookupPrivilegeName(
     string lpSystemName,
     ref NativeHelpers.LUID lpLuid,
     StringBuilder lpName,
     ref UInt32 cchName);