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

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

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

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

            return(name.ToString());
        }
예제 #2
0
 public static extern UInt32 LsaLogonUser(
     SafeLsaHandle LsaHandle,
     NativeHelpers.LSA_STRING OriginName,
     LogonType LogonType,
     UInt32 AuthenticationPackage,
     IntPtr AuthenticationInformation,
     UInt32 AuthenticationInformationLength,
     IntPtr LocalGroups,
     NativeHelpers.TOKEN_SOURCE SourceContext,
     out SafeLsaMemoryBuffer ProfileBuffer,
     out UInt32 ProfileBufferLength,
     out NativeHelpers.LUID LogonId,
     out SafeNativeHandle Token,
     out IntPtr Quotas,
     out UInt32 SubStatus);
예제 #3
0
 public static extern bool LookupPrivilegeNameW(
     string lpSystemName,
     ref NativeHelpers.LUID lpLuid,
     StringBuilder lpName,
     ref UInt32 cchName);
예제 #4
0
 public static extern bool AllocateLocallyUniqueId(
     out NativeHelpers.LUID Luid);